I'd like to execute an erc20 contract method without unlocking a wallet, signing the transaction inside my code.
Here is how the code should look like:
public async send(sender: string, receiver: string, value: number, key: string)
: PromiEvent<object> {
return this.contract.methods.transfer(receiver, value)
.send({ from: sender });
}
the current code doesn't allow me to sign manually, it assumes the sender address is unlocked. How can I sign send manually?
Best Answer