'Display result contained in let declaration Typescript
I am attempting to display the result of await this.contract.mint(amount, {value: this.state.tokenPrice.mul(amount)}). I would like to see what it outputs.
async mintTokens(amount: number): Promise<void>
{
try {
let showResult = await this.contract.mint(amount, {value: this.state.tokenPrice.mul(amount)});
this.setState({
successMessage: showResult,
});
} catch (e) {
this.setError(e);
}
}
The code has error Type 'ContractTransaction' is not assignable to type 'string'. and I'm not quite sure how to fix this.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
