Skip to main content

Create offers for P2P swaps

The pallet introduces novel mechanisms for creating offers for collection owners. You can imagine marketplaces who provide services for anyone to bid on items of a collection.

These bids can be done using an unlimited collection that owners can use like writing a cheque as an offer to purchase an item from other collections.

Goal: allow anyone to create offers using the cheque book onchain for the collection owner to approve, enforcing some incentive for the bidders to remove their offer later.

Scenario: Charlie's eager to buy an item from Alice's collection so he provides her with an offer. She can choose to accept it or reject it. If the offer is accepted, Charlie's cheque is transferred to Alice along with the balance attached to it.

Steps to test this use case out:

  1. Create a public collection with an unlimited supply using the Charlie account as owner of this cheque book.
  2. For Charlie to submit an offer on a specific item of Alice's collection, you'll need to batch the mint and create_swap calls using his account. The mint call is like using a cheque, and the create_swap is the proposed exchange between the cheque and the desired item.
  3. Assume there is some marketplace that lists these offers for collection owners to accept.
  4. For Alice to accept it, she will need to make a claim transaction.

You can also set the expiration date for an offer.