Skip to content

Commit bfcf8a6

Browse files
committed
Documentation updates
1 parent 85b3755 commit bfcf8a6

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
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>

index.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,6 @@ exports.callMarketPlaceListNft = async (config) => {
2727
return sb.callMarketPlaceListNft(config)();
2828
};
2929

30-
/**
31-
* Calls Seabug Contract 'marketPlaceFetchNft'.
32-
* Returns a promise holding the up to date data for the given utxo
33-
* reference.
34-
*/
3530
exports.callMarketPlaceFetchNft = async (config, args) => {
3631
const sb = await seabug;
3732
return sb.callMarketPlaceFetchNft(config)(args)();

src/Seabug/Contract/Common.purs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
-- |
21
module Seabug.Contract.Common
32
( NftResult
43
) where

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)