RPC Browser


Command: participateswap


Help Content for participateswap
participateswap "address" amount "secrethash"

The participateswap command is performed by the participant to create a contract on the second blockchain. It operates similarly to initiate but requires using the secret hash from the initiator's contract and creates the contract with a locktime of 24 hours.

Argumets:
1. "address"         (string, required) The recipient address
2. amount              (numeric, required) The value for the swap
3. "secrethash"      (string, required) The hex-encoded hash of redemption secret

Result:
{
  "contract": {      (json object) The contract for swap 
    "address"        (string) The Atom address of the swap contract
    "scriptHex"      (string) The hex-encoded contract
    }
  "contractTx": {    (json object) The contract transaction
    "txid"           (string) The contract transaction id encoded in little-endian hexadecimal
    "hex"            (string) The hex-encoded contract transaction
    "fee"            (numeric) The amount of the contract transaction fee in BTC
   }
  "refundTx": {      (json object) The transaction for refund
    "txid"           (string) The refund transaction id encoded in little-endian hexadecimal
    "hex"            (string) The hex-encoded refund transaction
    "fee"            (numeric) The amount of the refund transaction fee in BTC
   }
}

Examples:
> bitcoin-cli participateswap "mxhBqMzeFc4N6ugGFMi5A4gRGD6yZ7HsW5" 2 "3fbf99fcb5690013e742991b5d43f62ac897ecb8494a33feaf6f76ff16b66d9f"
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "participateswap", "params": ["mxhBqMzeFc4N6ugGFMi5A4gRGD6yZ7HsW5" 2 "3fbf99fcb5690013e742991b5d43f62ac897ecb8494a33feaf6f76ff16b66d9f"] }' -H 'content-type: text/plain;' http://127.0.0.1:7332/
Execute Command: participateswap

Atomicswaps (6)


Blockchain (22)


Control (6)


Generating (2)


Mining (5)


Minting (1)


Network (12)


Rawtransactions (8)


Util (6)


Wallet (48)