Example mintMA.js not works
pastuh opened this issue ยท 18 comments
After launching file I get error:
Missing: --out-file FILE
Usage: cardano-cli transaction build-raw
Code is exact as in example. Wallet have tAda and all other commands works as it should.
I can't understand where is problem.
I think it has to do something with the formatting of the transaction string that is passed to execSync
. I'm testing some ideas, and I'll share them as soon as I figure something out.
@pyropy @pastuh So you have fixed the minting script? It is working with you? The error in mine is somewhat close to yours.
node create-nft.js
/home/cnode/cardano-my-node/db/node.socket
option --tx-out:
unexpected "N"
expecting white space or quantity (word64)
Like there is a mistake on this transaction:
const tx = { txIn: wallet.balance().utxo, txOut: [ { address: wallet.paymentAddr, value: { ...wallet.balance().value, [ASSET_ID]: 1 }, }, ], minting: [{ action: 'mint', quantity: 1, asset: ASSET_ID, script: mintScript }], metadata, witnessCount: 2, };
@MarceloArraes What's version of the library you got installed? Remember to update to v4.0.1
@pyropy I thought i had, but i've seen your comment about the npm been stuck at v4.0. Now i'm trying to update. I used this code to update: git clone https://github.com/Berry-Pool/cardanocli-js.git cd cardanocli-js npm install
Just doing that i garantee a updated version? (trying to write a 'cardanocli-js --version' don't work. I'm not really linux savy)
Aaand when i done i received a vulnerabilites warning that i fix using 'npm audit fix --force', is that right?
Yeah you're cloning the project and hence updating it that way. To check if you got the right version of the project you can check version
inside package.json
file.
If it says something like this you're good then:
{
"name": "cardanocli-js",
"version": "4.0.1",
"description": "A library binding the cardano-cli to JavaScript",
... etc
}
@pyropy You have a code for minting that is working? Could you send to me please? marcelo.arraes@gmail.com
Everything else im trying to do is working, like creating wallets, checking balances. But the minting give me that error.. Maybe i got some details wrong..
@pyropy You have a code for minting that is working? Could you send to me please? marcelo.arraes@gmail.com
Everything else im trying to do is working, like creating wallets, checking balances. But the minting give me that error.. Maybe i got some details wrong..
I've used code from the repo. What scripts are you using? Could you post it ?
I don't really know why but i cloned the original cardanocli-js and tryed the example codes and got the same error as before option --tx-out: unexpected "N"
But then i got back to my original code and tryed again, and suddenly it worked..
So thank you for your Help @pyropy !
Know i will be able to go foward on my coding!
Im getting the same error, tried to switch back to older version asweell 3.1.2 ,
getting same error on both 3.1.2 and 4.0.1
i downloaded the official repo and tried running the official examples it is same
option --tx-out:
unexpected "N"
expecting white space or quantity (word64)
cardano-node = 1.30.0
node.js = 14.18.0
@pastuh any suggestions for debugging, i looked into the code, it looks fine, it has your fix of space issue
Warning: Local header state query unavailable. Falling back to chain sync query
option --tx-out:
unexpected "N"
expecting white space or quantity (word64)
nodejs v16.13.0
cardano-cli 1.31.0
@MadOrkestra @MarceloArraes What versions of package do you use?
Mine is working since i deleted the cardanocli-js and re-installed to "version": "4.0.1".
The transaction changed @MadOrkestra.
Inside the tx (mint transaction as exemple) on the value bit, the new transaction looks like this:
value: { lovelace: wallet.balance().value.lovelace,[COIN]:1 }
@MadOrkestra @MarceloArraes What versions of package do you use?
4.0.1 but didn't delete the old version before as @MarceloArraes did. Should I check again?
I switched to Berry-Pool/cardanocli-js as @pyropy suggested, which solved the problem.
I have a problem with unexpected โuโ
option --tx-out: unexpected โuโ expecting white space or multi-asset value expression
Any hint?
Mine is working since i deleted the cardanocli-js and re-installed to "version": "4.0.1". The transaction changed @MadOrkestra. Inside the tx (mint transaction as exemple) on the value bit, the new transaction looks like this:
value: { lovelace: wallet.balance().value.lovelace,[COIN]:1 }
This worked for me, thank you sir :)