pub fn create_swap<T: Config>(
    target: T::AccountId,
    hashed_proof: HashedProof,
    action: T::SwapAction,
    duration: BlockNumberFor<T>
)
Expand description

Register a new atomic swap, declaring an intention to send funds from origin to target on the current blockchain. The target can claim the fund using the revealed proof. If the fund is not claimed after duration blocks, then the sender can cancel the swap.

The dispatch origin for this call must be Signed.

  • target: Receiver of the atomic swap.
  • hashed_proof: The blake2_256 hash of the secret proof.
  • balance: Funds to be sent from origin.
  • duration: Locked duration of the atomic swap. For safety reasons, it is recommended that the revealer uses a shorter duration than the counterparty, to prevent the situation where the revealer reveals the proof too late around the end block.

Warning: Doc-Only

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