eth_sign
always takes a string
(a message to sign) and address
two parameters (see https://eth.wiki/json-rpc/API#eth_sign): an address
(account that signes the message and a string
(a message to sign). Some ethereum provider support eth_signTransaction
(see https://eth.wiki/json-rpc/API#eth_signTransaction). Otherwise you need to use eth_sendTransaction
.
Note:
Most wallets prevent that you can sign raw transaction data by prepending the "Ethereum Message" prefix. In the past (and even now for MetaMask) you cancould rlp encode the transaction and use the rlp encoded transaction as the string
input.