RPC Browser


Command: initiateswap


Help Content for initiateswap
initiateswap "address" amount

The initiateswap command is performed by the initiator to create the first contract.

Argumets:
1. "address"         (string, required) The recipient address
2. amount              (numeric, required) The value for the swap

Result:
{
  "secret"           (string) The hex-encoded secret for redemption
  "secretHash"       (string) The hex-encoded hash of redemption secret
  "contract": {      (json object) The contract for swap 
    "address"        (string) The Atom address of the swap contract
    "scriptHex"      (string) The contract hex script
    }
  "contractTx": {    (json object) The contract transaction
    "txid"           (string) The contract transaction id encoded in little-endian hexadecimal
    "hex"            (string) The hex-encoded raw transaction with signature(s)
    "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 with signature(s)
    "fee"            (numeric) The amount of the refund transaction fee in BTC
   }
}

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

Atomicswaps (6)


Blockchain (22)


Control (6)


Generating (2)


Mining (5)


Minting (1)


Network (12)


Rawtransactions (8)


Util (6)


Wallet (48)