diff --git a/Sources/Metaplex/Modules/AuctionHouse/Builders/Bid/Create/CreateBidBuilder.swift b/Sources/Metaplex/Modules/AuctionHouse/Builders/Bid/Create/CreateBidBuilder.swift index 0431cf9..9894db5 100644 --- a/Sources/Metaplex/Modules/AuctionHouse/Builders/Bid/Create/CreateBidBuilder.swift +++ b/Sources/Metaplex/Modules/AuctionHouse/Builders/Bid/Create/CreateBidBuilder.swift @@ -12,7 +12,7 @@ import Solana extension TransactionBuilder { static func createBidBuilder(parameters: CreateBidBuilderParameters) -> TransactionBuilder { // MARK: - Accounts - + let buyAccounts = BuyAccounts( wallet: parameters.wallet, paymentAccount: parameters.paymentAccount, @@ -112,7 +112,7 @@ extension TransactionBuilder { // MARK: - Create Token Account Instruction - // TODO: Create an account if it doesn't exist. Will come back to this as there's a bit involved. + #warning("Create an account if it doesn't exist. Will come back to this as there's a bit involved.") // MARK: - Transaction Builder diff --git a/Sources/Metaplex/Modules/AuctionHouse/Builders/Listing/Cancel/CancelListingBuilderParameters.swift b/Sources/Metaplex/Modules/AuctionHouse/Builders/Listing/Cancel/CancelListingBuilderParameters.swift index b16ea71..0cebce3 100644 --- a/Sources/Metaplex/Modules/AuctionHouse/Builders/Listing/Cancel/CancelListingBuilderParameters.swift +++ b/Sources/Metaplex/Modules/AuctionHouse/Builders/Listing/Cancel/CancelListingBuilderParameters.swift @@ -44,7 +44,6 @@ struct CancelListingBuilderParameters { } var receipt: PublicKey? { cancelListingInput.listing.listingReceipt.receipt?.publicKey } - // MARK: - Args var price: UInt64 { cancelListingInput.listing.listingReceipt.price } diff --git a/Sources/Metaplex/Modules/AuctionHouse/Operations/AuctionHouse/Create/CreateAuctionHouseOperationHandler.swift b/Sources/Metaplex/Modules/AuctionHouse/Operations/AuctionHouse/Create/CreateAuctionHouseOperationHandler.swift index e122112..7be1d83 100644 --- a/Sources/Metaplex/Modules/AuctionHouse/Operations/AuctionHouse/Create/CreateAuctionHouseOperationHandler.swift +++ b/Sources/Metaplex/Modules/AuctionHouse/Operations/AuctionHouse/Create/CreateAuctionHouseOperationHandler.swift @@ -95,7 +95,7 @@ class CreateAuctionHouseOperationHandler: OperationHandler { callback(.failure(.confirmTransactionError(error))) } } - }.flatMap { status in + }.flatMap { _ in OperationResult.init { callback in self.metaplex.auctionHouse.findByAddress(parameters.auctionHouse) { callback($0) } } diff --git a/Sources/Metaplex/Modules/AuctionHouse/Operations/AuctionHouse/Find/FindAuctionHouseByCreatorAndMintOperationHandler.swift b/Sources/Metaplex/Modules/AuctionHouse/Operations/AuctionHouse/Find/FindAuctionHouseByCreatorAndMintOperationHandler.swift index 1791c31..92224af 100644 --- a/Sources/Metaplex/Modules/AuctionHouse/Operations/AuctionHouse/Find/FindAuctionHouseByCreatorAndMintOperationHandler.swift +++ b/Sources/Metaplex/Modules/AuctionHouse/Operations/AuctionHouse/Find/FindAuctionHouseByCreatorAndMintOperationHandler.swift @@ -25,7 +25,7 @@ class FindAuctionHouseByCreatorAndMintOperationHandler: OperationHandler { OperationResult.pure(Auctionhouse.pda(creator: input.creator, treasuryMint: input.treasuryMint)).flatMap { address in OperationResult.init { callback in self.metaplex.auctionHouse.findByAddress(address.publicKey) { result in - callback(result.mapError { $0 } ) + callback(result.mapError { $0 }) } } }.mapError { OperationError.findAuctionHouseByCreatorAndMintError($0) } diff --git a/Sources/Metaplex/Modules/AuctionHouse/Operations/Bids/Create/CreateBidOperationHandler.swift b/Sources/Metaplex/Modules/AuctionHouse/Operations/Bids/Create/CreateBidOperationHandler.swift index 6600751..7c9b718 100644 --- a/Sources/Metaplex/Modules/AuctionHouse/Operations/Bids/Create/CreateBidOperationHandler.swift +++ b/Sources/Metaplex/Modules/AuctionHouse/Operations/Bids/Create/CreateBidOperationHandler.swift @@ -108,7 +108,7 @@ class CreateBidOperationHandler: OperationHandler { callback(.failure(.confirmTransactionError(error))) } } - }.flatMap { status in + }.flatMap { _ in OperationResult.init { callback in if let receipt = parameters.receipt { self.metaplex.auctionHouse.findBidByReceipt( diff --git a/Sources/Metaplex/Modules/AuctionHouse/Operations/Bids/Find/FindBidsByPublicKeyFieldOperationHandler.swift b/Sources/Metaplex/Modules/AuctionHouse/Operations/Bids/Find/FindBidsByPublicKeyFieldOperationHandler.swift index 4d0a41e..06794d7 100644 --- a/Sources/Metaplex/Modules/AuctionHouse/Operations/Bids/Find/FindBidsByPublicKeyFieldOperationHandler.swift +++ b/Sources/Metaplex/Modules/AuctionHouse/Operations/Bids/Find/FindBidsByPublicKeyFieldOperationHandler.swift @@ -37,7 +37,9 @@ class FindBidsByPublicKeyFieldOperationHandler: OperationHandler { case .metadata(let address): query = query.whereMetadata(address: address) case .mint(let mintKey): - guard let address = try? MetadataAccount.pda(mintKey: mintKey).get() else { return .failure(OperationError.couldNotFindPDA) } + guard let address = try? MetadataAccount.pda(mintKey: mintKey).get() + else { return .failure(OperationError.couldNotFindPDA) } + query = query.whereMetadata(address: address) } return query.getAndMap { (accounts: [AccountInfoWithPureData]) in diff --git a/Sources/Metaplex/Modules/AuctionHouse/Operations/Listing/Create/CreateListingOperationHandler.swift b/Sources/Metaplex/Modules/AuctionHouse/Operations/Listing/Create/CreateListingOperationHandler.swift index de9eddd..121cdff 100644 --- a/Sources/Metaplex/Modules/AuctionHouse/Operations/Listing/Create/CreateListingOperationHandler.swift +++ b/Sources/Metaplex/Modules/AuctionHouse/Operations/Listing/Create/CreateListingOperationHandler.swift @@ -105,7 +105,7 @@ class CreateListingOperationHandler: OperationHandler { callback(.failure(.confirmTransactionError(error))) } } - }.flatMap { status in + }.flatMap { _ in OperationResult.init { callback in if let receipt = parameters.receipt { self.metaplex.auctionHouse.findListingByReceipt( diff --git a/Sources/Metaplex/Modules/AuctionHouse/Operations/Sale/Create/ExecuteSaleOperationHandler.swift b/Sources/Metaplex/Modules/AuctionHouse/Operations/Sale/Create/ExecuteSaleOperationHandler.swift index 7cb87ed..e104382 100644 --- a/Sources/Metaplex/Modules/AuctionHouse/Operations/Sale/Create/ExecuteSaleOperationHandler.swift +++ b/Sources/Metaplex/Modules/AuctionHouse/Operations/Sale/Create/ExecuteSaleOperationHandler.swift @@ -123,7 +123,7 @@ class ExecuteSaleOperationHandler: OperationHandler { callback(.failure(.confirmTransactionError(error))) } } - }.flatMap { status in + }.flatMap { _ in OperationResult.init { callback in if let receipt = parameters.receipt { self.metaplex.auctionHouse.findPurchaseByReceipt( diff --git a/Sources/Metaplex/Modules/AuctionHouse/Operations/Sale/Find/FindPurchaseByReceiptOperationHandler.swift b/Sources/Metaplex/Modules/AuctionHouse/Operations/Sale/Find/FindPurchaseByReceiptOperationHandler.swift index 93c0f13..d7afc9e 100644 --- a/Sources/Metaplex/Modules/AuctionHouse/Operations/Sale/Find/FindPurchaseByReceiptOperationHandler.swift +++ b/Sources/Metaplex/Modules/AuctionHouse/Operations/Sale/Find/FindPurchaseByReceiptOperationHandler.swift @@ -31,7 +31,11 @@ class FindPurchaseByReceiptOperationHandler: OperationHandler { .mapError { OperationError.findPurchaseByReceiptError($0) } .flatMap { purchaseReceipt in OperationResult.init { callback in - let lazyPurchase = LazyPurchase(auctionHouse: input.auctionHouse, purchaseReceipt: purchaseReceipt, publicKey: input.address) + let lazyPurchase = LazyPurchase( + auctionHouse: input.auctionHouse, + purchaseReceipt: purchaseReceipt, + publicKey: input.address + ) self.metaplex.auctionHouse.loadPurchase(lazyPurchase) { callback($0) }