Skip to content

Sign a Transaction

Before you can sign a transaction, you need:

  1. A valid FSCO API key
  2. A wallet ID for the wallet you want to use for signing
  3. The transaction data to sign in hex format
POST /v2/wallet/{walletId}/sign/tx
ParameterTypeRequiredDescription
walletIdstringYesThe unique ID of the wallet to use for signing
datastringYesThe transaction data to be signed in hex format (must start with ‘0x’)
sign-tx.sh
#!/bin/bash
curl -X POST "https://api.fsco.io/v2/wallet/8c1d496f-2827-4750-a11f-74b48c11108d/sign/tx" \
-H "Authorization: Bearer ${FSCO_API_KEY}" \
-H "Content-Type: application/json" \
-d '{
"walletId": "8c1d496f-2827-4750-a11f-74b48c11108d",
"data": "0x02f87082000189059682f00085059682f10825208947..."
}'
Response
{
"walletId": "8c1d496f-2827-4750-a11f-74b48c11108d",
"signedData": "0x02f87082000189059682f00085059682f10825208947..."
}

The response includes:

  • walletId: The ID of the wallet that signed the transaction
  • signedData: The signed transaction data in hex format
  • The transaction data must be in hex format and start with ‘0x’
  • The wallet must exist and be active
  • The signed transaction is automatically broadcast to the network
  • The walletId in the path must match the walletId in the request body