大家好,我正在尝试从Buildfire制作插件,以创建NEM帐户并将其更改为使用本地网络(EI本地主机)的multisig帐户 这是我想问的必要内容的代码片段,因为JSON中的JSON丢失位或我需要查找的任何其他错误导致了问题,我尝试查找错误,但解决了但没有结果。我得到的错误是:
“错误:”内部服务器错误“消息:”属性的预期值 交易,但未找到”状态:500”
let done = $.ajax({
url: "http://127.0.0.1:7890/account/generate"
}).done(function (data) {
/// check you have data to report on
///if (data && data.list && data.list.length) {
/// fill in the UI with the new data
var report = data;
PubKey = report.publicKey;
PKey = report.privateKey;
$('#address').text("Created Account");
$('#balance').text(report.address);
$('#summary').text(report.privateKey);
$('#vested').text(report.publicKey)
///}
});
var date = new Date();
var TS = date.getTime();
var xyz = {
xyz: JSON.stringify({
"transaction":
{
"timeStamp": TS, ///needs to be changed to current timestamp from creating of account
"fee": 20, ///have to check
"type": 4097,
"deadline": TS + 30000, ///need to be changed
"version": -1744830462, /// main(real) network 1744830465,
"signer": PubKey,
"modifications": [
{
"modificationType": 1,
"cosignatoryAccount": PbKey
}
],
"minCosignatories" : {
"relativeChange": 1
}
},
"privateKey": PKey
})
};
fetch("http://127.0.0.1:7890/transaction/prepare-announce",{
method : 'POST',
headers : {
'Accept': 'application/json, text/plain, */*',
'Content-Type': 'application/json'
},
body : JSON.stringify(xyz)
}).then(function (response) {
return response.json();
})
.then(function (result) {
alert(result);
}).catch (function (error) {
console.log('Request failed', error);
});
答案 0 :(得分:0)
您尝试正常交易吗? 您似乎没有签署交易。 并且不要在网络上获取您的私钥。