Created
December 8, 2023 22:40
-
-
Save bjartek/2b6979426866be14ccac0f6ee4ffa683 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 "BasicNFT" | |
transaction(receiver:Address, name:String) { | |
prepare(signer: auth(StorageCapabilities, PublishInboxCapability) &Account) { | |
let storage= signer.capabilities.storage | |
//we issue a capability from our storage | |
let capability = storage.issue<&BasicNFT.Minter>(BasicNFT.minterPath) | |
//we set the name as tag so it is easy for us to revoke it later using a friendly name | |
let capcon = storage.getController(byCapabilityID:capability.id)! | |
capcon.setTag(name) | |
//we publish this capability to the inbox of the receiver | |
signer.inbox.publish(capability, name:name, recipient:receiver) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment