Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minimum Price Support in UI + Minor contract fix #37

Merged
merged 3 commits into from
Jun 15, 2021
Merged

Conversation

bhgames
Copy link
Contributor

@bhgames bhgames commented Jun 14, 2021

No description provided.

… a minor bug in the auction contract for minimum price checks
@vercel
Copy link

vercel bot commented Jun 14, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployments, click below or on the icon next to each commit.

metaplex-web – ./js

🔍 Inspect: https://vercel.com/metaplex/metaplex-web/BPr7Dq8m3Bq8tU1VcvzbVrMuSxhj
✅ Preview: https://metaplex-web-git-minimum-price-metaplex.vercel.app

ono-store – ./js

🔍 Inspect: https://vercel.com/metaplex/ono-store/5p4py5xXjq1Y2H8hekyj3usGN69R
✅ Preview: https://ono-store-git-minimum-price-metaplex.vercel.app

helium – ./js

🔍 Inspect: https://vercel.com/metaplex/helium/DeGgchZRqMMaVcLPhwta4QC8c7Xh
✅ Preview: https://helium-git-minimum-price-metaplex.vercel.app

@bhgames bhgames changed the title Hook up minimum price to the front end with some borsh hacks, and fix… Minimum Price Support in UI + Minor contract fix Jun 14, 2021
28: number;
29: number;
30: number;
31: number;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forgive me @bartosz-lipinski

) : (
<Row style={{ width: '100%', flexWrap: 'nowrap' }}>
{state && state.days > 0 && (
{state &&
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just my formatter formatting things better than your formatter

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

commit the config so its the same....

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah we probably should

type: attributes.priceFloor
? PriceFloorType.Minimum
: PriceFloorType.None,
hash: new U832ArrayBorshHack({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we create a static method on U832ArrayBorshHack so we could do something like U832ArrayBorshHack.fromArray(asArray) or U832ArrayBorshHack.create(asArray)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah not a bad call. @bartosz-lipinski is gonna first see if there is a way borsh can just handle this case better so we don't even need this, but if there isn't, I'll add that.

@@ -235,7 +235,7 @@ pub fn place_bid<'r, 'b: 'r>(
args.amount,
min[0]
);
if args.amount <= min[0] {
if args.amount < min[0] {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the minimum is 1 and you bid 1, you can't bid it. With this fix, you can now bid 1. Nothing special here. :)

@bhgames bhgames marked this pull request as draft June 14, 2021 20:43
this.hash = args.hash || new Uint8Array(32);
if (this.type === PriceFloorType.Minimum) {
if (args.minPrice) {
this.hash.set(args.minPrice.toArrayLike(Buffer, 'le', 8), 0);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this sets the first 8 entries, and leaves the rest as 0s?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

correct.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love it. Let's merge this bad boy.

@bhgames bhgames marked this pull request as ready for review June 14, 2021 22:44
@bhgames
Copy link
Contributor Author

bhgames commented Jun 15, 2021

@bartosz-lipinski let me know when you've resolved that react issue you said you had

@bhgames bhgames merged commit 377f6cd into master Jun 15, 2021
lwus pushed a commit to lwus/metaplex that referenced this pull request Nov 11, 2021
)

* Hook up minimum price to the front end with some borsh hacks, and fix a minor bug in the auction contract for minimum price checks

* Remove excess definitions we dont need from the hack.

* feat: no hacks allowed

Co-authored-by: bartosz-lipinski <264380+bartosz-lipinski@users.noreply.github.com>
austbot pushed a commit that referenced this pull request Dec 7, 2021
* feat(packs): redeeming

* feat: add probability to cards in pack (#32)

* dummy modal component (#33)

* fix an ability to close modal (#34)

* fix: fetch editions on pack page

* fix: re-fetch data on visiting artworks page

fix: pull items page typing

fix: hide initial store modal

fix: build issues

return websockets

drop websockets

clean-up

* refactor: clean-up

* feat: remove packs from homepage (#36)

* feat: merge voucher metadata with pack (#37)

* fix: instruction chunks to optimize packs creation (#38)

* refactor: remove websockets

* fix: build

* refactor: remove unneded fetch

* fix: fetch item that is redeemed

* feat: Add limit of cards per pack (#40)

* fix: revert meta use effect

* feat: update transactions due to program changes

* fix: build and clean-up

* chore: update CHANGELOG.md

* chore: update CHANGELOG

* feat: extend pack details view with voucher (#41)

* feat: redesign pack card (#42)

* feat: updated pack card

* fix: comments fixed

* fix: packs layout on small screens (#43)

* fix: hotfix create art view card (#44)

* feat: remove opening pack after click (#45)

* feat: remove pack card animation (#46)

* feat: remove animation from packs (#47)

* feat: new open pack button (#48)

* fix: less compilation

* refactor: pack page always has editionId (#49)

* feat: implement request cards as a single transaction. (#50)

* fix: build

* feat: create action to request cards (#51)

* fix: auctions cards UI layout (#52)

* feat: modal for redeemed cards (#53)

* feat: redeem pack modal

* fix: small refactor

* fix: comments fixed

* fix: refactor after comments

* feat: implement full pack size claim (#54)

* feat: modal for approve transactions explanation (#55)

* feat: added approve transaction step

* fix: comments fixed

* refactor: remove unused component

* feat: update logic of packs displaying in My Items section (#56)

* feat: Use Context to store pack state (#58)

* fix: import

* fix: styles

* fix: style variable

* fix: fetch pack state after redeem (#59)

* Merge master from foundation

* fix: packs feature flag

* feat: pack page mobile view (#57)

* fix: build

* feat: partially open pack (#62)

* feat: mobile view for claim pack modal (#63)

* feat: provide random oracle in transactions (#64)

* fix: redeemed cards list is wrong (#65)

Co-authored-by: Paul <5280742+kurpav@users.noreply.github.com>
Co-authored-by: ViacheslavMylostyvyi <gamer2forse@gmail.com>
Co-authored-by: Irina Kadushkina <69786983+ikadushkina@users.noreply.github.com>
austbot pushed a commit that referenced this pull request Dec 8, 2021
* feat(packs): redeeming

* feat: add probability to cards in pack (#32)

* dummy modal component (#33)

* fix an ability to close modal (#34)

* fix: fetch editions on pack page

* fix: re-fetch data on visiting artworks page

fix: pull items page typing

fix: hide initial store modal

fix: build issues

return websockets

drop websockets

clean-up

* refactor: clean-up

* feat: remove packs from homepage (#36)

* feat: merge voucher metadata with pack (#37)

* fix: instruction chunks to optimize packs creation (#38)

* refactor: remove websockets

* fix: build

* refactor: remove unneded fetch

* fix: fetch item that is redeemed

* feat: Add limit of cards per pack (#40)

* fix: revert meta use effect

* feat: update transactions due to program changes

* fix: build and clean-up

* chore: update CHANGELOG.md

* chore: update CHANGELOG

* feat: extend pack details view with voucher (#41)

* feat: redesign pack card (#42)

* feat: updated pack card

* fix: comments fixed

* fix: packs layout on small screens (#43)

* fix: hotfix create art view card (#44)

* feat: remove opening pack after click (#45)

* feat: remove pack card animation (#46)

* feat: remove animation from packs (#47)

* feat: new open pack button (#48)

* fix: less compilation

* refactor: pack page always has editionId (#49)

* feat: implement request cards as a single transaction. (#50)

* fix: build

* feat: create action to request cards (#51)

* fix: auctions cards UI layout (#52)

* feat: modal for redeemed cards (#53)

* feat: redeem pack modal

* fix: small refactor

* fix: comments fixed

* fix: refactor after comments

* feat: implement full pack size claim (#54)

* feat: modal for approve transactions explanation (#55)

* feat: added approve transaction step

* fix: comments fixed

* refactor: remove unused component

* feat: update logic of packs displaying in My Items section (#56)

* feat: Use Context to store pack state (#58)

* fix: import

* fix: styles

* fix: style variable

* fix: fetch pack state after redeem (#59)

* Merge master from foundation

* fix: packs feature flag

* feat: pack page mobile view (#57)

* fix: build

* feat: partially open pack (#62)

* feat: mobile view for claim pack modal (#63)

* feat: provide random oracle in transactions (#64)

* fix: redeemed cards list is wrong (#65)

* feat: update pack opening resume

Co-authored-by: Paul <5280742+kurpav@users.noreply.github.com>
Co-authored-by: ViacheslavMylostyvyi <gamer2forse@gmail.com>
Co-authored-by: Irina Kadushkina <69786983+ikadushkina@users.noreply.github.com>
@stegaBOB stegaBOB deleted the minimum-price branch January 3, 2022 22:41
nikkaroraa pushed a commit to tech-guides/metaplex that referenced this pull request Jan 22, 2022
* feat(packs): redeeming

* feat: add probability to cards in pack (metaplex-foundation#32)

* dummy modal component (metaplex-foundation#33)

* fix an ability to close modal (metaplex-foundation#34)

* fix: fetch editions on pack page

* fix: re-fetch data on visiting artworks page

fix: pull items page typing

fix: hide initial store modal

fix: build issues

return websockets

drop websockets

clean-up

* refactor: clean-up

* feat: remove packs from homepage (metaplex-foundation#36)

* feat: merge voucher metadata with pack (metaplex-foundation#37)

* fix: instruction chunks to optimize packs creation (metaplex-foundation#38)

* refactor: remove websockets

* fix: build

* refactor: remove unneded fetch

* fix: fetch item that is redeemed

* feat: Add limit of cards per pack (metaplex-foundation#40)

* fix: revert meta use effect

* feat: update transactions due to program changes

* fix: build and clean-up

* chore: update CHANGELOG.md

* chore: update CHANGELOG

* feat: extend pack details view with voucher (metaplex-foundation#41)

* feat: redesign pack card (metaplex-foundation#42)

* feat: updated pack card

* fix: comments fixed

* fix: packs layout on small screens (metaplex-foundation#43)

* fix: hotfix create art view card (metaplex-foundation#44)

* feat: remove opening pack after click (metaplex-foundation#45)

* feat: remove pack card animation (metaplex-foundation#46)

* feat: remove animation from packs (metaplex-foundation#47)

* feat: new open pack button (metaplex-foundation#48)

* fix: less compilation

* refactor: pack page always has editionId (metaplex-foundation#49)

* feat: implement request cards as a single transaction. (metaplex-foundation#50)

* fix: build

* feat: create action to request cards (metaplex-foundation#51)

* fix: auctions cards UI layout (metaplex-foundation#52)

* feat: modal for redeemed cards (metaplex-foundation#53)

* feat: redeem pack modal

* fix: small refactor

* fix: comments fixed

* fix: refactor after comments

* feat: implement full pack size claim (metaplex-foundation#54)

* feat: modal for approve transactions explanation (metaplex-foundation#55)

* feat: added approve transaction step

* fix: comments fixed

* refactor: remove unused component

* feat: update logic of packs displaying in My Items section (metaplex-foundation#56)

* feat: Use Context to store pack state (metaplex-foundation#58)

* fix: import

* fix: styles

* fix: style variable

* fix: fetch pack state after redeem (metaplex-foundation#59)

* Merge master from foundation

* fix: packs feature flag

* feat: pack page mobile view (metaplex-foundation#57)

* fix: build

* feat: partially open pack (metaplex-foundation#62)

* feat: mobile view for claim pack modal (metaplex-foundation#63)

* feat: provide random oracle in transactions (metaplex-foundation#64)

* fix: redeemed cards list is wrong (metaplex-foundation#65)

Co-authored-by: Paul <5280742+kurpav@users.noreply.github.com>
Co-authored-by: ViacheslavMylostyvyi <gamer2forse@gmail.com>
Co-authored-by: Irina Kadushkina <69786983+ikadushkina@users.noreply.github.com>
nikkaroraa pushed a commit to tech-guides/metaplex that referenced this pull request Jan 22, 2022
* feat(packs): redeeming

* feat: add probability to cards in pack (metaplex-foundation#32)

* dummy modal component (metaplex-foundation#33)

* fix an ability to close modal (metaplex-foundation#34)

* fix: fetch editions on pack page

* fix: re-fetch data on visiting artworks page

fix: pull items page typing

fix: hide initial store modal

fix: build issues

return websockets

drop websockets

clean-up

* refactor: clean-up

* feat: remove packs from homepage (metaplex-foundation#36)

* feat: merge voucher metadata with pack (metaplex-foundation#37)

* fix: instruction chunks to optimize packs creation (metaplex-foundation#38)

* refactor: remove websockets

* fix: build

* refactor: remove unneded fetch

* fix: fetch item that is redeemed

* feat: Add limit of cards per pack (metaplex-foundation#40)

* fix: revert meta use effect

* feat: update transactions due to program changes

* fix: build and clean-up

* chore: update CHANGELOG.md

* chore: update CHANGELOG

* feat: extend pack details view with voucher (metaplex-foundation#41)

* feat: redesign pack card (metaplex-foundation#42)

* feat: updated pack card

* fix: comments fixed

* fix: packs layout on small screens (metaplex-foundation#43)

* fix: hotfix create art view card (metaplex-foundation#44)

* feat: remove opening pack after click (metaplex-foundation#45)

* feat: remove pack card animation (metaplex-foundation#46)

* feat: remove animation from packs (metaplex-foundation#47)

* feat: new open pack button (metaplex-foundation#48)

* fix: less compilation

* refactor: pack page always has editionId (metaplex-foundation#49)

* feat: implement request cards as a single transaction. (metaplex-foundation#50)

* fix: build

* feat: create action to request cards (metaplex-foundation#51)

* fix: auctions cards UI layout (metaplex-foundation#52)

* feat: modal for redeemed cards (metaplex-foundation#53)

* feat: redeem pack modal

* fix: small refactor

* fix: comments fixed

* fix: refactor after comments

* feat: implement full pack size claim (metaplex-foundation#54)

* feat: modal for approve transactions explanation (metaplex-foundation#55)

* feat: added approve transaction step

* fix: comments fixed

* refactor: remove unused component

* feat: update logic of packs displaying in My Items section (metaplex-foundation#56)

* feat: Use Context to store pack state (metaplex-foundation#58)

* fix: import

* fix: styles

* fix: style variable

* fix: fetch pack state after redeem (metaplex-foundation#59)

* Merge master from foundation

* fix: packs feature flag

* feat: pack page mobile view (metaplex-foundation#57)

* fix: build

* feat: partially open pack (metaplex-foundation#62)

* feat: mobile view for claim pack modal (metaplex-foundation#63)

* feat: provide random oracle in transactions (metaplex-foundation#64)

* fix: redeemed cards list is wrong (metaplex-foundation#65)

* feat: update pack opening resume

Co-authored-by: Paul <5280742+kurpav@users.noreply.github.com>
Co-authored-by: ViacheslavMylostyvyi <gamer2forse@gmail.com>
Co-authored-by: Irina Kadushkina <69786983+ikadushkina@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants