Merge pull request #16 from status-im/addDefaultAccountToMint
add default account to mint menu
This commit is contained in:
commit
07ca5685ca
|
@ -51,7 +51,7 @@ function mainMenu(actions) {
|
||||||
subAction = (await menus.tokens()).action
|
subAction = (await menus.tokens()).action
|
||||||
|
|
||||||
if (subAction === 'Mint') {
|
if (subAction === 'Mint') {
|
||||||
let params = (await menus.mintToken())
|
let params = (await menus.mintToken(actions.web3Object().eth.defaultAccount))
|
||||||
await actions.mintToken(params);
|
await actions.mintToken(params);
|
||||||
} if (subAction === 'Approve') {
|
} if (subAction === 'Approve') {
|
||||||
let params = (await menus.approveToken())
|
let params = (await menus.approveToken())
|
||||||
|
|
|
@ -19,7 +19,7 @@ const actions = new Actions(program.chain || "development", accounts || []);
|
||||||
|
|
||||||
actions.connect({
|
actions.connect({
|
||||||
url: (program.url || "ws://localhost:8556"),
|
url: (program.url || "ws://localhost:8556"),
|
||||||
accountIndex: (program.index || 0)
|
accountIndex: (program.index || 0)
|
||||||
}, async () => {
|
}, async () => {
|
||||||
cmd(actions)
|
cmd(actions)
|
||||||
});
|
});
|
||||||
|
|
|
@ -202,7 +202,6 @@ const menus = {
|
||||||
])
|
])
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
createFunder: async function() {
|
createFunder: async function() {
|
||||||
return inquirer.prompt([
|
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)");
|
console.dir("note: If the transaction fails it likely means this account cannot mint the token (e.g not the owner)");
|
||||||
return inquirer.prompt([
|
return inquirer.prompt([
|
||||||
{
|
{
|
||||||
|
@ -256,6 +255,7 @@ const menus = {
|
||||||
type: 'input',
|
type: 'input',
|
||||||
name: 'account',
|
name: 'account',
|
||||||
message: 'What account to mint?',
|
message: 'What account to mint?',
|
||||||
|
default: defaultAccount,
|
||||||
filter: String
|
filter: String
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue