Hi guys, im have problem with this “protocolParamUTxOCostPerWord”.
“Command failed: transaction build-raw Error: Transaction validaton error: Errors in protocol parameters conversion: Missing parameter: protocolParamUTxOCostPerWord”
const cardano = require("./cardano");
const array = [1];
const prompt = require('prompt-sync')();
const address = prompt("Wallet Address: ")
function sendADACardano(walletName) {
const sender = cardano.wallet(walletName);
console.log(
"Balance of Sender wallet: " +
cardano.toAda(sender.balance().value.lovelace) +
" ADA"
);
const receiver = address
//
const VALUE = 2;
const txInfo = {
txIn: cardano.queryUtxo(sender.paymentAddr),
txOut: [
{
address: sender.paymentAddr,
value: {
lovelace: sender.balance().value.lovelace - cardano.toLovelace(VALUE),
},
},
{
address: receiver,
value: {
lovelace: cardano.toLovelace(VALUE),
//asset
},
},
],
};
const raw = cardano.transactionBuildRaw(txInfo);
const fee = cardano.transactionCalculateMinFee({
...txInfo,
txBody: raw,
witnessCount: 1,
});
txInfo.txOut[0].value.lovelace -= fee;
const tx = cardano.transactionBuildRaw({ ...txInfo, fee });
const txSigned = cardano.transactionSign({
txBody: tx,
signingKeys: [sender.payment.skey],
});
const txHash = cardano.transactionSubmit(txSigned);
console.log(`Taxa: ${fee / 10000000}; Valor enviado: ${VALUE}`);
console.log(`https://cardanoscan.io/transaction/${txHash}`);
}
function start() {
console.time();
array.forEach((wallet) => {
try {
sendADACardano(`mat${wallet}`);
} catch (e) {
console.log("erro");
}
});
console.timeEnd();
}
start();
This is the code im using to do this function.
in the Protocol,json i have this parameter as “Null”, i tried to change to 34482 that was the default, but nothing happen.
Hope someone can help me.