React SDK

useEstimation

Hook to provide transaction estimation.

import { useEstimation } from "@mintdrop/sdk"

Usage

import { useEstmation } from "@mintdrop/sdk"

const Example = () => {
  const deployData = getDeployData({
    name: "Mintdrop SDK",
    symbol: "MD_SDK",
    baseTokenURI: `ipfs://SOME_SLUG/`,
    mintPrice: 0.1
  })

  const estimate = useEstimation(deployData, 1 /* or any chain ID here */)

  return <div>Estimate to deploy contract is {estimate?.eth}</div>
}

Returns

{
  gas: number,
  gasPrice: number,
  wei: number,
  eth: number
}

Note

Estimation uses useBlockBeat and will update on every new block.

Previous
useDrop