Class: Swap

Swap(settingsopt)

The Swap contract executes a set of transactions on two distinct Chain components, utilizing a secret-reveal mechanism to atomically execute either the full set or none.

Constructor

new Swap(settingsopt)

Atomically execute a set of transactions across two Chain components.
Parameters:
Name Type Attributes Default Description
settings Object <optional>
{} Configuration for the swap.
Source:

Methods

extractSecret(tx, address) → {Mixed}

Find an input from the provided transaction which spends from the target P2SH address.
Parameters:
Name Type Description
tx Transaction Transaction to iterate over.
address String P2SH address to search for.
Source:
Returns:
False on failure, secret value on success.
Type
Mixed