3

Im creating a transaction using this code:

const tx = { txIn: wallet.balance().utxo, txOut: [ { address: wallet.paymentAddr, value: { ...wallet.balance().value, [MARCELOCOIN]: 1 }, } ], minting: [ { action: 'mint', quantity: 100, asset: MARCELOCOIN, script: mintScript }, ], witnessCount: 2, };

when i try to create the Raw arquive with:

let raw = cardanocliJs.transactionBuildRaw(tx);

It gives me the following error:

option --tx-out: unexpected "N" expecting white space or quantity (word64)

Error: Command failed: cardano-cli transaction build-raw --tx-in 5896209b2eb8eb2e3b19e06335e787c9856661087e6796fd5f483f0a30b923cc#0 --tx-in c6b914dfd086ac8e776c91ea615e847d1e7dc6f447a8cca467371de506ab64a7#1 --tx-out "addr_test1qqmjrep08v07cjn4t3852hr54czxw4m2dyv7wynkk3ufl63xjyzlpj9g68r0n0q3sfgc9vtt8z48z7yff3a4lh9kp2fqa0ccru+998825875+NaN undefined+1 43ad91053eb32da8884e1e5c4b67865d5f46f90072110c8e233261b9.MarceloCoin" --invalid-hereafter 38296439 --invalid-before 0 --fee 0 --out-file /home/cnode/minter/minter/tmp/tx_4ue4nzska.raw

So you see that there is a 'undefined' inside tx-out. I don't know whats the problem.. Can you help me?

2
  • Hello. Cardano cli has changed recently and that had added extra output in the query which maybe not yet been managed to implement by the library developer. Try contacting the developer or raising an issue on Github Sep 26, 2021 at 12:03
  • I have already, but he is too busy with other stuff to help.. Sep 27, 2021 at 14:09

2 Answers 2

1

The issue which is simple. The command: cardano-cli query utxo --address {address} --mainnet

Has changed it's output format recently. It now returns an extra field at the end of each TX. A well placed .pop() on the correct JS array will fix it. This extra data belongs to the Smart Contract logics.

Unfortunately I do not use this library and am unfamiliar with it so cannot offer any further guidance.

1

All solved with the actualization of the cardanocli-js to the 4.0.1 version.

The examples are working great!

1
  • Yes, version 4.0.0 had problems with extra whitespace in some lines. Version 4.0.1 resolved the issue.
    – pyropy
    Oct 19, 2021 at 6:15

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.