TransactionSEALED
▓●~$#?╳□▒▓╱◆◇●◆╱▒*█●╲◆~#$@◇!**▫▫?◇@●^$~*&█◇▒■◆▓◇~!■~●╳▓▒▒@▪◆░▪■!
Transaction ID
Payer
Proposerseq:6311 key:294
Authorizers
2Transaction Summary
UpdatingTransaction
Script Arguments
Copy:
0artifactIdUInt64
72057594037927937
1printIdUInt64?
null
2faucetIdUInt64?
180143985094819842
3setIdUInt64?
null
4metadata{String: TenantService.MetadataField}
{}Cadence Script
1import NonFungibleToken from 0x1d7e57aa55817448
2 import TenantService from 0x965411a02ca21b87
3
4 transaction(
5 artifactId: UInt64,
6 printId: UInt64?,
7 faucetId: UInt64?,
8 setId: UInt64?,
9 metadata: {String: TenantService.MetadataField}
10 ) {
11 prepare(
12 payerAccount: AuthAccount
13 , toAccount: AuthAccount
14 ) {
15
16 let admin = payerAccount.borrow<&TenantService.TenantAdmin>(from: TenantService.ADMIN_OBJECT_PATH)
17 ?? panic("Could not borrow TenantService.TenantAdmin reference")
18
19 var toCollection =
20toAccount.getCapability(/public/TenantNFTCollection_OJ9aHpZ3TF_custom)
21 .borrow<&{TenantService.CollectionPublic}>()
22if toCollection == nil {
23 // create collection
24 let newCollection <- TenantService.createEmptyCollection() as! @TenantService.Collection
25 toAccount.save<@TenantService.Collection>(
26 <- newCollection,
27 to: /storage/TenantNFTCollection_OJ9aHpZ3TF
28 )
29 // link custom
30 toAccount.link<&{TenantService.CollectionPublic}>(
31 /public/TenantNFTCollection_OJ9aHpZ3TF_custom,
32 target: /storage/TenantNFTCollection_OJ9aHpZ3TF
33 )
34 // link standard
35 toAccount.link<&{NonFungibleToken.CollectionPublic}>(
36 /public/TenantNFTCollection_OJ9aHpZ3TF,
37 target: /storage/TenantNFTCollection_OJ9aHpZ3TF
38 )
39 // re-init
40 toCollection = toAccount.getCapability(/public/TenantNFTCollection_OJ9aHpZ3TF_custom)
41 .borrow<&{TenantService.CollectionPublic}>()
42 ?? panic("Could not borrow a reference to the receiver's TenantService.CollectionPublic")
43}
44
45
46 let nft <- admin.mintNFT(
47 artifactId: artifactId,
48 printId: printId,
49 faucetId: faucetId,
50 setId: setId,
51 metadata: metadata
52 )
53
54 toCollection!.deposit(token: <- nft)
55 }
56 }