XRPLF / xrpl-py

A Python library to interact with the XRP Ledger (XRPL) blockchain
ISC License
148 stars 84 forks source link

[Bug]: Unable to create a sell offer using `NFTokenCreateOffer` #488

Closed wiseaidev closed 1 year ago

wiseaidev commented 1 year ago

Hey everyone. I am currently in the process of building an NFT marketplace backend for moerphous, a submission for the current xrpl hackathon. So far, I was able to mint NFTs to store metadata about user info. However, I am not able to create a sell offer using the NFTokenCreateOffer class for minted nfts. When instantiating this class, it throws the following exception:

xrpl.models.exceptions.XRPLModelException: {'owner': 'Must be present for buy offers'}

I am not sure why it complains about the owner, even though it is a selling offer, not a buying one.

That's pretty much it. I hope that I will be able to finish the project before the deadline. Have a nice day/evening.

JST5000 commented 1 year ago

For that offer to be a sell offer, you need to set flag to 0x00000001 - Source: https://xrpl.org/nftokencreateoffer.html#nftokencreateoffer-flags

wiseaidev commented 1 year ago

Hey @JST5000, thanks for the response. I used the xrpl.models.transactions.NFTokenCreateOfferFlag.TF_SELL_NFTOKEN flag, and it works. Let's continue building this damn place. Lesss gooo!