diff --git a/src/cmd.js b/src/cmd.js index d0f1878..e56dabe 100644 --- a/src/cmd.js +++ b/src/cmd.js @@ -51,7 +51,7 @@ function mainMenu(actions) { subAction = (await menus.tokens()).action if (subAction === 'Mint') { - let params = (await menus.mintToken()) + let params = (await menus.mintToken(actions.web3Object().eth.defaultAccount)) await actions.mintToken(params); } if (subAction === 'Approve') { let params = (await menus.approveToken()) diff --git a/src/index.js b/src/index.js index 7b9faf9..56a08d6 100644 --- a/src/index.js +++ b/src/index.js @@ -19,7 +19,7 @@ const actions = new Actions(program.chain || "development", accounts || []); actions.connect({ url: (program.url || "ws://localhost:8556"), - accountIndex: (program.index || 0) + accountIndex: (program.index || 0) }, async () => { cmd(actions) }); diff --git a/src/menus.js b/src/menus.js index a25fa79..5549c87 100644 --- a/src/menus.js +++ b/src/menus.js @@ -202,7 +202,6 @@ const menus = { ]) }, - createFunder: async function() { return inquirer.prompt([ { @@ -240,7 +239,7 @@ const menus = { ]) }, - mintToken: async function() { + mintToken: async function(defaultAccount) { console.dir("note: If the transaction fails it likely means this account cannot mint the token (e.g not the owner)"); return inquirer.prompt([ { @@ -256,6 +255,7 @@ const menus = { type: 'input', name: 'account', message: 'What account to mint?', + default: defaultAccount, filter: String }, {