atomics_check_htlc_redeemed
Checks whether an HTLC created by this wallet has already been redeemed by the counterparty and, if it has, returns the origin secret that the redeem transaction revealed.
Request
{
"jsonrpc": "2.0",
"id": 0,
"method": "atomics_check_htlc_redeemed",
"params": {
"htlc_tx_id": "018c8bcf749063ee4a8127b84586a03f9bbd1909d9e5cfdb92007ebc463462d4"
}
}
Request parameters
- htlc_tx_id - ID for transaction carrying HTLC.
Response
{
"id": 0,
"jsonrpc": "2.0",
"result": {
"origin_secrete_as_hex": "fe42b8c4742d2dbe4d5de5ae5212f75acb62b75e4b66b758ff8e252825c2d7a5",
"redeem_tx_id": "b329cce92a23fdaf89a5ad907ca9c4c1fbd052b79ec8414438533c83b39afc2b"
}
}
When the HTLC has not been redeemed yet, the call still succeeds but both fields come back empty:
{
"id": 0,
"jsonrpc": "2.0",
"result": {
"origin_secrete_as_hex": "",
"redeem_tx_id": "0000000000000000000000000000000000000000000000000000000000000000"
}
}
Response information
- origin_secrete_as_hex - string; the revealed origin secret, hex-encoded. If this field is empty, the HTLC has not been redeemed yet. Once it is filled in, this is the secret you use to redeem the matching HTLC on the other chain. (The field name is misspelled in the API itself, so it really is
origin_secrete_as_hexand notorigin_secret_as_hex.) - redeem_tx_id - string; hex-encoded id of the transaction that redeemed the HTLC. All zeroes while the HTLC is still unredeemed. Likely you will not need this field; it is returned just in case.