-
Notifications
You must be signed in to change notification settings - Fork 2
Add txs for NFTStorefrontV2 / TopShotMarketV3 #95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
bspowell
wants to merge
9
commits into
main
Choose a base branch
from
seanp/add-listing-storefrontv2
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
bf43f53
add list for NFTStorefrontV2 and renamed delist files
bspowell e6f872c
add new params
bspowell c429789
fix comissions and salecuts
bspowell 49e23a7
add nba delist tx, tests, and fix txs
bspowell 82d3e1c
fix moved topshot delist to other delist scripts
bspowell 22e7218
add array brackets for delist txns
Deewai 7c68190
Update list_nftstorefrontv2.cdc
Deewai 70d8823
use correct type
Deewai 3377b92
Update embed.go
Deewai File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| import TopShot from 0x{{.TopShotContractAddress}} | ||
| import Market from 0x{{.TopShotMarketContractAddress}} | ||
| import TopShotMarketV3 from 0x{{.TopShotMarketContractAddress}} | ||
| import NonFungibleToken from 0x{{.NonFungibleTokenContractAddress}} | ||
|
|
||
| // This transaction is for a user to stop a moment sale in their account | ||
|
|
||
| // Parameters | ||
| // | ||
| // tokenID: the ID of the moment whose sale is to be delisted | ||
|
|
||
| transaction() { | ||
|
|
||
| let nftIds: [UInt64] | ||
|
|
||
| prepare(acct: auth(Storage, Capabilities) &Account) { | ||
| self.nftIds = [{{.NftIds}}] | ||
|
|
||
| // borrow a reference to the owner's sale collection | ||
| if let topshotSaleV3Collection = acct.storage.borrow<auth(TopShotMarketV3.Cancel) &TopShotMarketV3.SaleCollection>(from: TopShotMarketV3.marketStoragePath) { | ||
|
|
||
| // cancel the moments from the sale, thereby de-listing it | ||
| for nftId in self.nftIds { | ||
| topshotSaleV3Collection.cancelSale(tokenID: nftId) | ||
| } | ||
|
|
||
| } else if let topshotSaleCollection = acct.storage.borrow<auth(NonFungibleToken.Withdraw) &Market.SaleCollection>(from: /storage/topshotSaleCollection) { | ||
| // Borrow a reference to the NFT collection in the signers account | ||
| let collectionRef = acct.storage.borrow<&TopShot.Collection>(from: /storage/MomentCollection) | ||
| ?? panic("Could not borrow from MomentCollection in storage") | ||
|
|
||
| // withdraw the moments from the sale, thereby de-listing it | ||
| for nftId in self.nftIds { | ||
| let token <- topshotSaleCollection.withdraw(tokenID: nftId) | ||
|
|
||
| // deposit the moment into the owner's collection | ||
| collectionRef.deposit(token: <-token) | ||
| } | ||
|
|
||
| } | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these tests are not actually testing anything. It just logs stuff
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know, it helps see what is getting inputted