2022-01-11 22:32:20 +03:00
|
|
|
import { BigNumber } from 'ethers'
|
2021-12-02 21:35:39 +03:00
|
|
|
|
|
|
|
import { useSingleCallResult } from '../state/multicall/hooks'
|
2021-12-22 22:25:10 +03:00
|
|
|
import { useInterfaceMulticall } from './useContract'
|
2021-12-02 21:35:39 +03:00
|
|
|
|
|
|
|
// gets the current timestamp from the blockchain
|
|
|
|
export default function useCurrentBlockTimestamp(): BigNumber | undefined {
|
2021-12-22 22:25:10 +03:00
|
|
|
const multicall = useInterfaceMulticall()
|
2021-12-02 21:35:39 +03:00
|
|
|
return useSingleCallResult(multicall, 'getCurrentBlockTimestamp')?.result?.[0]
|
|
|
|
}
|