js icon indicating copy to clipboard operation
js copied to clipboard

metaplex.auctionHouse().sell() method Types of property 'asset' are incompatible.

Open coolb0y opened this issue 2 years ago • 0 comments

            Types of property 'asset' are incompatible.
              Type 'Nft | Sft' is not assignable to type 'NftWithToken | SftWithToken'.
                Type 'Nft' is not assignable to type 'NftWithToken | SftWithToken'.
                  Type 'Nft' is not assignable to type 'NftWithToken'.
                    Property 'token' is missing in type 'Nft' but required in type '{ token: Token; }'.

The above error is thrown when trying to execute the function sell of metaplex auctionhose in REACTJS . I have written the following code .

const selling = async()=>{

       const auctionHousee = await metaplex
       .auctionHouse()
       .findByAddress({ address: new PublicKey("Gu95mJVH.........6mYcAu8") });
   
   
      const bid = await metaplex
      .auctionHouse()
      .findBidByReceipt({receiptAddress:new PublicKey("ED5U..........wjCoX1KN6py9KJjWje"),
       auctionHouse:auctionHousee})
    
     console.log('bids',bid);
   
 
   
   const directBuyResponse = await metaplex
        .auctionHouse()
        .sell({
          auctionHouse:auctionHousee,                
       seller: metaplex.identity(),     
       authority: new PublicKey("3BrujtCK9nz.....KRJbxMAkapco"), 
      
       bid:bids,

       price: {
         basisPoints: toBigNumber(0.5*LAMPORTS_PER_SOL),
       },
           
        });
    
        console.log(directBuyResponse);

   }


It worth mentioning that above code works perfect in nodejs for selling nft . But it shows error above while executing it reactjs. I am using react-app-rewired start to start the react js application .

coolb0y avatar Jan 26 '23 22:01 coolb0y