Skip to content

Commit

Permalink
update link tx
Browse files Browse the repository at this point in the history
  • Loading branch information
judezhu committed Jun 3, 2024
1 parent 9ca7446 commit 24de4b5
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions pds/transactions/dapperSport/link_providerCap_dapperSport.cdc
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
import NonFungibleToken from 0x{{.NonFungibleToken}}
import {{.DapperSportContract}} from 0x{{.DapperSportAddress}}
import NonFungibleToken from "NonFungibleToken"
import DapperSport from "DapperSport"

transaction(NFTProviderPath: PrivatePath) {

prepare(signer: AuthAccount) {
prepare(signer: auth(Capabilities) &Account) {
if signer.getCapability<&{NonFungibleToken.Provider}>(NFTProviderPath).check() {
return
}
let cap = signer.capabilities.storage.issue<&{NonFungibleToken.Provider}>(target: DapperSport.CollectionStoragePath)

// This needs to be used to allow for PDS to withdraw
signer.link<&{NonFungibleToken.Provider}>( NFTProviderPath, target: {{.DapperSportContract}}.CollectionStoragePath)
signer.capabilities.publish(cap, at: NFTProviderPath)
}

}

0 comments on commit 24de4b5

Please sign in to comment.