4

Im using linux-Ubuntu in the WSL of the Windows 10. I have installed Cardano-node and Cardano-cli. Node v14 (latest stable version) ghc 8.10.6

Im trying to create a wallet but on this command: node src/create-wallet.js

I get this error:

const paymentVkey = options.paymentVkey
                                ^
TypeError: Cannot read property 'paymentVkey' of undefined
    at CardanocliJs.addressBuild (/home/marcelolinux/minter3/node_modules/cardanocli-js/index.js:316:33)
    at createWallet (/home/marcelolinux/minter3/src/create-wallet.js:7:11)
    at Object.<anonymous> (/home/marcelolinux/minter3/src/create-wallet.js:11:1)

Im following this (maybe) out of date tutorial.

I'have tryed with ghc 8.10.4 , also tryed configure the testnet but did'nt work also.

Can anyone help me to Mint Nft's using Javascript? I'm needing it for my final project of a course of Web Development.

2 Answers 2

3

I checked the npm page for cardanocli-js and found that you need to pass an options object to the AddressBuild method.


const createWallet = (account) => {
  cardano.addressKeyGen(account);
  cardano.stakeAddressKeyGen(account);
  cardano.stakeAddressBuild(account);
  cardano.addressBuild(account);
  return cardano.wallet(account);
};

createWallet("ADAPI");

needs to be altered to include an options object per the documentation.

It should be altered to be;


const createWallet = (account) => {
  const payment = cardano.addressKeyGen(account);
  const stake = cardano.stakeAddressKeyGen(account);
  cardano.stakeAddressBuild(account);
  cardano.addressBuild(account, {
    paymentVkey: payment.vkey,
    stakeVkey: stake.vkey,
  });
  return cardano.wallet(account);
};

createWallet("ADAPI");

This worked for me. I hope this helps.

1
1

I am also having the same problem on window using cardano-node-1.29.0-win64. cardanocli-js node module has issue on windows doesn't know how to create folder correctly, I need to modified "index.js" file. After fixing all that I finally run into the same problem you are facing.

For ubuntu, I got some weird problems not able to access my cardano-cli even I have it in my path, node is having trouble accessing.

1
  • I tried to build it manually by passing in skey and vkey files but no luck still, any help would be appreciated.
    – Gyden
    Sep 3, 2021 at 4:01

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.