Skip to content
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

Marketplace Checkout - Crypto transactions #244

Open
BellringerQuinn opened this issue Nov 14, 2024 · 0 comments
Open

Marketplace Checkout - Crypto transactions #244

BellringerQuinn opened this issue Nov 14, 2024 · 0 comments
Assignees

Comments

@BellringerQuinn
Copy link
Collaborator

BellringerQuinn commented Nov 14, 2024

Depends on #228

Implement marketplace checkout methods, namely:

  • GenerateBuyTransaction
  • GenerateSellTransaction
  • GenerateListingTransaction
  • GenerateOfferTransaction
  • GenerateCancelTransaction

Ridl file: https://github.com/0xsequence/marketplace-api/blob/master/proto/marketplace.ridl#L605
Unity Implementation:

In general, the way the marketplace works is as follows:

  • If you have an ERC721/1155 you wish to sell, you can either a) create a listing or b) accept an existing offer
  • If you wish to buy an ERC721/1155, you can either a) create an offer or b) accept an existing listing

Creating a listing or offer is a non-instant way of selling or buying an ERC721/1155; they require someone on the other end to accept them.
Accepting a listing or offer via a buy or sell operation respectively, is an instant way of selling or buying an ERC721/1155. To do this, you must query for active listings or offers using the marketplace read methods.

In other words, every buy/sell is a two sided operation. One person will list an ERC721/1155 for sale or make an offer to buy one; the other party will buy the listing or sell to the first person's offer.

All five API methods will return an array of "Steps". These Steps are essentially transactions. Using the GenerateListingTransaction endpoint alone will not create the listing, you must take the Step[] response and convert those into a Transaction[] to then be submitted via the WaaS API for the Listing to be created. The same logic applies for the other API methods above.

Both listings and offers are a type of order. These can be cancelled via GenerateCancelTransaction (need to submit the steps as transactions to take effect)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants