@matrix-labs/matrix-storefront-sdk
Advanced tools
Comparing version 0.0.6 to 0.0.7
@@ -14,3 +14,3 @@ "use strict"; | ||
let NFTProvider: Capability<&0xsupportedNFTName.Collection{NonFungibleToken.Provider, NonFungibleToken.CollectionPublic}> | ||
let NFTProvider: Capability<&{NonFungibleToken.Provider, NonFungibleToken.CollectionPublic}> | ||
@@ -22,12 +22,7 @@ let tokenReceiver: Capability<&{FungibleToken.Receiver}> | ||
// borrow Storefront resource | ||
self.storefront = acct.borrow<&NFTStorefront.Storefront>(from: NFTStorefront.StorefrontPublicPath) ?? panic("can't borrow storefront") | ||
self.storefront = acct.borrow<&NFTStorefront.Storefront>(from: NFTStorefront.StorefrontStoragePath) ?? panic("can't borrow storefront") | ||
// to access 0xsupportedNFTName | ||
if acct.getCapability<&0xsupportedNFTName.Collection{NonFungibleToken.Provider, NonFungibleToken.CollectionPublic}>(0xsupportedNFTName.CollectionPublicPath).check() == false { | ||
acct.link<&0xsupportedNFTName.Collection{NonFungibleToken.Provider, NonFungibleToken.CollectionPublic}>(0xsupportedNFTName.CollectionPublicPath, target: 0xsupportedNFTName.CollectionStoragePath) | ||
} | ||
self.NFTProvider = acct.getCapability<&{NonFungibleToken.Provider, NonFungibleToken.CollectionPublic}>(MatrixMarketplaceNFT.CollectionPublicPath)! | ||
assert(self.NFTProvider.borrow() != nil, message: "Missing or mis-typed MatrixMarketplaceNFT.Collection provider") | ||
self.NFTProvider = acct.getCapability<&0xsupportedNFTName.Collection{NonFungibleToken.Provider, NonFungibleToken.CollectionPublic}>(0xsupportedNFTName.CollectionPublicPath)! | ||
assert(self.NFTProvider.borrow() != nil, message: "Missing or mis-typed 0xsupportedNFTName.Collection provider") | ||
// receiver flowtoken after NFT sold | ||
@@ -49,4 +44,4 @@ self.tokenReceiver = acct.getCapability<&{FungibleToken.Receiver}>(/public/flowTokenReceiver)! | ||
saleCuts.append(NFTStorefront.SaleCut( | ||
receiver: royaltyReceivers[size], | ||
amount: royaltyMount[size] | ||
receiver: getAccount(royaltyReceivers[size-1]).getCapability<&{FungibleToken.Receiver}>(/public/flowTokenReceiver)!, | ||
amount: royaltyMount[size-1] | ||
)) | ||
@@ -53,0 +48,0 @@ size = size - 1 |
{ | ||
"name": "@matrix-labs/matrix-storefront-sdk", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"main": "./dist/index.js", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -11,3 +11,3 @@ export const createListingScript: string = ` | ||
let NFTProvider: Capability<&0xsupportedNFTName.Collection{NonFungibleToken.Provider, NonFungibleToken.CollectionPublic}> | ||
let NFTProvider: Capability<&{NonFungibleToken.Provider, NonFungibleToken.CollectionPublic}> | ||
@@ -19,12 +19,7 @@ let tokenReceiver: Capability<&{FungibleToken.Receiver}> | ||
// borrow Storefront resource | ||
self.storefront = acct.borrow<&NFTStorefront.Storefront>(from: NFTStorefront.StorefrontPublicPath) ?? panic("can't borrow storefront") | ||
self.storefront = acct.borrow<&NFTStorefront.Storefront>(from: NFTStorefront.StorefrontStoragePath) ?? panic("can't borrow storefront") | ||
// to access 0xsupportedNFTName | ||
if acct.getCapability<&0xsupportedNFTName.Collection{NonFungibleToken.Provider, NonFungibleToken.CollectionPublic}>(0xsupportedNFTName.CollectionPublicPath).check() == false { | ||
acct.link<&0xsupportedNFTName.Collection{NonFungibleToken.Provider, NonFungibleToken.CollectionPublic}>(0xsupportedNFTName.CollectionPublicPath, target: 0xsupportedNFTName.CollectionStoragePath) | ||
} | ||
self.NFTProvider = acct.getCapability<&{NonFungibleToken.Provider, NonFungibleToken.CollectionPublic}>(MatrixMarketplaceNFT.CollectionPublicPath)! | ||
assert(self.NFTProvider.borrow() != nil, message: "Missing or mis-typed MatrixMarketplaceNFT.Collection provider") | ||
self.NFTProvider = acct.getCapability<&0xsupportedNFTName.Collection{NonFungibleToken.Provider, NonFungibleToken.CollectionPublic}>(0xsupportedNFTName.CollectionPublicPath)! | ||
assert(self.NFTProvider.borrow() != nil, message: "Missing or mis-typed 0xsupportedNFTName.Collection provider") | ||
// receiver flowtoken after NFT sold | ||
@@ -46,4 +41,4 @@ self.tokenReceiver = acct.getCapability<&{FungibleToken.Receiver}>(/public/flowTokenReceiver)! | ||
saleCuts.append(NFTStorefront.SaleCut( | ||
receiver: royaltyReceivers[size], | ||
amount: royaltyMount[size] | ||
receiver: getAccount(royaltyReceivers[size-1]).getCapability<&{FungibleToken.Receiver}>(/public/flowTokenReceiver)!, | ||
amount: royaltyMount[size-1] | ||
)) | ||
@@ -63,2 +58,2 @@ size = size - 1 | ||
} | ||
}` | ||
}`; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
74981
926