@flowtyio/flow-contracts 0.1.0-beta.14 → 0.1.0-beta.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -78,7 +78,7 @@ access(all) contract ScopedNFTProviders {
|
|
|
78
78
|
//
|
|
79
79
|
// Wrapper around an NFT Provider that is restricted to specific ids.
|
|
80
80
|
access(all) resource ScopedNFTProvider: NonFungibleToken.Provider {
|
|
81
|
-
access(self) let provider: Capability<auth(NonFungibleToken.Withdraw) &{NonFungibleToken.
|
|
81
|
+
access(self) let provider: Capability<auth(NonFungibleToken.Withdraw, NonFungibleToken.Owner) &{NonFungibleToken.Provider, NonFungibleToken.CollectionPublic}>
|
|
82
82
|
access(self) let filters: [{NFTFilter}]
|
|
83
83
|
|
|
84
84
|
// block timestamp that this provider can no longer be used after
|
|
@@ -91,7 +91,7 @@ access(all) contract ScopedNFTProviders {
|
|
|
91
91
|
return false
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
-
access(all) init(provider: Capability<auth(NonFungibleToken.Withdraw) &{NonFungibleToken.
|
|
94
|
+
access(all) init(provider: Capability<auth(NonFungibleToken.Withdraw, NonFungibleToken.Owner) &{NonFungibleToken.Provider, NonFungibleToken.CollectionPublic}>, filters: [{NFTFilter}], expiration: UFix64?) {
|
|
95
95
|
self.provider = provider
|
|
96
96
|
self.expiration = expiration
|
|
97
97
|
self.filters = filters
|
|
@@ -102,7 +102,11 @@ access(all) contract ScopedNFTProviders {
|
|
|
102
102
|
return false
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
-
|
|
105
|
+
if !self.provider.check() {
|
|
106
|
+
return false
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
let nft: &{NonFungibleToken.NFT}? = self.provider.borrow()!.borrowNFT(id)
|
|
106
110
|
if nft == nil {
|
|
107
111
|
return false
|
|
108
112
|
}
|
|
@@ -153,11 +157,10 @@ access(all) contract ScopedNFTProviders {
|
|
|
153
157
|
}
|
|
154
158
|
|
|
155
159
|
access(all) fun createScopedNFTProvider(
|
|
156
|
-
provider: Capability<auth(NonFungibleToken.Withdraw) &{NonFungibleToken.
|
|
160
|
+
provider: Capability<auth(NonFungibleToken.Withdraw, NonFungibleToken.Owner) &{NonFungibleToken.Provider, NonFungibleToken.CollectionPublic}>,
|
|
157
161
|
filters: [{NFTFilter}],
|
|
158
162
|
expiration: UFix64?
|
|
159
163
|
): @ScopedNFTProvider {
|
|
160
164
|
return <- create ScopedNFTProvider(provider: provider, filters: filters, expiration: expiration)
|
|
161
165
|
}
|
|
162
|
-
}
|
|
163
|
-
|
|
166
|
+
}
|
package/flow.json
CHANGED
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
"source": "./contracts/Burner.cdc",
|
|
34
34
|
"aliases": {
|
|
35
35
|
"emulator": "0xf8d6e0586b0a20c7",
|
|
36
|
-
"testnet": "
|
|
37
|
-
"mainnet": "
|
|
36
|
+
"testnet": "0x9a0766d93b6608b7",
|
|
37
|
+
"mainnet": "0xf233dcee88fe0abe"
|
|
38
38
|
}
|
|
39
39
|
},
|
|
40
40
|
"MetadataViews": {
|