Fund your leg
fund_legFund your side of an agreed HTLC cross-chain swap on-chain: approve and lock tokens, pay the BTC P2WSH, or sign the Solana escrow; returns the transaction ID.
Instructions
AUTONOMOUS SETTLEMENT: fund YOUR side of an agreed swap on-chain, signing with the agent's own wallet (HASHLOCK_EVM_KEY or a Bankr wallet via HASHLOCK_BANKR_API_KEY / the TRON, BTC or SOLANA key for that leg's chain). Funds the leg you give — approves the token (EVM/TRON) and locks it in the HTLC, pays the P2WSH (BTC), or signs the escrow transaction the server builds (Solana). Prerequisites: the deal is agreed and BOTH parties have set their settlement addresses (set_settlement_address). Returns the on-chain tx id. Fund your long leg first if you are the initiator — only under the hashlock of the secret this process generated for the deal. It settles only deals agreed through this MCP (the swap must match the side, assets, amounts and a price you agreed to), only in assets and through contracts pinned in this release for the network your own RPC is on, with a capped fee and timelock. As the counterparty it first reads the initiator's escrow on chain and refuses unless it pays YOUR key the agreed asset and amount under the agreed hashlock, with a timelock at least 2h past yours.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"swap_id": "<swap_id>"
},
"name": "fund_leg"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| swap_id | Yes | Swap id (swap.id from deal_status, or swapId once a deal is agreed) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tx | No | On-chain tx id | |
| leg | No | ||
| chain | No | ||
| error | No | Set instead when the call failed |