returncallback(`Send transaction failed: ${e.message} . if you use an injected provider, please check it is properly unlocked. `)
if(api.personalMode()){
promptCb(
(value)=>{
(this.getWeb3()asany).eth.personal.sendTransaction({...tx,value}).then((res)=>cb(null,res.transactionHash)).catch((e)=>callback(`Send transaction failed: ${e.message} . if you use an injected provider, please check it is properly unlocked. `))
},
()=>{
returncallback('Canceled by user.')
}
)
}else{
this.getWeb3().eth.sendTransaction(tx).then((res)=>cb(null,res.transactionHash)).catch((e)=>callback(`Send transaction failed: ${e.message} . if you use an injected provider, please check it is properly unlocked. `))
}
}
@ -112,10 +105,10 @@ export class TxRunnerWeb3 {
// the sending stack (web3.js / metamask need to have the type defined)
// this is to avoid the following issue: https://github.com/MetaMask/metamask-extension/issues/11824