2

Hoping you guys can help as I'm dead ended trying to SEND ether via rpc. Before I jump off a tall building I will try stack exchange for the first time.

Error I get is:

PHP Fatal error:  Uncaught RPCException:  json: cannot unmarshal string into Go value of type eth.SendTxArgs

The Actual echoed json for SendTxARgs:

{"from":"0x549b968b43d503544854675387c5897a8a1c4f38","to":"0x7c9943A3C97099dBD6b1D6040d19D1Df4aB91de4","value":"0x58d15e17628000"}

which matches the args via api and docs as:

SendTxArgs struct {
    From     common.Address  `json:"from"`
    To       *common.Address `json:"to"`
    Gas      *rpc.HexNumber  `json:"gas"`
    GasPrice *rpc.HexNumber  `json:"gasPrice"`
    Value    *rpc.HexNumber  `json:"value"`
    Data     string          `json:"data"`
    Nonce    *rpc.HexNumber  `json:"nonce"`
}

actual code calling the send:

$jsontx = json_encode($tx);
echo $jsontx.PHP_EOL;
echo 'sending '.$ethereum->personal_signAndSendTransaction($jsontx,$pw).PHP_EOL;

Relying on function:

function personal_signAndSendTransaction($tx, $pw) {
    return $this->ether_request(__FUNCTION__, array($tx, $pw));
} 

Relying on a script that works for all other calls so far.. https://github.com/btelle/ethereum-php

Any gurus out there ?? help a brother out?

  • Guys FYI I belong to the digital merchant category. Someone trying to ACCEPT ETHEREUM. Long term merchant acceptance will be the single most important determinant of price. IMO Speculators and Miners, Smart contracts are great but merchants represent demand by promoting awareness. I've posted questions to ethereum.org forum etc and was left to rot LOL At some point don't we have to get the main stream public on board? Just askN – user3252381 Jun 12 '16 at 15:08
  • Welcome to Ethereum Stack Exchange! I think this is the best place to get multiple answers to your question. – Afr Jun 13 '16 at 8:42
3

Found it the hard way guys. Just kept trying everything as the docs are NOT clear on the exact json format. Here is a working example:

{"id":"1",
 "method": "personal_signAndSendTransaction", 
 "params": [{"from": "0x549b955555555555555555551c4f38", 
   "to": "0x7c9943555555555555555aB91de4", 
   "value": "0x58d15e17628000"},
   "passphrase"]}

Cheerio!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.