From 6bffaa14a75f7b5743e51121dadce99ea705f4b5 Mon Sep 17 00:00:00 2001 From: Phill <20524533+ph0ph0@users.noreply.github.com> Date: Tue, 3 Oct 2023 09:57:11 +0100 Subject: [PATCH] Add TheFabricant transactions --- transactions/TheFabricant/delist_item.cdc | 20 ++ transactions/TheFabricant/delist_item.json | 8 + .../TheFabricant/initialize_account.cdc | 223 ++++++++++++++++++ .../TheFabricant/initialize_account.json | 5 + .../list_highsnobietynotinparisItem.cdc | 72 ++++++ .../list_highsnobietynotinparisItem.json | 9 + transactions/TheFabricant/list_kapersItem.cdc | 72 ++++++ .../TheFabricant/list_kapersItem.json | 9 + .../TheFabricant/list_primalraveItem.cdc | 72 ++++++ .../TheFabricant/list_primalraveItem.json | 9 + transactions/TheFabricant/list_s2item.cdc | 72 ++++++ transactions/TheFabricant/list_s2item.json | 9 + .../TheFabricant/list_weekdayItem.cdc | 72 ++++++ .../TheFabricant/list_weekdayItem.json | 9 + .../TheFabricant/list_xxoriesItem.cdc | 72 ++++++ .../TheFabricant/list_xxoriesItem.json | 9 + .../mint_cocreation_using_access_list.cdc | 74 ++++++ .../mint_cocreation_using_access_list.json | 13 + .../mint_variant_using_access_list.cdc | 59 +++++ .../mint_variant_using_access_list.json | 10 + .../purchase_highsnobietynotinparisItem.cdc | 51 ++++ .../purchase_highsnobietynotinparisItem.json | 10 + .../TheFabricant/purchase_kapersItem.cdc | 49 ++++ .../TheFabricant/purchase_kapersItem.json | 10 + .../TheFabricant/purchase_primalraveItem.cdc | 51 ++++ .../TheFabricant/purchase_primalraveItem.json | 10 + transactions/TheFabricant/purchase_s2Item.cdc | 41 ++++ .../TheFabricant/purchase_s2Item.json | 10 + .../TheFabricant/purchase_weekdayItem.cdc | 51 ++++ .../TheFabricant/purchase_weekdayItem.json | 10 + .../TheFabricant/purchase_xxoriesItem.cdc | 51 ++++ .../TheFabricant/purchase_xxoriesItem.json | 10 + .../transfer_highsnobietynotinparisItem.cdc | 27 +++ .../transfer_highsnobietynotinparisItem.json | 9 + .../TheFabricant/transfer_kapersItem.cdc | 27 +++ .../TheFabricant/transfer_kapersItem.json | 9 + .../TheFabricant/transfer_primalraveItem.cdc | 27 +++ .../TheFabricant/transfer_primalraveItem.json | 9 + .../TheFabricant/transfer_weekdayItem.cdc | 27 +++ .../TheFabricant/transfer_weekdayItem.json | 9 + .../TheFabricant/transfer_xxoriesItem.cdc | 27 +++ .../TheFabricant/transfer_xxoriesItem.json | 9 + 42 files changed, 1432 insertions(+) create mode 100644 transactions/TheFabricant/delist_item.cdc create mode 100644 transactions/TheFabricant/delist_item.json create mode 100644 transactions/TheFabricant/initialize_account.cdc create mode 100644 transactions/TheFabricant/initialize_account.json create mode 100644 transactions/TheFabricant/list_highsnobietynotinparisItem.cdc create mode 100644 transactions/TheFabricant/list_highsnobietynotinparisItem.json create mode 100644 transactions/TheFabricant/list_kapersItem.cdc create mode 100644 transactions/TheFabricant/list_kapersItem.json create mode 100644 transactions/TheFabricant/list_primalraveItem.cdc create mode 100644 transactions/TheFabricant/list_primalraveItem.json create mode 100644 transactions/TheFabricant/list_s2item.cdc create mode 100644 transactions/TheFabricant/list_s2item.json create mode 100644 transactions/TheFabricant/list_weekdayItem.cdc create mode 100644 transactions/TheFabricant/list_weekdayItem.json create mode 100644 transactions/TheFabricant/list_xxoriesItem.cdc create mode 100644 transactions/TheFabricant/list_xxoriesItem.json create mode 100644 transactions/TheFabricant/mint_cocreation_using_access_list.cdc create mode 100644 transactions/TheFabricant/mint_cocreation_using_access_list.json create mode 100644 transactions/TheFabricant/mint_variant_using_access_list.cdc create mode 100644 transactions/TheFabricant/mint_variant_using_access_list.json create mode 100644 transactions/TheFabricant/purchase_highsnobietynotinparisItem.cdc create mode 100644 transactions/TheFabricant/purchase_highsnobietynotinparisItem.json create mode 100644 transactions/TheFabricant/purchase_kapersItem.cdc create mode 100644 transactions/TheFabricant/purchase_kapersItem.json create mode 100644 transactions/TheFabricant/purchase_primalraveItem.cdc create mode 100644 transactions/TheFabricant/purchase_primalraveItem.json create mode 100644 transactions/TheFabricant/purchase_s2Item.cdc create mode 100644 transactions/TheFabricant/purchase_s2Item.json create mode 100644 transactions/TheFabricant/purchase_weekdayItem.cdc create mode 100644 transactions/TheFabricant/purchase_weekdayItem.json create mode 100644 transactions/TheFabricant/purchase_xxoriesItem.cdc create mode 100644 transactions/TheFabricant/purchase_xxoriesItem.json create mode 100644 transactions/TheFabricant/transfer_highsnobietynotinparisItem.cdc create mode 100644 transactions/TheFabricant/transfer_highsnobietynotinparisItem.json create mode 100644 transactions/TheFabricant/transfer_kapersItem.cdc create mode 100644 transactions/TheFabricant/transfer_kapersItem.json create mode 100644 transactions/TheFabricant/transfer_primalraveItem.cdc create mode 100644 transactions/TheFabricant/transfer_primalraveItem.json create mode 100644 transactions/TheFabricant/transfer_weekdayItem.cdc create mode 100644 transactions/TheFabricant/transfer_weekdayItem.json create mode 100644 transactions/TheFabricant/transfer_xxoriesItem.cdc create mode 100644 transactions/TheFabricant/transfer_xxoriesItem.json diff --git a/transactions/TheFabricant/delist_item.cdc b/transactions/TheFabricant/delist_item.cdc new file mode 100644 index 0000000..f82810d --- /dev/null +++ b/transactions/TheFabricant/delist_item.cdc @@ -0,0 +1,20 @@ +import TheFabricantMarketplace from 0xTheFabricantMarketplace + +transaction(listingID: String) { + + let listingRef: &TheFabricantMarketplace.Listings + + prepare(acct: AuthAccount) { + + // borrow a reference to the owner's listing collection + self.listingRef = acct.borrow<&TheFabricantMarketplace.Listings>(from: TheFabricantMarketplace.ListingsStoragePath) + ?? panic("Could not borrow from listings in storage") + } + + execute { + + // de-listing item + self.listingRef.removeListing(listingID: listingID) + + } +} \ No newline at end of file diff --git a/transactions/TheFabricant/delist_item.json b/transactions/TheFabricant/delist_item.json new file mode 100644 index 0000000..c0dbf54 --- /dev/null +++ b/transactions/TheFabricant/delist_item.json @@ -0,0 +1,8 @@ +{ + "arguments": [ + "listingID" + ], + "messages": { + "en": "Remove NFT from sale." + } +} \ No newline at end of file diff --git a/transactions/TheFabricant/initialize_account.cdc b/transactions/TheFabricant/initialize_account.cdc new file mode 100644 index 0000000..49b591a --- /dev/null +++ b/transactions/TheFabricant/initialize_account.cdc @@ -0,0 +1,223 @@ +import FBRC from 0xFBRC +import FlowToken from 0xFlowToken +import FungibleToken from 0xFungibleToken +import GarmentNFT from 0xGarmentNFT +import MaterialNFT from 0xMaterialNFT +import ItemNFT from 0xItemNFT +import TheFabricantS1GarmentNFT from 0xTheFabricantS1GarmentNFT +import TheFabricantS1MaterialNFT from 0xTheFabricantS1MaterialNFT +import TheFabricantS1ItemNFT from 0xTheFabricantS1ItemNFT +import TheFabricantS2GarmentNFT from 0xTheFabricantS2GarmentNFT +import TheFabricantS2MaterialNFT from 0xTheFabricantS2MaterialNFT +import TheFabricantS2ItemNFT from 0xTheFabricantS2ItemNFT +import TheFabricantMysteryBox_FF1 from 0xTheFabricantMysteryBox_FF1 +import DieselNFT from 0xDieselNFT +import MiamiNFT from 0xMiamiNFT +import NonFungibleToken from 0xNonFungibleToken +import TheFabricantAccessPass from 0xTheFabricantAccessPass +import TheFabricantXXories from 0xTheFabricantXXories +import MetadataViews from 0xMetadataViews +import TheFabricantKapers from 0xTheFabricantKapers +import Weekday from 0xWeekday +import HighsnobietyNotInParis from 0xHighsnobietyNotInParis +import TheFabricantPrimalRave from 0xTheFabricantPrimalRave + +// initializes NFT and FT collections if not already done so +transaction() { + + prepare(acct: AuthAccount) { + + // initialize FBRC + if !( acct.getCapability<&FBRC.Vault{FungibleToken.Receiver}>(FBRC.CollectionReceiverPath).check() + && acct.getCapability<&FBRC.Vault{FungibleToken.Balance}>(FBRC.CollectionBalancePath).check()) { + if acct.type(at: FBRC.CollectionStoragePath) == nil { + acct.save(<-FBRC.createEmptyVault(), to: FBRC.CollectionStoragePath) + } + acct.unlink(FBRC.CollectionReceiverPath) + acct.unlink(FBRC.CollectionBalancePath) + acct.link<&FBRC.Vault{FungibleToken.Receiver}>(FBRC.CollectionReceiverPath, target: FBRC.CollectionStoragePath) + acct.link<&FBRC.Vault{FungibleToken.Balance}>(FBRC.CollectionBalancePath, target: FBRC.CollectionStoragePath) + } + + // initialize GarmentNFT + if !acct.getCapability<&GarmentNFT.Collection{NonFungibleToken.CollectionPublic, NonFungibleToken.Receiver, GarmentNFT.GarmentCollectionPublic}>(GarmentNFT.CollectionPublicPath).check() { + if acct.type(at: GarmentNFT.CollectionStoragePath) == nil { + let collection <- GarmentNFT.createEmptyCollection() as! @GarmentNFT.Collection + acct.save(<-collection, to: GarmentNFT.CollectionStoragePath) + } + acct.unlink(GarmentNFT.CollectionPublicPath) + acct.link<&GarmentNFT.Collection{NonFungibleToken.CollectionPublic, NonFungibleToken.Receiver, GarmentNFT.GarmentCollectionPublic}>(GarmentNFT.CollectionPublicPath, target: GarmentNFT.CollectionStoragePath) + } + + // initialize MaterialNFT + if !acct.getCapability<&MaterialNFT.Collection{NonFungibleToken.CollectionPublic, NonFungibleToken.Receiver, MaterialNFT.MaterialCollectionPublic}>(MaterialNFT.CollectionPublicPath).check() { + if acct.type(at: MaterialNFT.CollectionStoragePath) == nil { + let collection <- MaterialNFT.createEmptyCollection() as! @MaterialNFT.Collection + acct.save(<-collection, to: MaterialNFT.CollectionStoragePath) + } + acct.unlink(MaterialNFT.CollectionPublicPath) + acct.link<&MaterialNFT.Collection{NonFungibleToken.CollectionPublic, NonFungibleToken.Receiver, MaterialNFT.MaterialCollectionPublic}>(MaterialNFT.CollectionPublicPath, target: MaterialNFT.CollectionStoragePath) + } + + // initialize ItemNFT + if !acct.getCapability<&ItemNFT.Collection{NonFungibleToken.CollectionPublic, NonFungibleToken.Receiver, ItemNFT.ItemCollectionPublic}>(ItemNFT.CollectionPublicPath).check() { + if acct.type(at: ItemNFT.CollectionStoragePath) == nil { + let collection <- ItemNFT.createEmptyCollection() as! @ItemNFT.Collection + acct.save(<-collection, to: ItemNFT.CollectionStoragePath) + } + acct.unlink(ItemNFT.CollectionPublicPath) + acct.link<&ItemNFT.Collection{NonFungibleToken.CollectionPublic, NonFungibleToken.Receiver, ItemNFT.ItemCollectionPublic}>(ItemNFT.CollectionPublicPath, target: ItemNFT.CollectionStoragePath) + } + + // initialize S1GarmentNFT + if !acct.getCapability<&TheFabricantS1GarmentNFT.Collection{NonFungibleToken.CollectionPublic, NonFungibleToken.Receiver, TheFabricantS1GarmentNFT.GarmentCollectionPublic}>(TheFabricantS1GarmentNFT.CollectionPublicPath).check() { + if acct.type(at: TheFabricantS1GarmentNFT.CollectionStoragePath) == nil { + let collection <- TheFabricantS1GarmentNFT.createEmptyCollection() as! @TheFabricantS1GarmentNFT.Collection + acct.save(<-collection, to: TheFabricantS1GarmentNFT.CollectionStoragePath) + } + acct.unlink(TheFabricantS1GarmentNFT.CollectionPublicPath) + acct.link<&TheFabricantS1GarmentNFT.Collection{NonFungibleToken.CollectionPublic, NonFungibleToken.Receiver, TheFabricantS1GarmentNFT.GarmentCollectionPublic}>(TheFabricantS1GarmentNFT.CollectionPublicPath, target: TheFabricantS1GarmentNFT.CollectionStoragePath) + } + + // initialize S1MaterialNFT + if !acct.getCapability<&TheFabricantS1MaterialNFT.Collection{NonFungibleToken.CollectionPublic, NonFungibleToken.Receiver, TheFabricantS1MaterialNFT.MaterialCollectionPublic}>(TheFabricantS1MaterialNFT.CollectionPublicPath).check() { + if acct.type(at: TheFabricantS1MaterialNFT.CollectionStoragePath) == nil { + let collection <- TheFabricantS1MaterialNFT.createEmptyCollection() as! @TheFabricantS1MaterialNFT.Collection + acct.save(<-collection, to: TheFabricantS1MaterialNFT.CollectionStoragePath) + } + acct.unlink(TheFabricantS1MaterialNFT.CollectionPublicPath) + acct.link<&TheFabricantS1MaterialNFT.Collection{NonFungibleToken.CollectionPublic, NonFungibleToken.Receiver, TheFabricantS1MaterialNFT.MaterialCollectionPublic}>(TheFabricantS1MaterialNFT.CollectionPublicPath, target: TheFabricantS1MaterialNFT.CollectionStoragePath) + } + + // initialize S1ItemNFT + if !acct.getCapability<&TheFabricantS1ItemNFT.Collection{NonFungibleToken.CollectionPublic, NonFungibleToken.Receiver, TheFabricantS1ItemNFT.ItemCollectionPublic}>(TheFabricantS1ItemNFT.CollectionPublicPath).check() { + if acct.type(at: TheFabricantS1ItemNFT.CollectionStoragePath) == nil { + let collection <- TheFabricantS1ItemNFT.createEmptyCollection() as! @TheFabricantS1ItemNFT.Collection + acct.save(<-collection, to: TheFabricantS1ItemNFT.CollectionStoragePath) + } + acct.unlink(TheFabricantS1ItemNFT.CollectionPublicPath) + acct.link<&TheFabricantS1ItemNFT.Collection{NonFungibleToken.CollectionPublic, NonFungibleToken.Receiver, TheFabricantS1ItemNFT.ItemCollectionPublic}>(TheFabricantS1ItemNFT.CollectionPublicPath, target: TheFabricantS1ItemNFT.CollectionStoragePath) + } + + // initialize S2GarmentNFT + if !acct.getCapability<&TheFabricantS2GarmentNFT.Collection{NonFungibleToken.CollectionPublic, NonFungibleToken.Receiver, TheFabricantS2GarmentNFT.GarmentCollectionPublic}>(TheFabricantS2GarmentNFT.CollectionPublicPath).check() { + if acct.type(at: TheFabricantS2GarmentNFT.CollectionStoragePath) == nil { + let collection <- TheFabricantS2GarmentNFT.createEmptyCollection() as! @TheFabricantS2GarmentNFT.Collection + acct.save(<-collection, to: TheFabricantS2GarmentNFT.CollectionStoragePath) + } + acct.unlink(TheFabricantS2GarmentNFT.CollectionPublicPath) + acct.link<&TheFabricantS2GarmentNFT.Collection{NonFungibleToken.CollectionPublic, NonFungibleToken.Receiver, TheFabricantS2GarmentNFT.GarmentCollectionPublic}>(TheFabricantS2GarmentNFT.CollectionPublicPath, target: TheFabricantS2GarmentNFT.CollectionStoragePath) + } + + // initialize S2MaterialNFT + if !acct.getCapability<&TheFabricantS2MaterialNFT.Collection{NonFungibleToken.CollectionPublic, NonFungibleToken.Receiver, TheFabricantS2MaterialNFT.MaterialCollectionPublic}>(TheFabricantS2MaterialNFT.CollectionPublicPath).check() { + if acct.type(at: TheFabricantS2MaterialNFT.CollectionStoragePath) == nil { + let collection <- TheFabricantS2MaterialNFT.createEmptyCollection() as! @TheFabricantS2MaterialNFT.Collection + acct.save(<-collection, to: TheFabricantS2MaterialNFT.CollectionStoragePath) + } + acct.unlink(TheFabricantS2MaterialNFT.CollectionPublicPath) + acct.link<&TheFabricantS2MaterialNFT.Collection{NonFungibleToken.CollectionPublic, NonFungibleToken.Receiver, TheFabricantS2MaterialNFT.MaterialCollectionPublic}>(TheFabricantS2MaterialNFT.CollectionPublicPath, target: TheFabricantS2MaterialNFT.CollectionStoragePath) + } + + // initialize S2ItemNFT + if !acct.getCapability<&{NonFungibleToken.CollectionPublic, NonFungibleToken.Receiver, TheFabricantS2ItemNFT.ItemCollectionPublic}>(TheFabricantS2ItemNFT.CollectionPublicPath).check() { + if acct.type(at: TheFabricantS2ItemNFT.CollectionStoragePath) == nil { + let collection <- TheFabricantS2ItemNFT.createEmptyCollection() as! @TheFabricantS2ItemNFT.Collection + acct.save(<-collection, to: TheFabricantS2ItemNFT.CollectionStoragePath) + } + acct.unlink(TheFabricantS2ItemNFT.CollectionPublicPath) + acct.link<&TheFabricantS2ItemNFT.Collection{NonFungibleToken.CollectionPublic, NonFungibleToken.Receiver, TheFabricantS2ItemNFT.ItemCollectionPublic}>(TheFabricantS2ItemNFT.CollectionPublicPath, target: TheFabricantS2ItemNFT.CollectionStoragePath) + } + + // initialize TheFabricantMysteryBox_FF1 + if !acct.getCapability<&TheFabricantMysteryBox_FF1.Collection{NonFungibleToken.CollectionPublic, NonFungibleToken.Receiver, TheFabricantMysteryBox_FF1.FabricantCollectionPublic}>(TheFabricantMysteryBox_FF1.CollectionPublicPath).check(){ + if acct.type(at: TheFabricantMysteryBox_FF1.CollectionStoragePath) == nil { + let collection <- TheFabricantMysteryBox_FF1.createEmptyCollection() as! @TheFabricantMysteryBox_FF1.Collection + acct.save(<-collection, to: TheFabricantMysteryBox_FF1.CollectionStoragePath) + } + acct.unlink(TheFabricantMysteryBox_FF1.CollectionPublicPath) + acct.link<&TheFabricantMysteryBox_FF1.Collection{NonFungibleToken.CollectionPublic, NonFungibleToken.Receiver, TheFabricantMysteryBox_FF1.FabricantCollectionPublic}>(TheFabricantMysteryBox_FF1.CollectionPublicPath, target: TheFabricantMysteryBox_FF1.CollectionStoragePath) + } + + // initialize DieselNFT + if !acct.getCapability<&DieselNFT.Collection{NonFungibleToken.CollectionPublic, NonFungibleToken.Receiver, DieselNFT.DieselCollectionPublic}>(DieselNFT.CollectionPublicPath) .check() { + if acct.type(at: DieselNFT.CollectionStoragePath) == nil { + let collection <- DieselNFT.createEmptyCollection() as! @DieselNFT.Collection + acct.save(<-collection, to: DieselNFT.CollectionStoragePath) + } + acct.unlink(DieselNFT.CollectionPublicPath) + acct.link<&DieselNFT.Collection{NonFungibleToken.CollectionPublic, NonFungibleToken.Receiver, DieselNFT.DieselCollectionPublic}>(DieselNFT.CollectionPublicPath, target: DieselNFT.CollectionStoragePath) + } + + // initialize MiamiNFT + if !acct.getCapability<&MiamiNFT.Collection{NonFungibleToken.CollectionPublic, NonFungibleToken.Receiver, MiamiNFT.MiamiCollectionPublic}>(MiamiNFT.CollectionPublicPath).check(){ + if acct.type(at: MiamiNFT.CollectionStoragePath) == nil { + let collection <- MiamiNFT.createEmptyCollection() as! @MiamiNFT.Collection + acct.save(<-collection, to: MiamiNFT.CollectionStoragePath) + } + acct.unlink(MiamiNFT.CollectionPublicPath) + acct.link<&MiamiNFT.Collection{NonFungibleToken.CollectionPublic, NonFungibleToken.Receiver, MiamiNFT.MiamiCollectionPublic}>(MiamiNFT.CollectionPublicPath, target: MiamiNFT.CollectionStoragePath) + } + + // initialize AccessPass + if !(acct.getCapability<&TheFabricantAccessPass.Collection{NonFungibleToken.CollectionPublic, NonFungibleToken.Receiver, TheFabricantAccessPass.TheFabricantAccessPassCollectionPublic}>(TheFabricantAccessPass.TheFabricantAccessPassCollectionPublicPath).check()) { + if acct.type(at: TheFabricantAccessPass.TheFabricantAccessPassCollectionStoragePath) == nil { + let collection <- TheFabricantAccessPass.createEmptyCollection() as! @TheFabricantAccessPass.Collection + acct.save(<- collection, to: TheFabricantAccessPass.TheFabricantAccessPassCollectionStoragePath) + } + acct.unlink(TheFabricantAccessPass.TheFabricantAccessPassCollectionPublicPath) + acct.link<&TheFabricantAccessPass.Collection{NonFungibleToken.CollectionPublic, NonFungibleToken.Receiver, TheFabricantAccessPass.TheFabricantAccessPassCollectionPublic}>(TheFabricantAccessPass.TheFabricantAccessPassCollectionPublicPath, target: TheFabricantAccessPass.TheFabricantAccessPassCollectionStoragePath) + } + + // initialize XXory + if !(acct.getCapability<&TheFabricantXXories.Collection{NonFungibleToken.CollectionPublic, NonFungibleToken.Receiver, TheFabricantXXories.TheFabricantXXoriesCollectionPublic, MetadataViews.ResolverCollection}>(TheFabricantXXories.TheFabricantXXoriesCollectionPublicPath).check()) { + if acct.type(at: TheFabricantXXories.TheFabricantXXoriesCollectionStoragePath) == nil { + let collection <- TheFabricantXXories.createEmptyCollection() as! @TheFabricantXXories.Collection + acct.save(<- collection, to: TheFabricantXXories.TheFabricantXXoriesCollectionStoragePath) + } + acct.unlink(TheFabricantXXories.TheFabricantXXoriesCollectionPublicPath) + acct.link<&TheFabricantXXories.Collection{NonFungibleToken.CollectionPublic, NonFungibleToken.Receiver, TheFabricantXXories.TheFabricantXXoriesCollectionPublic, MetadataViews.ResolverCollection}>(TheFabricantXXories.TheFabricantXXoriesCollectionPublicPath, target: TheFabricantXXories.TheFabricantXXoriesCollectionStoragePath) + } + + // initialize Kapers + if !(acct.getCapability<&TheFabricantKapers.Collection{NonFungibleToken.CollectionPublic, NonFungibleToken.Receiver, TheFabricantKapers.TheFabricantKapersCollectionPublic, MetadataViews.ResolverCollection}>(TheFabricantKapers.TheFabricantKapersCollectionPublicPath).check()) { + if acct.type(at: TheFabricantKapers.TheFabricantKapersCollectionStoragePath) == nil { + let collection <- TheFabricantKapers.createEmptyCollection() as! @TheFabricantKapers.Collection + acct.save(<- collection, to: TheFabricantKapers.TheFabricantKapersCollectionStoragePath) + } + acct.unlink(TheFabricantKapers.TheFabricantKapersCollectionPublicPath) + acct.link<&TheFabricantKapers.Collection{NonFungibleToken.CollectionPublic, NonFungibleToken.Receiver, TheFabricantKapers.TheFabricantKapersCollectionPublic, MetadataViews.ResolverCollection}>(TheFabricantKapers.TheFabricantKapersCollectionPublicPath, target: TheFabricantKapers.TheFabricantKapersCollectionStoragePath) + } + + // initialize Weekday + if !(acct.getCapability<&Weekday.Collection{NonFungibleToken.CollectionPublic, NonFungibleToken.Receiver, Weekday.WeekdayCollectionPublic, MetadataViews.ResolverCollection}>(Weekday.WeekdayCollectionPublicPath).check()) { + if acct.type(at: Weekday.WeekdayCollectionStoragePath) == nil { + let collection <- Weekday.createEmptyCollection() as! @Weekday.Collection + acct.save(<- collection, to: Weekday.WeekdayCollectionStoragePath) + } + acct.unlink(Weekday.WeekdayCollectionPublicPath) + acct.link<&Weekday.Collection{NonFungibleToken.CollectionPublic, NonFungibleToken.Receiver, Weekday.WeekdayCollectionPublic, MetadataViews.ResolverCollection}>(Weekday.WeekdayCollectionPublicPath, target: Weekday.WeekdayCollectionStoragePath) + } + + // initialize HighsnobietyNotInParis + if !(acct.getCapability<&HighsnobietyNotInParis.Collection{NonFungibleToken.CollectionPublic, NonFungibleToken.Receiver, HighsnobietyNotInParis.HighsnobietyNotInParisCollectionPublic, MetadataViews.ResolverCollection}>(HighsnobietyNotInParis.HighsnobietyNotInParisCollectionPublicPath).check()) { + if acct.type(at: HighsnobietyNotInParis.HighsnobietyNotInParisCollectionStoragePath) == nil { + let collection <- HighsnobietyNotInParis.createEmptyCollection() as! @HighsnobietyNotInParis.Collection + acct.save(<- collection, to: HighsnobietyNotInParis.HighsnobietyNotInParisCollectionStoragePath) + } + acct.unlink(HighsnobietyNotInParis.HighsnobietyNotInParisCollectionPublicPath) + acct.link<&HighsnobietyNotInParis.Collection{NonFungibleToken.CollectionPublic, NonFungibleToken.Receiver, HighsnobietyNotInParis.HighsnobietyNotInParisCollectionPublic, MetadataViews.ResolverCollection}>(HighsnobietyNotInParis.HighsnobietyNotInParisCollectionPublicPath, target: HighsnobietyNotInParis.HighsnobietyNotInParisCollectionStoragePath) + } + + // initialize TheFabricantPrimalRave + if !(acct.getCapability<&TheFabricantPrimalRave.Collection{NonFungibleToken.CollectionPublic, NonFungibleToken.Receiver, TheFabricantPrimalRave.TheFabricantPrimalRaveCollectionPublic, MetadataViews.ResolverCollection}>(TheFabricantPrimalRave.TheFabricantPrimalRaveCollectionPublicPath).check()) { + if acct.type(at: TheFabricantPrimalRave.TheFabricantPrimalRaveCollectionStoragePath) == nil { + let collection <- TheFabricantPrimalRave.createEmptyCollection() as! @TheFabricantPrimalRave.Collection + acct.save(<- collection, to: TheFabricantPrimalRave.TheFabricantPrimalRaveCollectionStoragePath) + } + acct.unlink(TheFabricantPrimalRave.TheFabricantPrimalRaveCollectionPublicPath) + acct.link<&TheFabricantPrimalRave.Collection{NonFungibleToken.CollectionPublic, NonFungibleToken.Receiver, TheFabricantPrimalRave.TheFabricantPrimalRaveCollectionPublic, MetadataViews.ResolverCollection}>(TheFabricantPrimalRave.TheFabricantPrimalRaveCollectionPublicPath, target: TheFabricantPrimalRave.TheFabricantPrimalRaveCollectionStoragePath) + } + } + +} \ No newline at end of file diff --git a/transactions/TheFabricant/initialize_account.json b/transactions/TheFabricant/initialize_account.json new file mode 100644 index 0000000..addd28b --- /dev/null +++ b/transactions/TheFabricant/initialize_account.json @@ -0,0 +1,5 @@ +{ + "messages": { + "en": "Initilize your account to store The Fabricant NFTs." + } +} \ No newline at end of file diff --git a/transactions/TheFabricant/list_highsnobietynotinparisItem.cdc b/transactions/TheFabricant/list_highsnobietynotinparisItem.cdc new file mode 100644 index 0000000..3e72805 --- /dev/null +++ b/transactions/TheFabricant/list_highsnobietynotinparisItem.cdc @@ -0,0 +1,72 @@ +import FungibleToken from 0xFungibleToken + import NonFungibleToken from 0xNonFungibleToken + import FlowToken from 0xFlowToken + import TheFabricantMarketplace from 0xTheFabricantMarketplace + import TheFabricantMarketplaceHelper from 0xTheFabricantMarketplaceHelper + import HighsnobietyNotInParis from 0xHighsnobietyNotInParis + + transaction(itemID: UInt64, price: UFix64) { + let itemCollectionRef: &HighsnobietyNotInParis.Collection + let listingRef: &TheFabricantMarketplace.Listings + let flowReceiver: Capability<&FlowToken.Vault{FungibleToken.Receiver}> + let itemNFTProvider: Capability<&HighsnobietyNotInParis.Collection{NonFungibleToken.Provider, NonFungibleToken.CollectionPublic}> + + prepare(acct: AuthAccount) { + + // borrow a reference to self's item collection + self.itemCollectionRef = acct.borrow<&HighsnobietyNotInParis.Collection>(from: HighsnobietyNotInParis.${collectionStoragePathPrefix}CollectionStoragePath) + ?? panic("Could not borrow item in storage") + + // get listings Capability + let listingCap = acct.getCapability<&{TheFabricantMarketplace.ListingsPublic}>(TheFabricantMarketplace.ListingsPublicPath) + + // get flow token Capability + self.flowReceiver = acct.getCapability<&FlowToken.Vault{FungibleToken.Receiver}>(/public/flowTokenReceiver) + assert(self.flowReceiver.check(), message: "Missing or mis-typed FlowToken receiver") + + // initialize private path to withdraw your nft once it is purchased + let NFTCollectionProviderPrivatePath = ${providerPrivatePath} + if !acct.getCapability<&HighsnobietyNotInParis.Collection{NonFungibleToken.CollectionPublic, NonFungibleToken.Provider}>(NFTCollectionProviderPrivatePath).check() { + acct.unlink(NFTCollectionProviderPrivatePath) + acct.link<&HighsnobietyNotInParis.Collection{HighsnobietyNotInParis.${publicCollPrefix}CollectionPublic, NonFungibleToken.CollectionPublic, NonFungibleToken.Provider}>(NFTCollectionProviderPrivatePath, target: HighsnobietyNotInParis.${collectionStoragePathPrefix}CollectionStoragePath) + } + + // get nft provider capability + self.itemNFTProvider = acct.getCapability<&HighsnobietyNotInParis.Collection{NonFungibleToken.CollectionPublic, NonFungibleToken.Provider}>(NFTCollectionProviderPrivatePath) + assert(self.itemNFTProvider.check(), message: "Missing or mis-typed HighsnobietyNotInParis.Collection provider") + + if !listingCap.check() { + + // get own flow token capability + let wallet = acct.getCapability<&FlowToken.Vault{FungibleToken.Receiver}>(/public/flowTokenReceiver) + + // create listings + let listings <- TheFabricantMarketplace.createListings() + + // store an empty listings + acct.save<@TheFabricantMarketplace.Listings>(<- listings, to: TheFabricantMarketplace.ListingsStoragePath) + + // publish a public capability to the Listings in storage + acct.link<&{TheFabricantMarketplace.ListingsPublic}>(TheFabricantMarketplace.ListingsPublicPath, target: TheFabricantMarketplace.ListingsStoragePath) + } + + self.listingRef=acct.borrow<&TheFabricantMarketplace.Listings>(from: TheFabricantMarketplace.ListingsStoragePath)! + } + + execute { + + let itemRef = self.itemCollectionRef.borrow${borrowName}(id: itemID)! as &HighsnobietyNotInParis.NFT + + //list the item + TheFabricantMarketplaceHelper.${mpHelper}( + itemRef: itemRef, + ${listingsRefKey}: self.listingRef, + nftProviderCapability: self.itemNFTProvider, + nftType: Type<@HighsnobietyNotInParis.NFT>(), + nftID: itemID, + paymentCapability: self.flowReceiver, + salePaymentVaultType: Type<@FlowToken.Vault>(), + price: price + ) + } + } \ No newline at end of file diff --git a/transactions/TheFabricant/list_highsnobietynotinparisItem.json b/transactions/TheFabricant/list_highsnobietynotinparisItem.json new file mode 100644 index 0000000..f7c9039 --- /dev/null +++ b/transactions/TheFabricant/list_highsnobietynotinparisItem.json @@ -0,0 +1,9 @@ +{ + "arguments": [ + "itemID", + "price" + ], + "messages": { + "en": "List NFT for sale." + } +} \ No newline at end of file diff --git a/transactions/TheFabricant/list_kapersItem.cdc b/transactions/TheFabricant/list_kapersItem.cdc new file mode 100644 index 0000000..f6a1176 --- /dev/null +++ b/transactions/TheFabricant/list_kapersItem.cdc @@ -0,0 +1,72 @@ +import FungibleToken from 0xFungibleToken + import NonFungibleToken from 0xNonFungibleToken + import FlowToken from 0xFlowToken + import TheFabricantMarketplace from 0xTheFabricantMarketplace + import TheFabricantMarketplaceHelper from 0xTheFabricantMarketplaceHelper + import TheFabricantKapers from 0xTheFabricantKapers + + transaction(itemID: UInt64, price: UFix64) { + let itemCollectionRef: &TheFabricantKapers.Collection + let listingRef: &TheFabricantMarketplace.Listings + let flowReceiver: Capability<&FlowToken.Vault{FungibleToken.Receiver}> + let itemNFTProvider: Capability<&TheFabricantKapers.Collection{NonFungibleToken.Provider, NonFungibleToken.CollectionPublic}> + + prepare(acct: AuthAccount) { + + // borrow a reference to self's item collection + self.itemCollectionRef = acct.borrow<&TheFabricantKapers.Collection>(from: TheFabricantKapers.${collectionStoragePathPrefix}CollectionStoragePath) + ?? panic("Could not borrow item in storage") + + // get listings Capability + let listingCap = acct.getCapability<&{TheFabricantMarketplace.ListingsPublic}>(TheFabricantMarketplace.ListingsPublicPath) + + // get flow token Capability + self.flowReceiver = acct.getCapability<&FlowToken.Vault{FungibleToken.Receiver}>(/public/flowTokenReceiver) + assert(self.flowReceiver.check(), message: "Missing or mis-typed FlowToken receiver") + + // initialize private path to withdraw your nft once it is purchased + let NFTCollectionProviderPrivatePath = ${providerPrivatePath} + if !acct.getCapability<&TheFabricantKapers.Collection{NonFungibleToken.CollectionPublic, NonFungibleToken.Provider}>(NFTCollectionProviderPrivatePath).check() { + acct.unlink(NFTCollectionProviderPrivatePath) + acct.link<&TheFabricantKapers.Collection{TheFabricantKapers.${publicCollPrefix}CollectionPublic, NonFungibleToken.CollectionPublic, NonFungibleToken.Provider}>(NFTCollectionProviderPrivatePath, target: TheFabricantKapers.${collectionStoragePathPrefix}CollectionStoragePath) + } + + // get nft provider capability + self.itemNFTProvider = acct.getCapability<&TheFabricantKapers.Collection{NonFungibleToken.CollectionPublic, NonFungibleToken.Provider}>(NFTCollectionProviderPrivatePath) + assert(self.itemNFTProvider.check(), message: "Missing or mis-typed TheFabricantKapers.Collection provider") + + if !listingCap.check() { + + // get own flow token capability + let wallet = acct.getCapability<&FlowToken.Vault{FungibleToken.Receiver}>(/public/flowTokenReceiver) + + // create listings + let listings <- TheFabricantMarketplace.createListings() + + // store an empty listings + acct.save<@TheFabricantMarketplace.Listings>(<- listings, to: TheFabricantMarketplace.ListingsStoragePath) + + // publish a public capability to the Listings in storage + acct.link<&{TheFabricantMarketplace.ListingsPublic}>(TheFabricantMarketplace.ListingsPublicPath, target: TheFabricantMarketplace.ListingsStoragePath) + } + + self.listingRef=acct.borrow<&TheFabricantMarketplace.Listings>(from: TheFabricantMarketplace.ListingsStoragePath)! + } + + execute { + + let itemRef = self.itemCollectionRef.borrow${borrowName}(id: itemID)! as &TheFabricantKapers.NFT + + //list the item + TheFabricantMarketplaceHelper.${mpHelper}( + itemRef: itemRef, + ${listingsRefKey}: self.listingRef, + nftProviderCapability: self.itemNFTProvider, + nftType: Type<@TheFabricantKapers.NFT>(), + nftID: itemID, + paymentCapability: self.flowReceiver, + salePaymentVaultType: Type<@FlowToken.Vault>(), + price: price + ) + } + } \ No newline at end of file diff --git a/transactions/TheFabricant/list_kapersItem.json b/transactions/TheFabricant/list_kapersItem.json new file mode 100644 index 0000000..f7c9039 --- /dev/null +++ b/transactions/TheFabricant/list_kapersItem.json @@ -0,0 +1,9 @@ +{ + "arguments": [ + "itemID", + "price" + ], + "messages": { + "en": "List NFT for sale." + } +} \ No newline at end of file diff --git a/transactions/TheFabricant/list_primalraveItem.cdc b/transactions/TheFabricant/list_primalraveItem.cdc new file mode 100644 index 0000000..8c5ebb6 --- /dev/null +++ b/transactions/TheFabricant/list_primalraveItem.cdc @@ -0,0 +1,72 @@ +import FungibleToken from 0xFungibleToken + import NonFungibleToken from 0xNonFungibleToken + import FlowToken from 0xFlowToken + import TheFabricantMarketplace from 0xTheFabricantMarketplace + import TheFabricantMarketplaceHelper from 0xTheFabricantMarketplaceHelper + import TheFabricantPrimalRave from 0xTheFabricantPrimalRave + + transaction(itemID: UInt64, price: UFix64) { + let itemCollectionRef: &TheFabricantPrimalRave.Collection + let listingRef: &TheFabricantMarketplace.Listings + let flowReceiver: Capability<&FlowToken.Vault{FungibleToken.Receiver}> + let itemNFTProvider: Capability<&TheFabricantPrimalRave.Collection{NonFungibleToken.Provider, NonFungibleToken.CollectionPublic}> + + prepare(acct: AuthAccount) { + + // borrow a reference to self's item collection + self.itemCollectionRef = acct.borrow<&TheFabricantPrimalRave.Collection>(from: TheFabricantPrimalRave.${collectionStoragePathPrefix}CollectionStoragePath) + ?? panic("Could not borrow item in storage") + + // get listings Capability + let listingCap = acct.getCapability<&{TheFabricantMarketplace.ListingsPublic}>(TheFabricantMarketplace.ListingsPublicPath) + + // get flow token Capability + self.flowReceiver = acct.getCapability<&FlowToken.Vault{FungibleToken.Receiver}>(/public/flowTokenReceiver) + assert(self.flowReceiver.check(), message: "Missing or mis-typed FlowToken receiver") + + // initialize private path to withdraw your nft once it is purchased + let NFTCollectionProviderPrivatePath = ${providerPrivatePath} + if !acct.getCapability<&TheFabricantPrimalRave.Collection{NonFungibleToken.CollectionPublic, NonFungibleToken.Provider}>(NFTCollectionProviderPrivatePath).check() { + acct.unlink(NFTCollectionProviderPrivatePath) + acct.link<&TheFabricantPrimalRave.Collection{TheFabricantPrimalRave.${publicCollPrefix}CollectionPublic, NonFungibleToken.CollectionPublic, NonFungibleToken.Provider}>(NFTCollectionProviderPrivatePath, target: TheFabricantPrimalRave.${collectionStoragePathPrefix}CollectionStoragePath) + } + + // get nft provider capability + self.itemNFTProvider = acct.getCapability<&TheFabricantPrimalRave.Collection{NonFungibleToken.CollectionPublic, NonFungibleToken.Provider}>(NFTCollectionProviderPrivatePath) + assert(self.itemNFTProvider.check(), message: "Missing or mis-typed TheFabricantPrimalRave.Collection provider") + + if !listingCap.check() { + + // get own flow token capability + let wallet = acct.getCapability<&FlowToken.Vault{FungibleToken.Receiver}>(/public/flowTokenReceiver) + + // create listings + let listings <- TheFabricantMarketplace.createListings() + + // store an empty listings + acct.save<@TheFabricantMarketplace.Listings>(<- listings, to: TheFabricantMarketplace.ListingsStoragePath) + + // publish a public capability to the Listings in storage + acct.link<&{TheFabricantMarketplace.ListingsPublic}>(TheFabricantMarketplace.ListingsPublicPath, target: TheFabricantMarketplace.ListingsStoragePath) + } + + self.listingRef=acct.borrow<&TheFabricantMarketplace.Listings>(from: TheFabricantMarketplace.ListingsStoragePath)! + } + + execute { + + let itemRef = self.itemCollectionRef.borrow${borrowName}(id: itemID)! as &TheFabricantPrimalRave.NFT + + //list the item + TheFabricantMarketplaceHelper.${mpHelper}( + itemRef: itemRef, + ${listingsRefKey}: self.listingRef, + nftProviderCapability: self.itemNFTProvider, + nftType: Type<@TheFabricantPrimalRave.NFT>(), + nftID: itemID, + paymentCapability: self.flowReceiver, + salePaymentVaultType: Type<@FlowToken.Vault>(), + price: price + ) + } + } \ No newline at end of file diff --git a/transactions/TheFabricant/list_primalraveItem.json b/transactions/TheFabricant/list_primalraveItem.json new file mode 100644 index 0000000..f7c9039 --- /dev/null +++ b/transactions/TheFabricant/list_primalraveItem.json @@ -0,0 +1,9 @@ +{ + "arguments": [ + "itemID", + "price" + ], + "messages": { + "en": "List NFT for sale." + } +} \ No newline at end of file diff --git a/transactions/TheFabricant/list_s2item.cdc b/transactions/TheFabricant/list_s2item.cdc new file mode 100644 index 0000000..b2b01ff --- /dev/null +++ b/transactions/TheFabricant/list_s2item.cdc @@ -0,0 +1,72 @@ +import FungibleToken from 0xFungibleToken + import NonFungibleToken from 0xNonFungibleToken + import FlowToken from 0xFlowToken + import TheFabricantMarketplace from 0xTheFabricantMarketplace + import TheFabricantMarketplaceHelper from 0xTheFabricantMarketplaceHelper + import TheFabricantS2ItemNFT from 0xTheFabricantS2ItemNFT + + transaction(itemID: UInt64, price: UFix64) { + let itemCollectionRef: &TheFabricantS2ItemNFT.Collection + let listingRef: &TheFabricantMarketplace.Listings + let flowReceiver: Capability<&FlowToken.Vault{FungibleToken.Receiver}> + let itemNFTProvider: Capability<&TheFabricantS2ItemNFT.Collection{NonFungibleToken.Provider, NonFungibleToken.CollectionPublic}> + + prepare(acct: AuthAccount) { + + // borrow a reference to self's item collection + self.itemCollectionRef = acct.borrow<&TheFabricantS2ItemNFT.Collection>(from: TheFabricantS2ItemNFT.${collectionStoragePathPrefix}CollectionStoragePath) + ?? panic("Could not borrow item in storage") + + // get listings Capability + let listingCap = acct.getCapability<&{TheFabricantMarketplace.ListingsPublic}>(TheFabricantMarketplace.ListingsPublicPath) + + // get flow token Capability + self.flowReceiver = acct.getCapability<&FlowToken.Vault{FungibleToken.Receiver}>(/public/flowTokenReceiver) + assert(self.flowReceiver.check(), message: "Missing or mis-typed FlowToken receiver") + + // initialize private path to withdraw your nft once it is purchased + let NFTCollectionProviderPrivatePath = ${providerPrivatePath} + if !acct.getCapability<&TheFabricantS2ItemNFT.Collection{NonFungibleToken.CollectionPublic, NonFungibleToken.Provider}>(NFTCollectionProviderPrivatePath).check() { + acct.unlink(NFTCollectionProviderPrivatePath) + acct.link<&TheFabricantS2ItemNFT.Collection{TheFabricantS2ItemNFT.${publicCollPrefix}CollectionPublic, NonFungibleToken.CollectionPublic, NonFungibleToken.Provider}>(NFTCollectionProviderPrivatePath, target: TheFabricantS2ItemNFT.${collectionStoragePathPrefix}CollectionStoragePath) + } + + // get nft provider capability + self.itemNFTProvider = acct.getCapability<&TheFabricantS2ItemNFT.Collection{NonFungibleToken.CollectionPublic, NonFungibleToken.Provider}>(NFTCollectionProviderPrivatePath) + assert(self.itemNFTProvider.check(), message: "Missing or mis-typed TheFabricantS2ItemNFT.Collection provider") + + if !listingCap.check() { + + // get own flow token capability + let wallet = acct.getCapability<&FlowToken.Vault{FungibleToken.Receiver}>(/public/flowTokenReceiver) + + // create listings + let listings <- TheFabricantMarketplace.createListings() + + // store an empty listings + acct.save<@TheFabricantMarketplace.Listings>(<- listings, to: TheFabricantMarketplace.ListingsStoragePath) + + // publish a public capability to the Listings in storage + acct.link<&{TheFabricantMarketplace.ListingsPublic}>(TheFabricantMarketplace.ListingsPublicPath, target: TheFabricantMarketplace.ListingsStoragePath) + } + + self.listingRef=acct.borrow<&TheFabricantMarketplace.Listings>(from: TheFabricantMarketplace.ListingsStoragePath)! + } + + execute { + + let itemRef = self.itemCollectionRef.borrow${borrowName}(id: itemID)! as &TheFabricantS2ItemNFT.NFT + + //list the item + TheFabricantMarketplaceHelper.${mpHelper}( + itemRef: itemRef, + ${listingsRefKey}: self.listingRef, + nftProviderCapability: self.itemNFTProvider, + nftType: Type<@TheFabricantS2ItemNFT.NFT>(), + nftID: itemID, + paymentCapability: self.flowReceiver, + salePaymentVaultType: Type<@FlowToken.Vault>(), + price: price + ) + } + } \ No newline at end of file diff --git a/transactions/TheFabricant/list_s2item.json b/transactions/TheFabricant/list_s2item.json new file mode 100644 index 0000000..f7c9039 --- /dev/null +++ b/transactions/TheFabricant/list_s2item.json @@ -0,0 +1,9 @@ +{ + "arguments": [ + "itemID", + "price" + ], + "messages": { + "en": "List NFT for sale." + } +} \ No newline at end of file diff --git a/transactions/TheFabricant/list_weekdayItem.cdc b/transactions/TheFabricant/list_weekdayItem.cdc new file mode 100644 index 0000000..85dd757 --- /dev/null +++ b/transactions/TheFabricant/list_weekdayItem.cdc @@ -0,0 +1,72 @@ +import FungibleToken from 0xFungibleToken + import NonFungibleToken from 0xNonFungibleToken + import FlowToken from 0xFlowToken + import TheFabricantMarketplace from 0xTheFabricantMarketplace + import TheFabricantMarketplaceHelper from 0xTheFabricantMarketplaceHelper + import Weekday from 0xWeekday + + transaction(itemID: UInt64, price: UFix64) { + let itemCollectionRef: &Weekday.Collection + let listingRef: &TheFabricantMarketplace.Listings + let flowReceiver: Capability<&FlowToken.Vault{FungibleToken.Receiver}> + let itemNFTProvider: Capability<&Weekday.Collection{NonFungibleToken.Provider, NonFungibleToken.CollectionPublic}> + + prepare(acct: AuthAccount) { + + // borrow a reference to self's item collection + self.itemCollectionRef = acct.borrow<&Weekday.Collection>(from: Weekday.${collectionStoragePathPrefix}CollectionStoragePath) + ?? panic("Could not borrow item in storage") + + // get listings Capability + let listingCap = acct.getCapability<&{TheFabricantMarketplace.ListingsPublic}>(TheFabricantMarketplace.ListingsPublicPath) + + // get flow token Capability + self.flowReceiver = acct.getCapability<&FlowToken.Vault{FungibleToken.Receiver}>(/public/flowTokenReceiver) + assert(self.flowReceiver.check(), message: "Missing or mis-typed FlowToken receiver") + + // initialize private path to withdraw your nft once it is purchased + let NFTCollectionProviderPrivatePath = ${providerPrivatePath} + if !acct.getCapability<&Weekday.Collection{NonFungibleToken.CollectionPublic, NonFungibleToken.Provider}>(NFTCollectionProviderPrivatePath).check() { + acct.unlink(NFTCollectionProviderPrivatePath) + acct.link<&Weekday.Collection{Weekday.${publicCollPrefix}CollectionPublic, NonFungibleToken.CollectionPublic, NonFungibleToken.Provider}>(NFTCollectionProviderPrivatePath, target: Weekday.${collectionStoragePathPrefix}CollectionStoragePath) + } + + // get nft provider capability + self.itemNFTProvider = acct.getCapability<&Weekday.Collection{NonFungibleToken.CollectionPublic, NonFungibleToken.Provider}>(NFTCollectionProviderPrivatePath) + assert(self.itemNFTProvider.check(), message: "Missing or mis-typed Weekday.Collection provider") + + if !listingCap.check() { + + // get own flow token capability + let wallet = acct.getCapability<&FlowToken.Vault{FungibleToken.Receiver}>(/public/flowTokenReceiver) + + // create listings + let listings <- TheFabricantMarketplace.createListings() + + // store an empty listings + acct.save<@TheFabricantMarketplace.Listings>(<- listings, to: TheFabricantMarketplace.ListingsStoragePath) + + // publish a public capability to the Listings in storage + acct.link<&{TheFabricantMarketplace.ListingsPublic}>(TheFabricantMarketplace.ListingsPublicPath, target: TheFabricantMarketplace.ListingsStoragePath) + } + + self.listingRef=acct.borrow<&TheFabricantMarketplace.Listings>(from: TheFabricantMarketplace.ListingsStoragePath)! + } + + execute { + + let itemRef = self.itemCollectionRef.borrow${borrowName}(id: itemID)! as &Weekday.NFT + + //list the item + TheFabricantMarketplaceHelper.${mpHelper}( + itemRef: itemRef, + ${listingsRefKey}: self.listingRef, + nftProviderCapability: self.itemNFTProvider, + nftType: Type<@Weekday.NFT>(), + nftID: itemID, + paymentCapability: self.flowReceiver, + salePaymentVaultType: Type<@FlowToken.Vault>(), + price: price + ) + } + } \ No newline at end of file diff --git a/transactions/TheFabricant/list_weekdayItem.json b/transactions/TheFabricant/list_weekdayItem.json new file mode 100644 index 0000000..f7c9039 --- /dev/null +++ b/transactions/TheFabricant/list_weekdayItem.json @@ -0,0 +1,9 @@ +{ + "arguments": [ + "itemID", + "price" + ], + "messages": { + "en": "List NFT for sale." + } +} \ No newline at end of file diff --git a/transactions/TheFabricant/list_xxoriesItem.cdc b/transactions/TheFabricant/list_xxoriesItem.cdc new file mode 100644 index 0000000..3bdf098 --- /dev/null +++ b/transactions/TheFabricant/list_xxoriesItem.cdc @@ -0,0 +1,72 @@ +import FungibleToken from 0xFungibleToken + import NonFungibleToken from 0xNonFungibleToken + import FlowToken from 0xFlowToken + import TheFabricantMarketplace from 0xTheFabricantMarketplace + import TheFabricantMarketplaceHelper from 0xTheFabricantMarketplaceHelper + import TheFabricantXXories from 0xTheFabricantXXories + + transaction(itemID: UInt64, price: UFix64) { + let itemCollectionRef: &TheFabricantXXories.Collection + let listingRef: &TheFabricantMarketplace.Listings + let flowReceiver: Capability<&FlowToken.Vault{FungibleToken.Receiver}> + let itemNFTProvider: Capability<&TheFabricantXXories.Collection{NonFungibleToken.Provider, NonFungibleToken.CollectionPublic}> + + prepare(acct: AuthAccount) { + + // borrow a reference to self's item collection + self.itemCollectionRef = acct.borrow<&TheFabricantXXories.Collection>(from: TheFabricantXXories.${collectionStoragePathPrefix}CollectionStoragePath) + ?? panic("Could not borrow item in storage") + + // get listings Capability + let listingCap = acct.getCapability<&{TheFabricantMarketplace.ListingsPublic}>(TheFabricantMarketplace.ListingsPublicPath) + + // get flow token Capability + self.flowReceiver = acct.getCapability<&FlowToken.Vault{FungibleToken.Receiver}>(/public/flowTokenReceiver) + assert(self.flowReceiver.check(), message: "Missing or mis-typed FlowToken receiver") + + // initialize private path to withdraw your nft once it is purchased + let NFTCollectionProviderPrivatePath = ${providerPrivatePath} + if !acct.getCapability<&TheFabricantXXories.Collection{NonFungibleToken.CollectionPublic, NonFungibleToken.Provider}>(NFTCollectionProviderPrivatePath).check() { + acct.unlink(NFTCollectionProviderPrivatePath) + acct.link<&TheFabricantXXories.Collection{TheFabricantXXories.${publicCollPrefix}CollectionPublic, NonFungibleToken.CollectionPublic, NonFungibleToken.Provider}>(NFTCollectionProviderPrivatePath, target: TheFabricantXXories.${collectionStoragePathPrefix}CollectionStoragePath) + } + + // get nft provider capability + self.itemNFTProvider = acct.getCapability<&TheFabricantXXories.Collection{NonFungibleToken.CollectionPublic, NonFungibleToken.Provider}>(NFTCollectionProviderPrivatePath) + assert(self.itemNFTProvider.check(), message: "Missing or mis-typed TheFabricantXXories.Collection provider") + + if !listingCap.check() { + + // get own flow token capability + let wallet = acct.getCapability<&FlowToken.Vault{FungibleToken.Receiver}>(/public/flowTokenReceiver) + + // create listings + let listings <- TheFabricantMarketplace.createListings() + + // store an empty listings + acct.save<@TheFabricantMarketplace.Listings>(<- listings, to: TheFabricantMarketplace.ListingsStoragePath) + + // publish a public capability to the Listings in storage + acct.link<&{TheFabricantMarketplace.ListingsPublic}>(TheFabricantMarketplace.ListingsPublicPath, target: TheFabricantMarketplace.ListingsStoragePath) + } + + self.listingRef=acct.borrow<&TheFabricantMarketplace.Listings>(from: TheFabricantMarketplace.ListingsStoragePath)! + } + + execute { + + let itemRef = self.itemCollectionRef.borrow${borrowName}(id: itemID)! as &TheFabricantXXories.NFT + + //list the item + TheFabricantMarketplaceHelper.${mpHelper}( + itemRef: itemRef, + ${listingsRefKey}: self.listingRef, + nftProviderCapability: self.itemNFTProvider, + nftType: Type<@TheFabricantXXories.NFT>(), + nftID: itemID, + paymentCapability: self.flowReceiver, + salePaymentVaultType: Type<@FlowToken.Vault>(), + price: price + ) + } + } \ No newline at end of file diff --git a/transactions/TheFabricant/list_xxoriesItem.json b/transactions/TheFabricant/list_xxoriesItem.json new file mode 100644 index 0000000..f7c9039 --- /dev/null +++ b/transactions/TheFabricant/list_xxoriesItem.json @@ -0,0 +1,9 @@ +{ + "arguments": [ + "itemID", + "price" + ], + "messages": { + "en": "List NFT for sale." + } +} \ No newline at end of file diff --git a/transactions/TheFabricant/mint_cocreation_using_access_list.cdc b/transactions/TheFabricant/mint_cocreation_using_access_list.cdc new file mode 100644 index 0000000..234ecad --- /dev/null +++ b/transactions/TheFabricant/mint_cocreation_using_access_list.cdc @@ -0,0 +1,74 @@ +import TheFabricantKapers from 0xTheFabricantKapers +import MetadataViews from 0xMetadataViews +import NonFungibleToken from 0xNonFungibleToken +import TheFabricantNFTStandardV2 from 0xTheFabricantNFTStandardV2 +import FungibleToken from 0xFungibleToken +import FlowToken from 0xFlowToken + +transaction( + publicMinterAddress: Address, + publicMinterPathString: String, + garmentId: UInt64, + materialId: UInt64, + primaryColorId: UInt64, + secondaryColorId: UInt64, + + ){ + let publicMinter: &TheFabricantKapers.PublicMinter{TheFabricantKapers.Minter} + let receiver: &TheFabricantKapers.Collection{NonFungibleToken.CollectionPublic} + let payment: @FungibleToken.Vault + + prepare(acct: AuthAccount) { + // Create public path + let publicPath = PublicPath(identifier: publicMinterPathString) + ?? panic("Couldn't construct publicMinter public path") + + // Set public minter + // If it fails here, it's likely that the publicMinterAddress path in the tx is wrong + self.publicMinter = getAccount(publicMinterAddress) + .getCapability(publicPath).borrow<&TheFabricantKapers.PublicMinter{TheFabricantKapers.Minter}>() + ?? panic("Couldn't get publicMinter ref or publicMinterPathString is wrong: ".concat(publicMinterPathString)) + + // Set receiver + if !(acct.getCapability<&TheFabricantKapers.Collection{NonFungibleToken.CollectionPublic, NonFungibleToken.Receiver, TheFabricantKapers.TheFabricantKapersCollectionPublic, MetadataViews.ResolverCollection}>(TheFabricantKapers.TheFabricantKapersCollectionPublicPath).check()) { + if acct.type(at: TheFabricantKapers.TheFabricantKapersCollectionStoragePath) == nil { + let collection <- TheFabricantKapers.createEmptyCollection() as! @TheFabricantKapers.Collection + acct.save(<- collection, to: TheFabricantKapers.TheFabricantKapersCollectionStoragePath) + } + acct.unlink(TheFabricantKapers.TheFabricantKapersCollectionPublicPath) + + acct.link<&TheFabricantKapers.Collection{NonFungibleToken.CollectionPublic, NonFungibleToken.Receiver, TheFabricantKapers.TheFabricantKapersCollectionPublic, MetadataViews.ResolverCollection}>(TheFabricantKapers.TheFabricantKapersCollectionPublicPath, target: TheFabricantKapers.TheFabricantKapersCollectionStoragePath) + } + + // Get receiver + self.receiver = acct.getCapability<&TheFabricantKapers.Collection{NonFungibleToken.CollectionPublic}>(TheFabricantKapers.TheFabricantKapersCollectionPublicPath).borrow() + ?? panic("Couldn't get receiver") + + // Collect payment + let vaultRef: &FlowToken.Vault{FungibleToken.Provider} = acct.borrow<&FlowToken.Vault{FungibleToken.Provider}>(from: /storage/flowTokenVault) + ?? panic("Could not borrow reference to the owner's Vault!") + let paymentAmount = self.publicMinter.getPublicMinterDetails()["paymentAmount"]! + var amount = paymentAmount as! UFix64 + + // If free mint is active, withdraw 0 Flow + if (TheFabricantKapers.getIsFreeMintActive() == true) { + amount = 0.0 + } + + log("amount") + log(amount) + self.payment <- vaultRef.withdraw(amount: amount) + + } + // have to make the payment optional... + execute { + self.publicMinter.mintUsingAccessList( + receiver: self.receiver, + payment: <- self.payment, + garmentId: garmentId, + materialId: materialId, + primaryColorId: primaryColorId, + secondaryColorId: secondaryColorId + ) + } +} \ No newline at end of file diff --git a/transactions/TheFabricant/mint_cocreation_using_access_list.json b/transactions/TheFabricant/mint_cocreation_using_access_list.json new file mode 100644 index 0000000..02a0753 --- /dev/null +++ b/transactions/TheFabricant/mint_cocreation_using_access_list.json @@ -0,0 +1,13 @@ +{ + "arguments": [ + "publicMinterAddress", + "publicMinterPathString", + "garmentId", + "materialId", + "primaryColorId", + "secondaryColorId" + ], + "messages": { + "en": "Mint cocreation NFT." + } +} \ No newline at end of file diff --git a/transactions/TheFabricant/mint_variant_using_access_list.cdc b/transactions/TheFabricant/mint_variant_using_access_list.cdc new file mode 100644 index 0000000..f33e5f7 --- /dev/null +++ b/transactions/TheFabricant/mint_variant_using_access_list.cdc @@ -0,0 +1,59 @@ +import TheFabricantPrimalRave from 0xTheFabricantPrimalRave +import MetadataViews from 0xMetadataViews +import NonFungibleToken from 0xNonFungibleToken +import FungibleToken from 0xFungibleToken +import FlowToken from 0xFlowToken + + +transaction( + publicMinterAddress: Address, + publicMinterPathString: String, + variantId: UInt64 + + ){ + let publicMinter: &TheFabricantPrimalRave.PublicMinter{TheFabricantPrimalRave.Minter} + let receiver: &TheFabricantPrimalRave.Collection{NonFungibleToken.CollectionPublic} + let payment: @FungibleToken.Vault + + prepare(acct: AuthAccount) { + // Create public path + let publicPath = PublicPath(identifier: publicMinterPathString) + ?? panic("Couldn't construct publicMinter public path") + + // Set public minter + // If it fails here, it's likely that the publicMinterAddress path in the tx is wrong + self.publicMinter = getAccount(publicMinterAddress) + .getCapability(publicPath).borrow<&TheFabricantPrimalRave.PublicMinter{TheFabricantPrimalRave.Minter}>() + ?? panic("Couldn't get publicMinter ref or publicMinterPathString is wrong: ".concat(publicMinterPathString)) + + // Set receiver + if !(acct.getCapability<&TheFabricantPrimalRave.Collection{NonFungibleToken.CollectionPublic, NonFungibleToken.Receiver, TheFabricantPrimalRave.TheFabricantPrimalRaveCollectionPublic, MetadataViews.ResolverCollection}>(TheFabricantPrimalRave.TheFabricantPrimalRaveCollectionPublicPath).check()) { + if acct.type(at: TheFabricantPrimalRave.TheFabricantPrimalRaveCollectionStoragePath) == nil { + let collection <- TheFabricantPrimalRave.createEmptyCollection() as! @TheFabricantPrimalRave.Collection + acct.save(<- collection, to: TheFabricantPrimalRave.TheFabricantPrimalRaveCollectionStoragePath) + } + acct.unlink(TheFabricantPrimalRave.TheFabricantPrimalRaveCollectionPublicPath) + + acct.link<&TheFabricantPrimalRave.Collection{NonFungibleToken.CollectionPublic, NonFungibleToken.Receiver, TheFabricantPrimalRave.TheFabricantPrimalRaveCollectionPublic, MetadataViews.ResolverCollection}>(TheFabricantPrimalRave.TheFabricantPrimalRaveCollectionPublicPath, target: TheFabricantPrimalRave.TheFabricantPrimalRaveCollectionStoragePath) + } + self.receiver = acct.getCapability<&TheFabricantPrimalRave.Collection{NonFungibleToken.CollectionPublic}>(TheFabricantPrimalRave.TheFabricantPrimalRaveCollectionPublicPath).borrow() + ?? panic("Couldn't get receiver") + + let vaultRef: &FlowToken.Vault{FungibleToken.Provider} = acct.borrow<&FlowToken.Vault{FungibleToken.Provider}>(from: /storage/flowTokenVault) + ?? panic("Could not borrow reference to the owner's Vault!") + let paymentAmount = ${paymentAmountVariable} + let amount = paymentAmount as! UFix64 + log("amount") + log(amount) + self.payment <- vaultRef.withdraw(amount: amount) + + } + + execute { + self.publicMinter.mintUsingAccessList( + receiver: self.receiver, + payment: <- self.payment, + variantId: variantId + ) + } +} \ No newline at end of file diff --git a/transactions/TheFabricant/mint_variant_using_access_list.json b/transactions/TheFabricant/mint_variant_using_access_list.json new file mode 100644 index 0000000..6028718 --- /dev/null +++ b/transactions/TheFabricant/mint_variant_using_access_list.json @@ -0,0 +1,10 @@ +{ + "arguments": [ + "publicMinterAddress", + "publicMinterPathString", + "variantId" + ], + "messages": { + "en": "Mint NFT." + } +} \ No newline at end of file diff --git a/transactions/TheFabricant/purchase_highsnobietynotinparisItem.cdc b/transactions/TheFabricant/purchase_highsnobietynotinparisItem.cdc new file mode 100644 index 0000000..10c6ddc --- /dev/null +++ b/transactions/TheFabricant/purchase_highsnobietynotinparisItem.cdc @@ -0,0 +1,51 @@ +import FungibleToken from 0xFungibleToken + import NonFungibleToken from 0xNonFungibleToken + import FlowToken from 0xFlowToken + import TheFabricantMarketplace from 0xTheFabricantMarketplace + import MetadataViews from 0xMetadataViews + import HighsnobietyNotInParis from 0xHighsnobietyNotInParis + + + + transaction( + sellerAddress: Address, + listingID: String, + amount: UFix64 + ) { + // reference to the buyer's NFT collection where they + // will store the bought NFT + let itemNFTCollection: &HighsnobietyNotInParis.Collection{NonFungibleToken.Receiver} + // Vault that will hold the tokens that will be used to buy the NFT + let temporaryVault: @FungibleToken.Vault + prepare(acct: AuthAccount) { + + // initialize S2ItemNFT + if !acct.getCapability<&HighsnobietyNotInParis.Collection{NonFungibleToken.CollectionPublic, NonFungibleToken.Receiver, HighsnobietyNotInParis.HighsnobietyNotInParisCollectionPublic, MetadataViews.ResolverCollection}>(HighsnobietyNotInParis.HighsnobietyNotInParisCollectionPublicPath).check() { + if acct.type(at: HighsnobietyNotInParis.HighsnobietyNotInParisCollectionStoragePath) == nil { + let collection <- HighsnobietyNotInParis.createEmptyCollection() as! @HighsnobietyNotInParis.Collection + acct.save(<-collection, to: HighsnobietyNotInParis.HighsnobietyNotInParisCollectionStoragePath) + } + acct.unlink(HighsnobietyNotInParis.HighsnobietyNotInParisCollectionPublicPath) + acct.link<&HighsnobietyNotInParis.Collection{NonFungibleToken.CollectionPublic, NonFungibleToken.Receiver, HighsnobietyNotInParis.HighsnobietyNotInParisCollectionPublic, MetadataViews.ResolverCollection}>(HighsnobietyNotInParis.HighsnobietyNotInParisCollectionPublicPath, target: HighsnobietyNotInParis.HighsnobietyNotInParisCollectionStoragePath) + } + + self.itemNFTCollection = acct.borrow<&HighsnobietyNotInParis.Collection{NonFungibleToken.Receiver}>(from: HighsnobietyNotInParis.HighsnobietyNotInParisCollectionStoragePath) + ?? panic("could not borrow owner's nft collection reference") + + let vaultRef = acct.borrow<&FungibleToken.Vault>(from: /storage/flowTokenVault) + ?? panic("Could not borrow owner's Vault reference") + + // withdraw tokens from the buyer's Vault + self.temporaryVault <- vaultRef.withdraw(amount: amount) + } + + execute { + // get the read-only acct storage of the seller + let seller = getAccount(sellerAddress) + + let listingRef= seller.getCapability(TheFabricantMarketplace.ListingsPublicPath).borrow<&{TheFabricantMarketplace.ListingsPublic}>() + ?? panic("Could not borrow seller's listings reference") + + listingRef.purchaseListing(listingID: listingID, recipientCap: self.itemNFTCollection, payment: <- self.temporaryVault) + } + } \ No newline at end of file diff --git a/transactions/TheFabricant/purchase_highsnobietynotinparisItem.json b/transactions/TheFabricant/purchase_highsnobietynotinparisItem.json new file mode 100644 index 0000000..8c46b64 --- /dev/null +++ b/transactions/TheFabricant/purchase_highsnobietynotinparisItem.json @@ -0,0 +1,10 @@ +{ + "arguments": [ + "sellerAddress", + "listingID", + "amount" + ], + "messages": { + "en": "Purchase NFT." + } +} \ No newline at end of file diff --git a/transactions/TheFabricant/purchase_kapersItem.cdc b/transactions/TheFabricant/purchase_kapersItem.cdc new file mode 100644 index 0000000..6a3f72e --- /dev/null +++ b/transactions/TheFabricant/purchase_kapersItem.cdc @@ -0,0 +1,49 @@ +import FungibleToken from 0xFungibleToken + import NonFungibleToken from 0xNonFungibleToken + import FlowToken from 0xFlowToken + import TheFabricantKapers from 0xTheFabricantKapers + import TheFabricantMarketplace from 0xTheFabricantMarketplace + import MetadataViews from 0xMetadataViews + + transaction( + sellerAddress: Address, + listingID: String, + amount: UFix64 + ) { + // reference to the buyer's NFT collection where they + // will store the bought NFT + let itemNFTCollection: &TheFabricantKapers.Collection{NonFungibleToken.Receiver} + // Vault that will hold the tokens that will be used to buy the NFT + let temporaryVault: @FungibleToken.Vault + prepare(acct: AuthAccount) { + + // initialize S2ItemNFT + if !acct.getCapability<&TheFabricantKapers.Collection{NonFungibleToken.CollectionPublic, NonFungibleToken.Receiver, TheFabricantKapers.TheFabricantKapersCollectionPublic, MetadataViews.ResolverCollection}>(TheFabricantKapers.TheFabricantKapersCollectionPublicPath).check() { + if acct.type(at: TheFabricantKapers.TheFabricantKapersCollectionStoragePath) == nil { + let collection <- TheFabricantKapers.createEmptyCollection() as! @TheFabricantKapers.Collection + acct.save(<-collection, to: TheFabricantKapers.TheFabricantKapersCollectionStoragePath) + } + acct.unlink(TheFabricantKapers.TheFabricantKapersCollectionPublicPath) + acct.link<&TheFabricantKapers.Collection{NonFungibleToken.CollectionPublic, NonFungibleToken.Receiver, TheFabricantKapers.TheFabricantKapersCollectionPublic, MetadataViews.ResolverCollection}>(TheFabricantKapers.TheFabricantKapersCollectionPublicPath, target: TheFabricantKapers.TheFabricantKapersCollectionStoragePath) + } + + self.itemNFTCollection = acct.borrow<&TheFabricantKapers.Collection{NonFungibleToken.Receiver}>(from: TheFabricantKapers.TheFabricantKapersCollectionStoragePath) + ?? panic("could not borrow owner's nft collection reference") + + let vaultRef = acct.borrow<&FungibleToken.Vault>(from: /storage/flowTokenVault) + ?? panic("Could not borrow owner's Vault reference") + + // withdraw tokens from the buyer's Vault + self.temporaryVault <- vaultRef.withdraw(amount: amount) + } + + execute { + // get the read-only acct storage of the seller + let seller = getAccount(sellerAddress) + + let listingRef= seller.getCapability(TheFabricantMarketplace.ListingsPublicPath).borrow<&{TheFabricantMarketplace.ListingsPublic}>() + ?? panic("Could not borrow seller's listings reference") + + listingRef.purchaseListing(listingID: listingID, recipientCap: self.itemNFTCollection, payment: <- self.temporaryVault) + } + } \ No newline at end of file diff --git a/transactions/TheFabricant/purchase_kapersItem.json b/transactions/TheFabricant/purchase_kapersItem.json new file mode 100644 index 0000000..8c46b64 --- /dev/null +++ b/transactions/TheFabricant/purchase_kapersItem.json @@ -0,0 +1,10 @@ +{ + "arguments": [ + "sellerAddress", + "listingID", + "amount" + ], + "messages": { + "en": "Purchase NFT." + } +} \ No newline at end of file diff --git a/transactions/TheFabricant/purchase_primalraveItem.cdc b/transactions/TheFabricant/purchase_primalraveItem.cdc new file mode 100644 index 0000000..58942ad --- /dev/null +++ b/transactions/TheFabricant/purchase_primalraveItem.cdc @@ -0,0 +1,51 @@ +import FungibleToken from 0xFungibleToken + import NonFungibleToken from 0xNonFungibleToken + import FlowToken from 0xFlowToken + import TheFabricantMarketplace from 0xTheFabricantMarketplace + import MetadataViews from 0xMetadataViews + import TheFabricantPrimalRave from 0xTheFabricantPrimalRave + + + + transaction( + sellerAddress: Address, + listingID: String, + amount: UFix64 + ) { + // reference to the buyer's NFT collection where they + // will store the bought NFT + let itemNFTCollection: &TheFabricantPrimalRave.Collection{NonFungibleToken.Receiver} + // Vault that will hold the tokens that will be used to buy the NFT + let temporaryVault: @FungibleToken.Vault + prepare(acct: AuthAccount) { + + // initialize S2ItemNFT + if !acct.getCapability<&TheFabricantPrimalRave.Collection{NonFungibleToken.CollectionPublic, NonFungibleToken.Receiver, TheFabricantPrimalRave.TheFabricantPrimalRaveCollectionPublic, MetadataViews.ResolverCollection}>(TheFabricantPrimalRave.TheFabricantPrimalRaveCollectionPublicPath).check() { + if acct.type(at: TheFabricantPrimalRave.TheFabricantPrimalRaveCollectionStoragePath) == nil { + let collection <- TheFabricantPrimalRave.createEmptyCollection() as! @TheFabricantPrimalRave.Collection + acct.save(<-collection, to: TheFabricantPrimalRave.TheFabricantPrimalRaveCollectionStoragePath) + } + acct.unlink(TheFabricantPrimalRave.TheFabricantPrimalRaveCollectionPublicPath) + acct.link<&TheFabricantPrimalRave.Collection{NonFungibleToken.CollectionPublic, NonFungibleToken.Receiver, TheFabricantPrimalRave.TheFabricantPrimalRaveCollectionPublic, MetadataViews.ResolverCollection}>(TheFabricantPrimalRave.TheFabricantPrimalRaveCollectionPublicPath, target: TheFabricantPrimalRave.TheFabricantPrimalRaveCollectionStoragePath) + } + + self.itemNFTCollection = acct.borrow<&TheFabricantPrimalRave.Collection{NonFungibleToken.Receiver}>(from: TheFabricantPrimalRave.TheFabricantPrimalRaveCollectionStoragePath) + ?? panic("could not borrow owner's nft collection reference") + + let vaultRef = acct.borrow<&FungibleToken.Vault>(from: /storage/flowTokenVault) + ?? panic("Could not borrow owner's Vault reference") + + // withdraw tokens from the buyer's Vault + self.temporaryVault <- vaultRef.withdraw(amount: amount) + } + + execute { + // get the read-only acct storage of the seller + let seller = getAccount(sellerAddress) + + let listingRef= seller.getCapability(TheFabricantMarketplace.ListingsPublicPath).borrow<&{TheFabricantMarketplace.ListingsPublic}>() + ?? panic("Could not borrow seller's listings reference") + + listingRef.purchaseListing(listingID: listingID, recipientCap: self.itemNFTCollection, payment: <- self.temporaryVault) + } + } \ No newline at end of file diff --git a/transactions/TheFabricant/purchase_primalraveItem.json b/transactions/TheFabricant/purchase_primalraveItem.json new file mode 100644 index 0000000..8c46b64 --- /dev/null +++ b/transactions/TheFabricant/purchase_primalraveItem.json @@ -0,0 +1,10 @@ +{ + "arguments": [ + "sellerAddress", + "listingID", + "amount" + ], + "messages": { + "en": "Purchase NFT." + } +} \ No newline at end of file diff --git a/transactions/TheFabricant/purchase_s2Item.cdc b/transactions/TheFabricant/purchase_s2Item.cdc new file mode 100644 index 0000000..943d341 --- /dev/null +++ b/transactions/TheFabricant/purchase_s2Item.cdc @@ -0,0 +1,41 @@ +import FungibleToken from 0xFungibleToken + import NonFungibleToken from 0xNonFungibleToken + import FlowToken from 0xFlowToken + import TheFabricantS2ItemNFT from 0xTheFabricantS2ItemNFT + import TheFabricantMarketplace from 0xTheFabricantMarketplace + + transaction(sellerAddress: Address, listingID: String, amount: UFix64) { + // reference to the buyer's NFT collection where they + // will store the bought NFT + let itemNFTCollection: &TheFabricantS2ItemNFT.Collection{NonFungibleToken.Receiver} + // Vault that will hold the tokens that will be used to buy the NFT + let temporaryVault: @FungibleToken.Vault + prepare(acct: AuthAccount) { + if !acct.getCapability<&{TheFabricantS2ItemNFT.ItemCollectionPublic}>(TheFabricantS2ItemNFT.CollectionPublicPath).check() { + if acct.type(at: TheFabricantS2ItemNFT.CollectionStoragePath) == nil { + let collection <- TheFabricantS2ItemNFT.createEmptyCollection() as! @TheFabricantS2ItemNFT.Collection + acct.save(<-collection, to: TheFabricantS2ItemNFT.CollectionStoragePath) + } + acct.unlink(TheFabricantS2ItemNFT.CollectionPublicPath) + acct.link<&{TheFabricantS2ItemNFT.ItemCollectionPublic}>(TheFabricantS2ItemNFT.CollectionPublicPath, target: TheFabricantS2ItemNFT.CollectionStoragePath) + } + self.itemNFTCollection = acct.borrow<&TheFabricantS2ItemNFT.Collection{NonFungibleToken.Receiver}>(from: TheFabricantS2ItemNFT.CollectionStoragePath) + ?? panic("could not borrow owner's nft collection reference") + + let vaultRef = acct.borrow<&FungibleToken.Vault>(from: /storage/flowTokenVault) + ?? panic("Could not borrow owner's Vault reference") + + // withdraw tokens from the buyer's Vault + self.temporaryVault <- vaultRef.withdraw(amount: amount) + } + + execute { + // get the read-only acct storage of the seller + let seller = getAccount(sellerAddress) + + let listingRef= seller.getCapability(TheFabricantMarketplace.ListingsPublicPath).borrow<&{TheFabricantMarketplace.ListingsPublic}>() + ?? panic("Could not borrow seller's listings reference") + + listingRef.purchaseListing(listingID: listingID, recipientCap: self.itemNFTCollection, payment: <- self.temporaryVault) + } + } \ No newline at end of file diff --git a/transactions/TheFabricant/purchase_s2Item.json b/transactions/TheFabricant/purchase_s2Item.json new file mode 100644 index 0000000..8c46b64 --- /dev/null +++ b/transactions/TheFabricant/purchase_s2Item.json @@ -0,0 +1,10 @@ +{ + "arguments": [ + "sellerAddress", + "listingID", + "amount" + ], + "messages": { + "en": "Purchase NFT." + } +} \ No newline at end of file diff --git a/transactions/TheFabricant/purchase_weekdayItem.cdc b/transactions/TheFabricant/purchase_weekdayItem.cdc new file mode 100644 index 0000000..0e11fc6 --- /dev/null +++ b/transactions/TheFabricant/purchase_weekdayItem.cdc @@ -0,0 +1,51 @@ +import FungibleToken from 0xFungibleToken + import NonFungibleToken from 0xNonFungibleToken + import FlowToken from 0xFlowToken + import TheFabricantMarketplace from 0xTheFabricantMarketplace + import MetadataViews from 0xMetadataViews + import Weekday from 0xWeekday + + + + transaction( + sellerAddress: Address, + listingID: String, + amount: UFix64 + ) { + // reference to the buyer's NFT collection where they + // will store the bought NFT + let itemNFTCollection: &Weekday.Collection{NonFungibleToken.Receiver} + // Vault that will hold the tokens that will be used to buy the NFT + let temporaryVault: @FungibleToken.Vault + prepare(acct: AuthAccount) { + + // initialize S2ItemNFT + if !acct.getCapability<&Weekday.Collection{NonFungibleToken.CollectionPublic, NonFungibleToken.Receiver, Weekday.WeekdayCollectionPublic, MetadataViews.ResolverCollection}>(Weekday.WeekdayCollectionPublicPath).check() { + if acct.type(at: Weekday.WeekdayCollectionStoragePath) == nil { + let collection <- Weekday.createEmptyCollection() as! @Weekday.Collection + acct.save(<-collection, to: Weekday.WeekdayCollectionStoragePath) + } + acct.unlink(Weekday.WeekdayCollectionPublicPath) + acct.link<&Weekday.Collection{NonFungibleToken.CollectionPublic, NonFungibleToken.Receiver, Weekday.WeekdayCollectionPublic, MetadataViews.ResolverCollection}>(Weekday.WeekdayCollectionPublicPath, target: Weekday.WeekdayCollectionStoragePath) + } + + self.itemNFTCollection = acct.borrow<&Weekday.Collection{NonFungibleToken.Receiver}>(from: Weekday.WeekdayCollectionStoragePath) + ?? panic("could not borrow owner's nft collection reference") + + let vaultRef = acct.borrow<&FungibleToken.Vault>(from: /storage/flowTokenVault) + ?? panic("Could not borrow owner's Vault reference") + + // withdraw tokens from the buyer's Vault + self.temporaryVault <- vaultRef.withdraw(amount: amount) + } + + execute { + // get the read-only acct storage of the seller + let seller = getAccount(sellerAddress) + + let listingRef= seller.getCapability(TheFabricantMarketplace.ListingsPublicPath).borrow<&{TheFabricantMarketplace.ListingsPublic}>() + ?? panic("Could not borrow seller's listings reference") + + listingRef.purchaseListing(listingID: listingID, recipientCap: self.itemNFTCollection, payment: <- self.temporaryVault) + } + } \ No newline at end of file diff --git a/transactions/TheFabricant/purchase_weekdayItem.json b/transactions/TheFabricant/purchase_weekdayItem.json new file mode 100644 index 0000000..8c46b64 --- /dev/null +++ b/transactions/TheFabricant/purchase_weekdayItem.json @@ -0,0 +1,10 @@ +{ + "arguments": [ + "sellerAddress", + "listingID", + "amount" + ], + "messages": { + "en": "Purchase NFT." + } +} \ No newline at end of file diff --git a/transactions/TheFabricant/purchase_xxoriesItem.cdc b/transactions/TheFabricant/purchase_xxoriesItem.cdc new file mode 100644 index 0000000..15760fe --- /dev/null +++ b/transactions/TheFabricant/purchase_xxoriesItem.cdc @@ -0,0 +1,51 @@ +import FungibleToken from 0xFungibleToken + import NonFungibleToken from 0xNonFungibleToken + import FlowToken from 0xFlowToken + import TheFabricantXXories from 0xTheFabricantXXories + import TheFabricantMarketplace from 0xTheFabricantMarketplace + import MetadataViews from 0xMetadataViews + + + + transaction( + sellerAddress: Address, + listingID: String, + amount: UFix64 + ) { + // reference to the buyer's NFT collection where they + // will store the bought NFT + let itemNFTCollection: &TheFabricantXXories.Collection{NonFungibleToken.Receiver} + // Vault that will hold the tokens that will be used to buy the NFT + let temporaryVault: @FungibleToken.Vault + prepare(acct: AuthAccount) { + + // initialize S2ItemNFT + if !acct.getCapability<&TheFabricantXXories.Collection{NonFungibleToken.CollectionPublic, NonFungibleToken.Receiver, TheFabricantXXories.TheFabricantXXoriesCollectionPublic, MetadataViews.ResolverCollection}>(TheFabricantXXories.TheFabricantXXoriesCollectionPublicPath).check() { + if acct.type(at: TheFabricantXXories.TheFabricantXXoriesCollectionStoragePath) == nil { + let collection <- TheFabricantXXories.createEmptyCollection() as! @TheFabricantXXories.Collection + acct.save(<-collection, to: TheFabricantXXories.TheFabricantXXoriesCollectionStoragePath) + } + acct.unlink(TheFabricantXXories.TheFabricantXXoriesCollectionPublicPath) + acct.link<&TheFabricantXXories.Collection{NonFungibleToken.CollectionPublic, NonFungibleToken.Receiver, TheFabricantXXories.TheFabricantXXoriesCollectionPublic, MetadataViews.ResolverCollection}>(TheFabricantXXories.TheFabricantXXoriesCollectionPublicPath, target: TheFabricantXXories.TheFabricantXXoriesCollectionStoragePath) + } + + self.itemNFTCollection = acct.borrow<&TheFabricantXXories.Collection{NonFungibleToken.Receiver}>(from: TheFabricantXXories.TheFabricantXXoriesCollectionStoragePath) + ?? panic("could not borrow owner's nft collection reference") + + let vaultRef = acct.borrow<&FungibleToken.Vault>(from: /storage/flowTokenVault) + ?? panic("Could not borrow owner's Vault reference") + + // withdraw tokens from the buyer's Vault + self.temporaryVault <- vaultRef.withdraw(amount: amount) + } + + execute { + // get the read-only acct storage of the seller + let seller = getAccount(sellerAddress) + + let listingRef= seller.getCapability(TheFabricantMarketplace.ListingsPublicPath).borrow<&{TheFabricantMarketplace.ListingsPublic}>() + ?? panic("Could not borrow seller's listings reference") + + listingRef.purchaseListing(listingID: listingID, recipientCap: self.itemNFTCollection, payment: <- self.temporaryVault) + } + } \ No newline at end of file diff --git a/transactions/TheFabricant/purchase_xxoriesItem.json b/transactions/TheFabricant/purchase_xxoriesItem.json new file mode 100644 index 0000000..8c46b64 --- /dev/null +++ b/transactions/TheFabricant/purchase_xxoriesItem.json @@ -0,0 +1,10 @@ +{ + "arguments": [ + "sellerAddress", + "listingID", + "amount" + ], + "messages": { + "en": "Purchase NFT." + } +} \ No newline at end of file diff --git a/transactions/TheFabricant/transfer_highsnobietynotinparisItem.cdc b/transactions/TheFabricant/transfer_highsnobietynotinparisItem.cdc new file mode 100644 index 0000000..ebc04e3 --- /dev/null +++ b/transactions/TheFabricant/transfer_highsnobietynotinparisItem.cdc @@ -0,0 +1,27 @@ +import NonFungibleToken from 0xNonFungibleToken + import HighsnobietyNotInParis from 0xHighsnobietyNotInParis + + transaction(recipient: Address, withdrawID: UInt64) { + + prepare(signer: AuthAccount) { + // get the recipients public account object + let recipient = getAccount(recipient) + + // borrow a reference to the signer's NFT collection + let collectionRef = signer + .borrow<&HighsnobietyNotInParis.Collection>(from: HighsnobietyNotInParis.HighsnobietyNotInParisCollectionStoragePath) + ?? panic("Could not borrow a reference to the owner's collection") + + // borrow a public reference to the receivers collection + let depositRef = recipient + .getCapability(HighsnobietyNotInParis.HighsnobietyNotInParisCollectionPublicPath) + .borrow<&{NonFungibleToken.CollectionPublic}>() + ?? panic("Could not borrow a reference to the receiver's collection") + + // withdraw the NFT from the owner's collection + let nft <- collectionRef.withdraw(withdrawID: withdrawID) + + // Deposit the NFT in the recipient's collection + depositRef.deposit(token: <-nft) + } + } \ No newline at end of file diff --git a/transactions/TheFabricant/transfer_highsnobietynotinparisItem.json b/transactions/TheFabricant/transfer_highsnobietynotinparisItem.json new file mode 100644 index 0000000..909d76a --- /dev/null +++ b/transactions/TheFabricant/transfer_highsnobietynotinparisItem.json @@ -0,0 +1,9 @@ +{ + "arguments": [ + "recipient", + "withdrawID" + ], + "messages": { + "en": "Transfer NFT." + } +} \ No newline at end of file diff --git a/transactions/TheFabricant/transfer_kapersItem.cdc b/transactions/TheFabricant/transfer_kapersItem.cdc new file mode 100644 index 0000000..e918595 --- /dev/null +++ b/transactions/TheFabricant/transfer_kapersItem.cdc @@ -0,0 +1,27 @@ +import NonFungibleToken from 0xNonFungibleToken + import TheFabricantKapers from 0xHighsnobietyNotInParis + + transaction(recipient: Address, withdrawID: UInt64) { + + prepare(signer: AuthAccount) { + // get the recipients public account object + let recipient = getAccount(recipient) + + // borrow a reference to the signer's NFT collection + let collectionRef = signer + .borrow<&TheFabricantKapers.Collection>(from: TheFabricantKapers.HighsnobietyNotInParisCollectionStoragePath) + ?? panic("Could not borrow a reference to the owner's collection") + + // borrow a public reference to the receivers collection + let depositRef = recipient + .getCapability(TheFabricantKapers.HighsnobietyNotInParisCollectionPublicPath) + .borrow<&{NonFungibleToken.CollectionPublic}>() + ?? panic("Could not borrow a reference to the receiver's collection") + + // withdraw the NFT from the owner's collection + let nft <- collectionRef.withdraw(withdrawID: withdrawID) + + // Deposit the NFT in the recipient's collection + depositRef.deposit(token: <-nft) + } + } \ No newline at end of file diff --git a/transactions/TheFabricant/transfer_kapersItem.json b/transactions/TheFabricant/transfer_kapersItem.json new file mode 100644 index 0000000..909d76a --- /dev/null +++ b/transactions/TheFabricant/transfer_kapersItem.json @@ -0,0 +1,9 @@ +{ + "arguments": [ + "recipient", + "withdrawID" + ], + "messages": { + "en": "Transfer NFT." + } +} \ No newline at end of file diff --git a/transactions/TheFabricant/transfer_primalraveItem.cdc b/transactions/TheFabricant/transfer_primalraveItem.cdc new file mode 100644 index 0000000..256004f --- /dev/null +++ b/transactions/TheFabricant/transfer_primalraveItem.cdc @@ -0,0 +1,27 @@ +import NonFungibleToken from 0xNonFungibleToken + import TheFabricantPrimalRave from 0xHighsnobietyNotInParis + + transaction(recipient: Address, withdrawID: UInt64) { + + prepare(signer: AuthAccount) { + // get the recipients public account object + let recipient = getAccount(recipient) + + // borrow a reference to the signer's NFT collection + let collectionRef = signer + .borrow<&TheFabricantPrimalRave.Collection>(from: TheFabricantPrimalRave.HighsnobietyNotInParisCollectionStoragePath) + ?? panic("Could not borrow a reference to the owner's collection") + + // borrow a public reference to the receivers collection + let depositRef = recipient + .getCapability(TheFabricantPrimalRave.HighsnobietyNotInParisCollectionPublicPath) + .borrow<&{NonFungibleToken.CollectionPublic}>() + ?? panic("Could not borrow a reference to the receiver's collection") + + // withdraw the NFT from the owner's collection + let nft <- collectionRef.withdraw(withdrawID: withdrawID) + + // Deposit the NFT in the recipient's collection + depositRef.deposit(token: <-nft) + } + } \ No newline at end of file diff --git a/transactions/TheFabricant/transfer_primalraveItem.json b/transactions/TheFabricant/transfer_primalraveItem.json new file mode 100644 index 0000000..909d76a --- /dev/null +++ b/transactions/TheFabricant/transfer_primalraveItem.json @@ -0,0 +1,9 @@ +{ + "arguments": [ + "recipient", + "withdrawID" + ], + "messages": { + "en": "Transfer NFT." + } +} \ No newline at end of file diff --git a/transactions/TheFabricant/transfer_weekdayItem.cdc b/transactions/TheFabricant/transfer_weekdayItem.cdc new file mode 100644 index 0000000..1939a43 --- /dev/null +++ b/transactions/TheFabricant/transfer_weekdayItem.cdc @@ -0,0 +1,27 @@ +import NonFungibleToken from 0xNonFungibleToken + import Weekday from 0xHighsnobietyNotInParis + + transaction(recipient: Address, withdrawID: UInt64) { + + prepare(signer: AuthAccount) { + // get the recipients public account object + let recipient = getAccount(recipient) + + // borrow a reference to the signer's NFT collection + let collectionRef = signer + .borrow<&Weekday.Collection>(from: Weekday.HighsnobietyNotInParisCollectionStoragePath) + ?? panic("Could not borrow a reference to the owner's collection") + + // borrow a public reference to the receivers collection + let depositRef = recipient + .getCapability(Weekday.HighsnobietyNotInParisCollectionPublicPath) + .borrow<&{NonFungibleToken.CollectionPublic}>() + ?? panic("Could not borrow a reference to the receiver's collection") + + // withdraw the NFT from the owner's collection + let nft <- collectionRef.withdraw(withdrawID: withdrawID) + + // Deposit the NFT in the recipient's collection + depositRef.deposit(token: <-nft) + } + } \ No newline at end of file diff --git a/transactions/TheFabricant/transfer_weekdayItem.json b/transactions/TheFabricant/transfer_weekdayItem.json new file mode 100644 index 0000000..909d76a --- /dev/null +++ b/transactions/TheFabricant/transfer_weekdayItem.json @@ -0,0 +1,9 @@ +{ + "arguments": [ + "recipient", + "withdrawID" + ], + "messages": { + "en": "Transfer NFT." + } +} \ No newline at end of file diff --git a/transactions/TheFabricant/transfer_xxoriesItem.cdc b/transactions/TheFabricant/transfer_xxoriesItem.cdc new file mode 100644 index 0000000..c617cba --- /dev/null +++ b/transactions/TheFabricant/transfer_xxoriesItem.cdc @@ -0,0 +1,27 @@ +import NonFungibleToken from 0xNonFungibleToken + import TheFabricantXXories from 0xHighsnobietyNotInParis + + transaction(recipient: Address, withdrawID: UInt64) { + + prepare(signer: AuthAccount) { + // get the recipients public account object + let recipient = getAccount(recipient) + + // borrow a reference to the signer's NFT collection + let collectionRef = signer + .borrow<&TheFabricantXXories.Collection>(from: TheFabricantXXories.HighsnobietyNotInParisCollectionStoragePath) + ?? panic("Could not borrow a reference to the owner's collection") + + // borrow a public reference to the receivers collection + let depositRef = recipient + .getCapability(TheFabricantXXories.HighsnobietyNotInParisCollectionPublicPath) + .borrow<&{NonFungibleToken.CollectionPublic}>() + ?? panic("Could not borrow a reference to the receiver's collection") + + // withdraw the NFT from the owner's collection + let nft <- collectionRef.withdraw(withdrawID: withdrawID) + + // Deposit the NFT in the recipient's collection + depositRef.deposit(token: <-nft) + } + } \ No newline at end of file diff --git a/transactions/TheFabricant/transfer_xxoriesItem.json b/transactions/TheFabricant/transfer_xxoriesItem.json new file mode 100644 index 0000000..909d76a --- /dev/null +++ b/transactions/TheFabricant/transfer_xxoriesItem.json @@ -0,0 +1,9 @@ +{ + "arguments": [ + "recipient", + "withdrawID" + ], + "messages": { + "en": "Transfer NFT." + } +} \ No newline at end of file