Skip to content

Commit

Permalink
add withdraw method to UniversalCollection.Collection resource (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
austinkline authored Sep 9, 2024
1 parent 7a021d3 commit decd835
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions contracts/nft/UniversalCollection.cdc
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ access(all) contract UniversalCollection {
return &self.ownedNFTs[id]
}

access(NonFungibleToken.Withdraw) fun withdraw(withdrawID: UInt64): @{NonFungibleToken.NFT} {
return <- self.ownedNFTs.remove(key: withdrawID)!
}

init (nftType: Type) {
self.ownedNFTs <- {}
self.nftType = nftType
Expand Down

0 comments on commit decd835

Please sign in to comment.