feat(instant sale): allow auction owner place bid on mater nft with no copies

This commit is contained in:
shotgunofdeath 2021-09-13 14:19:33 +03:00
parent 54659809e4
commit 6226ade91d
2 changed files with 26 additions and 9 deletions

View File

@ -67,10 +67,14 @@ export const METADATA_PROGRAM_ID =
export const VAULT_ID =
'vau1zxA2LbssAUEF7Gpw91zMM1LvXrvpzJtmZ58rPsn' as StringPublicKey;
// export const AUCTION_ID =
// 'auctxRXPeJoc4817jDhf4HbjnhEcr1cCXenosMhK5R8' as StringPublicKey;
//
// export const METAPLEX_ID =
// 'p1exdMJcjVao65QdewkaZRUnU6VPSXhus9n2GzWfh98' as StringPublicKey;
export const AUCTION_ID =
'auctxRXPeJoc4817jDhf4HbjnhEcr1cCXenosMhK5R8' as StringPublicKey;
'D97wCr2KeRKCbyDmCCWe8dyDmNRDVCpBqnyv8HRfMVLQ' as StringPublicKey;
export const METAPLEX_ID =
'p1exdMJcjVao65QdewkaZRUnU6VPSXhus9n2GzWfh98' as StringPublicKey;
'8sSkg1dMoB6dBPeyHbLcunH2B6Dt6n1MGsUa6nbCms75' as StringPublicKey;
export const SYSTEM = new PublicKey('11111111111111111111111111111111');

View File

@ -44,6 +44,7 @@ import { findEligibleParticipationBidsForRedemption } from '../../actions/claimU
import {
BidRedemptionTicket,
MAX_PRIZE_TRACKING_TICKET_SIZE,
WinningConfigType,
} from '../../models/metaplex';
async function calculateTotalCostOfRedeemingOtherPeoplesBids(
@ -395,7 +396,7 @@ export const AuctionCard = ({
<Spin />
) : auctionView.isInstantSale ? (
!isAuctionManagerAuthorityNotWalletOwner ? (
'Claim master'
'Claim item'
) : auctionView.myBidderPot ? (
'Claim Purchase'
) : (
@ -514,14 +515,26 @@ export const AuctionCard = ({
const instantSale = async () => {
setLoading(true);
// Placing a "bid" of the full amount results in a purchase to redeem.
if (
const instantSalePrice =
auctionView.auctionDataExtended?.info.instantSalePrice;
const winningConfigType =
auctionView.items[0][0].winningConfigType;
const isAuctionItemMaster =
winningConfigType === WinningConfigType.FullRightsTransfer ||
winningConfigType === WinningConfigType.TokenOnlyTransfer;
const allowBidToPublic =
myPayingAccount &&
!auctionView.myBidderPot &&
isAuctionManagerAuthorityNotWalletOwner &&
auctionView.auctionDataExtended?.info.instantSalePrice
) {
instantSalePrice;
const allowBidToAuctionOwner =
myPayingAccount &&
!isAuctionManagerAuthorityNotWalletOwner &&
isAuctionItemMaster &&
instantSalePrice;
// Placing a "bid" of the full amount results in a purchase to redeem.
if (allowBidToPublic || allowBidToAuctionOwner) {
try {
const bid = await sendPlaceBid(
connection,