mirror of
https://github.com/kremalicious/blog.git
synced 2024-12-22 01:03:37 +01:00
parent
dfb57856aa
commit
fa7bb17f07
@ -1,4 +1,5 @@
|
||||
import React, { useState, useEffect } from 'react'
|
||||
import { parseEther } from '@ethersproject/units'
|
||||
import useWeb3, { connectors, getErrorMessage } from '../../../hooks/use-web3'
|
||||
import InputGroup from './InputGroup'
|
||||
import Alert, { getTransactionMessage } from './Alert'
|
||||
@ -38,7 +39,7 @@ export default function Web3Donation({ address }: { address: string }) {
|
||||
|
||||
const tx = await signer.sendTransaction({
|
||||
to: address,
|
||||
value: amount * 1e18 // ETH -> Wei
|
||||
value: parseEther(amount.toString()) // ETH -> Wei
|
||||
})
|
||||
setTransactionHash(tx.hash)
|
||||
setMessage({
|
||||
|
Loading…
Reference in New Issue
Block a user