/build/rpc / cosign / cross_chain
cosign.eth_refund_htlc
- workflowcross-chain-swap·step 7 of 7Workflow: cross-chain-swap · step 7 of 7
cosign.eth_refund_htlc "htlc_address" "swap_id" "signing_key" ( gas_limit max_fee_gwei max_priority_fee_gwei ) Refund locked HTLC funds after timelock expiry. Arguments: 1. htlc_address (string, required) HTLC contract address 2. swap_id (string, required) 32-byte swap ID (hex) 3. signing_key (string, required) 32-byte private key (hex) 4. gas_limit (numeric, optional) Gas limit (default 100000) 5. max_fee_gwei (numeric, optional) Max fee in gwei (default 50) 6. max_priority_fee_gwei (numeric, optional) Max priority fee in gwei (default 2) Result: { (json object) "success" : true|false, (boolean) Whether broadcast succeeded "tx_hash" : "str", (string) Transaction hash "from" : "str" (string) Sender address } Examples: > bitcoin-cli cosign.eth_refund_htlc "0xHTLC" "0xSWAPID" "0xKEY"
Signature
cosign.eth_refund_htlc(htlc_address: string, swap_id: string, signing_key: string, gas_limit?: number, max_fee_gwei?: number, max_priority_fee_gwei?: number) → any Code samples
curl --user "$RPC_USER:$RPC_PASS" \
--data-binary '{"jsonrpc":"1.0","id":"docs","method":"cosign.eth_refund_htlc","params":["\"<htlc_address>\"","\"<swap_id>\"","\"<signing_key>\"",0,0,0]}' \
-H 'content-type: text/plain;' \
http://127.0.0.1:8332/ Parameters
| Name | Type | Req. | Description |
|---|---|---|---|
| htlc_address | string | yes | HTLC contract address |
| swap_id | string | yes | 32-byte swap ID (hex) |
| signing_key | string | yes | 32-byte private key (hex) |
| gas_limit | number | — | Gas limit (default 100000) |
| max_fee_gwei | number | — | Max fee in gwei (default 50) |
| max_priority_fee_gwei | number | — | Max priority fee in gwei (default 2) |
Result
Type: any
{ (json object) "success" : true|false, (boolean) Whether broadcast succeeded "tx_hash" : "str", (string) Transaction hash "from" : "str" (string) Sender address }
Source: services/core-node/bcore/src/rpc/cosign.cpp:3466
C++ symbol: cosign_eth_refund_htlc