create_swap: TxDescriptor<{
    desired_collection: number;
    duration: number;
    maybe_desired_item?: number;
    maybe_price?: {
        amount: bigint;
        direction: Enum<{
            Receive: undefined;
            Send: undefined;
        }>;
    };
    offered_collection: number;
    offered_item: number;
}>

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.