Created
February 26, 2021 18:04
-
-
Save polluterofminds/35f6b46abe8ad59237e491b280d30665 to your computer and use it in GitHub Desktop.
PinataParty Minting Transaction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import PinataPartyContract from 0xf8d6e0586b0a20c7 | |
transaction { | |
let receiverRef: &{PinataPartyContract.NFTReceiver} | |
let minterRef: &PinataPartyContract.NFTMinter | |
prepare(acct: AuthAccount) { | |
self.receiverRef = acct.getCapability<&{PinataPartyContract.NFTReceiver}>(/public/NFTReceiver) | |
.borrow() | |
?? panic("Could not borrow receiver reference") | |
self.minterRef = acct.borrow<&PinataPartyContract.NFTMinter>(from: /storage/NFTMinter) | |
?? panic("could not borrow minter reference") | |
} | |
execute { | |
let metadata : {String : String} = { | |
"name": "The Big Swing", | |
"swing_velocity": "29", | |
"swing_angle": "45", | |
"rating": "5", | |
"uri": "ipfs://QmRZdc3mAMXpv6Akz9Ekp1y4vDSjazTx2dCQRkxVy1yUj6" | |
} | |
let newNFT <- self.minterRef.mintNFT() | |
self.receiverRef.deposit(token: <-newNFT, metadata: metadata) | |
log("NFT Minted and deposited to Account 2's Collection") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment