Sign Endpoint
Sign messages and transactions without broadcasting them to the network.
Endpoint
POST /wallet/sign
Requires: Wallet & Agent API enabled, non-read-only key.
Overview
The sign endpoint supports three signature types:
personal_sign— Sign a plain text messageeth_signTypedData_v4— Sign EIP-712 structured dataeth_signTransaction— Sign a transaction without submitting it
This is a synchronous endpoint that returns immediately with the signature.
Request
personal_sign
{
"signatureType": "personal_sign",
"message": "Hello, Bankr!"
}
eth_signTypedData_v4
{
"signatureType": "eth_signTypedData_v4",
"typedData": {
"domain": { "name": "MyApp", "version": "1", "chainId": 8453 },
"types": {
"Message": [{ "name": "content", "type": "string" }]
},
"primaryType": "Message",
"message": { "content": "Hello" }
}
}
eth_signTransaction
{
"signatureType": "eth_signTransaction",
"transaction": {
"to": "0x...",
"chainId": 8453,
"value": "1000000000000000000"
}
}
Response
Success (200 OK)
{
"success": true,
"signature": "0xabc123...",
"signer": "0x1234...5678",
"signatureType": "personal_sign"
}
Error (403)
{
"error": "Read-only API key",
"message": "This API key has read-only access..."
}
Access Control
- Read-only keys are rejected with 403
- Allowed recipients configured on the key will block
eth_signTransactionandeth_signTypedData_v4(can't verify recipients from calldata).personal_signis always allowed since it cannot authorize fund movements.
Examples
curl
curl -X POST https://api.bankr.bot/wallet/sign \
-H "X-API-Key: your_api_key_here" \
-H "Content-Type: application/json" \
-d '{"signatureType":"personal_sign","message":"Hello, Bankr!"}'
Bankr CLI
bankr wallet sign --type personal_sign --message "Hello, Bankr!"
bankr wallet sign --type eth_signTransaction --transaction '{"to":"0x...","chainId":8453}'
Backward Compatibility
POST /agent/sign still works but is deprecated and requires walletApiEnabled.