0

I am building an eosdapp using nodejs code.I got the wallet api from the developers portal,but when i run the code i get the following error.

{"code":500,"message":"Internal Service Error","error":{"code":7,"name":"bad_cast_exception","what":"Bad Cast","details":[]}}

The nodejs code with input data(payload11) given below.

payload11 = 
[{
  "ref_block_num": blockno,
  "ref_block_prefix": ref_block,
  "expiration": timestamp,
  "actions": [{
    "account": "certcontract",
    "name": "issue",
    "authorization": [
    {
      "actor": "terminatoroo",
      "permission": "active"
    }],
  "data": bindata
}],
"signatures": []
},
[
requiredkey
],
"e70aaab8997e1dfce58fbfac80cbbb8fecec7b99cf982a9444273cbc64c41473"
]




var biz = JSON.stringify(payload11);

console.log(biz);
console.log("")
//console.log(payload1)
var options = { method: 'POST',
url: 'http://127.0.0.1:8888/v1/wallet/sign_transaction',
headers: { 'content-type': 'application/x-www-form-urlencoded; charset=UTF-8' },body:biz};

request(options, function (error, response, body) {
if (error) throw new Error(error);

console.log(body);
});
1
  • I think your signature field is missing. Which page did you find this code?
    – han
    Jun 27, 2019 at 10:03

1 Answer 1

0

I think the issue is the payload11 variable is not valid JSON, specifically:

},    // Doesn't have a corresponding opening {
[
requiredkey         // Not in quotes, isn't connected to the key beneath
],
"e70aaab8997e1dfce58fbfac80cbbb8fecec7b99cf982a9444273cbc64c41473"
]

It should probably be something like this:

  "signatures": [],
  "requiredkey":"e70aaab8997e1dfce58fbfac80cbbb8fecec7b99cf982a9444273cbc64c41473"
}]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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