Build a borrow
hookr_build_borrowBuilds a borrow on the Borrow panel's Longbow markets as the panel sends it, in two passes: first the approval and the typed messages the wallet signs with their deadline, then with the signatures and that deadline the unsigned call, simulated from the wallet, never past the panel's safe line.
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": {
"wallet": "<wallet>",
"collateral": "<collateral>",
"deposit": "<deposit>",
"borrow": "<borrow>"
},
"name": "hookr_build_borrow"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| borrow | Yes | USDG to borrow, in its own units. | |
| wallet | Yes | The wallet that deposits, signs and borrows. | |
| deposit | Yes | Collateral to deposit, in its own units; 0 to borrow against collateral already in. | |
| deadline | No | The deadline the first pass gave, with the signatures. | |
| collateral | Yes | The collateral token, from hookr_borrow_markets. | |
| permitSignature | No | The wallet's signature of the first pass's permit message. | |
| authorizationSignature | No | The wallet's signature of the first pass's authorization message. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sign | No | EIP-712 messages for the wallet to sign. | |
| calls | Yes | Unsigned calls, in the order to send them. | |
| borrow | No | ||
| reason | No | Why the answer is not ok, in words an agent can act on. | |
| status | Yes | ok, needs_approval, needs_signatures, refused or unknown. | |
| deposit | No | ||
| deadline | No | Unix seconds; pass it back with the signatures. |