utils#getSupplyCap TypeScript Examples

The following examples show how to use utils#getSupplyCap. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Btc2xFliTokenSupplyCapProvider.tsx    From index-ui with MIT License 6 votes vote down vote up
Btc2xFliTokenSupplyCapProvider: React.FC = ({ children }) => {
  const [btcFliSupplyCap, setBtcFliSupplyCap] = useState<BigNumber>()

  useEffect(() => {
    getSupplyCap(btc2xfliSuppyCapAddress as string).then((val) => {
      setBtcFliSupplyCap(
        new BigNumber(val).dividedBy(new BigNumber(10).pow(18))
      )
    })
  }, [])

  return (
    <TotalSupplyContext.Provider
      value={{
        btcfliSupplyCap: btcFliSupplyCap,
      }}
    >
      {children}
    </TotalSupplyContext.Provider>
  )
}
Example #2
Source File: Eth2xFliTokenSupplyCapProvider.tsx    From index-ui with MIT License 6 votes vote down vote up
Eth2xFliTokenSupplyCapProvider: React.FC = ({ children }) => {
  const [ethFliSupplyCap, setEthFliSupplyCap] = useState<BigNumber>()

  useEffect(() => {
    getSupplyCap(eth2xfliSuppyCapAddress as string).then((val) => {
      setEthFliSupplyCap(
        new BigNumber(val).dividedBy(new BigNumber(10).pow(18))
      )
    })
  }, [])

  return (
    <TotalSupplyContext.Provider
      value={{
        ethfliSupplyCap: ethFliSupplyCap,
      }}
    >
      {children}
    </TotalSupplyContext.Provider>
  )
}