Skip to content

Commit edd780a

Browse files
committed
Documentation updates
1 parent 85b3755 commit edd780a

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

index.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ export function callMarketPlaceBuy(config: Config, args: BuyNftArgs):
22
Promise<void>
33
export function callMarketPlaceListNft(config: Config):
44
Promise<Array<NftListing>>
5+
/**
6+
* Fetch the info for a single NFT. Returns null if the given
7+
* transaction input has been spent (for example if the NFT has been
8+
* bought).
9+
*/
510
export function callMarketPlaceFetchNft(config: Config, args: FetchNftArgs):
611
Promise<NftListing?>
712
export function connectWallet(): Promise<any>

src/Seabug/Contract/MarketPlaceFetchNft.purs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ module Seabug.Contract.MarketPlaceFetchNft
55

66
import Contract.Prelude
77

8-
import Contract.Monad (Contract, liftContractM, liftedE, liftedM)
8+
import Contract.Monad (Contract, liftContractM, liftedE, liftedM, logWarn')
99
import Contract.PlutusData (fromData, getDatumByHash)
1010
import Contract.Transaction (TransactionInput, TransactionOutput(..))
1111
import Contract.Utxos (getUtxo)
@@ -14,14 +14,17 @@ import Seabug.Contract.Common (NftResult)
1414
import Seabug.Metadata (getFullSeabugMetadataWithBackoff)
1515
import Seabug.Types (MarketplaceDatum(..))
1616

17+
-- | Fetch the info for a single NFT identified by a utxo
18+
-- | (`TransactionInput`). Returns `Nothing` if the given transaction
19+
-- | input has been spent (for example if the NFT has been bought).
1720
marketPlaceFetchNft
1821
:: forall (r :: Row Type)
1922
. TransactionInput
2023
-> Contract (projectId :: String | r) (Maybe NftResult)
2124
marketPlaceFetchNft ref = do
2225
getUtxo ref >>= case _ of
2326
Nothing -> do
24-
log "Could not find NFT utxo, it may have been spent"
27+
logWarn' "Could not find NFT utxo, it may have been spent"
2528
pure Nothing
2629
Just output@(TransactionOutput nftTxOut) -> do
2730
datumHash <- liftContractM "Datum hash not available for NFT"

0 commit comments

Comments
 (0)