Moment NFT Properties
Get properties for a NFT moment.
Parameters:
- address: The Flow Address of the account whose moment data needs to be read
- id: The id of the NFT moment
Returns [AnyStruct]
- An array of nft properties.
import NonFungibleToken from 0xNONFUNGIBLETOKENADDRESS
import AllDay from 0xALLDAYADDRESS
pub fun main(address: Address, id: UInt64): [AnyStruct] {
let account = getAccount(address)
let collectionRef = account.getCapability(AllDay.CollectionPublicPath)
.borrow<&{AllDay.MomentNFTCollectionPublic}>()
?? panic("Could not borrow capability from public collection")
let nft = collectionRef.borrowMomentNFT(id: id)
?? panic("Couldn't borrow momentNFT")
return [nft.id, nft.editionID, nft.serialNumber, nft.mintingDate]
}