sendtomainchain (22.0.0 RPC)

sendtomainchain "address" amount ( subtractfeefromamount verbose )

Sends sidechain funds to the given mainchain address, through the federated pegin mechanism

Requires wallet passphrase to be set with walletpassphrase call if wallet is encrypted.

Arguments:
1. address                  (string, required) The destination address on Bitcoin mainchain
2. amount                   (numeric or string, required) The amount being sent to Bitcoin mainchain
3. subtractfeefromamount    (boolean, optional, default=false) The fee will be deducted from the amount being pegged-out.
4. verbose                  (boolean, optional, default=false) If true, return extra information about the transaction.

Result (if verbose is not set or set to false):
"hex"    (string) Transaction ID of the resulting sidechain transaction

Result (if verbose is set to true):
{                          (json object)
  "txid" : "hex",          (string) The transaction id.
  "fee reason" : "str"     (string) The transaction fee reason.
}

Examples:
> elements-cli sendtomainchain "mgWEy4vBJSHt3mC8C2SEWJQitifb4qeZQq" 0.1
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "sendtomainchain", "params": ["mgWEy4vBJSHt3mC8C2SEWJQitifb4qeZQq" 0.1]}' -H 'content-type: text/plain;' http://127.0.0.1:7041/