pub fn create_swap<T: Config<I>, I: 'static>(
    offered_collection: T::CollectionId,
    offered_item: T::ItemId,
    desired_collection: T::CollectionId,
    maybe_desired_item: Option<T::ItemId>,
    maybe_price: Option<PriceWithDirection<<<T as Config<I>>::Currency as Currency<<T as SystemConfig>::AccountId>>::Balance>>,
    duration: BlockNumberFor<T>
)
Expand description

Register a new atomic swap, declaring an intention to send an item in exchange for desired_item from origin to target on the current blockchain. The target can execute the swap during the specified duration of blocks (if set). Additionally, the price could be set for the desired item.

Origin must be Signed and must be an owner of the item.

  • collection: The collection of the item.
  • item: The item an owner wants to give.
  • desired_collection: The collection of the desired item.
  • desired_item: The desired item an owner wants to receive.
  • maybe_price: The price an owner is willing to pay or receive for the desired item.
  • duration: A deadline for the swap. Specified by providing the number of blocks after which the swap will expire.

Emits SwapCreated on success.

Warning: Doc-Only

This function is an automatically generated, and is doc-only, uncallable stub. See the real version in Pallet::create_swap.