// 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
@ -63,15 +63,27 @@ export class TxRunnerWeb3 {
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. `))
console.log(`Send transaction failed: ${e.message} . if you use an injected provider, please check it is properly unlocked. `)
cb(null,e.receipt.transactionHash)
}
},
()=>{
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. `))