Привет всем. Я пытаюсь сделать плагин из Buildfire для связывания, чтобы создать учетную запись NEM и преобразовать его в мультисиг-аккаунт с использованием локальной сети (например, localhost).
Вот фрагменты кода для требуемых вещей, которые я хотел бы спросить, есть проблема в создании недостающих битов 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);
});