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