hicetnunc2000 / hicetnunc

hicetnunc UI/UX
http://hicetnunc.xyz
800 stars 281 forks source link

"Edition" is Always Swaps Count #92

Closed atomantic closed 3 years ago

atomantic commented 3 years ago

In this example: https://hicetnunc.xyz/objkt/3942

the first 1/5 was sold for 1 XTZ to tz1c2iwyckUCcicx2qxqtwLEartYFEHg1pvB the creator holds 3: tz1iyFi4WjSttoja7Vi1EJYMEKKSebQyMkF9 the platform holds 1: KT1Hkg5qeNhfwpKW4fXvq7HGZB9z2EnmCCA9

The Edition for sale is listed as 1/5, but it should be 2/5 (#2 of 5 is for sale at 5 XTZ)

Screen Shot 2021-03-11 at 10 58 19 AM

Imagining this could be calculated like so:

const editionNumber = Object.keys(owners).reduce((edition, ownerID)=>{
   // not the platform or the creator 
   if(owners[ownerID]!=='KT1Hkg5qeNhfwpKW4fXvq7HGZB9z2EnmCCA9' && !token_array.creators.includes(owners[ownerID])){
    // add the count of market owned editions
    // todo: not sure why these counts are stored as strings instead of numbers
    edition = edition + Number(owners[ownerID]);
   }
   return edition;
}, 0);
andrevenancio commented 3 years ago

Thanks for picking this up! mind submitting a PR?

crzypatchwork commented 3 years ago

this along the lowest swap price would fix completely this part (remaining us to see transactional histories actually)

andrevenancio commented 3 years ago

Can you update your lower price PR with this fix too @atomantic ?

atomantic commented 3 years ago

I made a new PR with a branch from the lowest_price since they are easy to take one at a time, but if you want to take them both at once it's here: https://github.com/hicetnunc2000/hicetnunc/pull/109 :)

skenaja commented 3 years ago

This is now resolved, closing.