feat(instant sale): allow auction owner place bid on mater nft with no copies
This commit is contained in:
parent
54659809e4
commit
6226ade91d
|
@ -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');
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue