Skip to content

sendRowTransactions (invalid argument 0: json: cannot unmarshal hex string without 0x prefix) #651

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
smartDev22 opened this issue Feb 17, 2018 · 1 comment

Comments

@smartDev22
Copy link

  • Version: 3.16.4
  • Python: 3.5
  • OS: win

Good evening, tell me how to send a transaction by signing it locally

I do this:
`import json
import time
from eth_account import Account
from web3 import Web3, HTTPProvider, IPCProvider, eth
w3 = Web3(HTTPProvider('https://rinkeby.infura.io/EAGgjypt3XXLDYWK9B4W'))

to_addr = 0xbd0fc0e8245D099b751CF6437cc32385347F2251
from_addr = 0x00E49ef94dc7e798f4332e8E95303b24984F2c5e
key = '0x4c0883a69102937d6231471b5dbb6204fe5129617082792ae468d01a3f362318'

transaction = {
'to': to_addr,
'from': from_addr,
'value': 100,
'gas': 200000,
'gasPrice': 100000000,
'chainId': 4,
'nonce': int(time.time())
}
print(w3.eth.accounts)
gas_limit = 250000
signed_transaction = Account.signTransaction(transaction, key)

print(signed_transaction)

transaction_id = w3.eth.sendRawTransaction(signed_transaction.rawTransaction)
quit()
print('\nhttps://etherscan.io/tx/{0}'.format(transaction_id.hex()))
`

but in return I get such:

ValueError error: {'code': -32602, 'message': 'invalid argument 0: json: can not unmarshal non-string into Go struct field SendTxArgs.to of type common.Address'}

web3 == 3.16.4

already tried everything, and could not send the transaction

@kclowes
Copy link
Collaborator

kclowes commented Mar 14, 2022

Stale issue, closing.

@kclowes kclowes closed this as completed Mar 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants