Skip to content

thirdweb@5.28.0

Compare
Choose a tag to compare
@jnsdls jnsdls released this 04 Jun 09:04
· 6032 commits to main since this release
5d47e50

Minor Changes

  • #3198 ca31a6c Thanks @gregfromstl! - Exports toSerializableTransaction to convert preparedTransaction into a fully serializable transaction.
    Exports estimateGasCost to estimate the gas cost of a transaction in ether and wei.
    Exports getGasPrice to get the currect gas price for a chain.

    toSerializableTransaction

    import { prepareTransaction, toSerializableTransaction } from "thirdweb";
    
    const transaction = await prepareTransaction({
      transaction: {
        to: "0x...",
        value: 100,
      },
    });
    const serializableTransaction = await toSerializableTransaction({
      transaction,
    });
    
    account.sendTransaction(serializableTransaction);

    estimateGasCost

    import { estimateGasCost } from "thirdweb";
    
    const gasCost = await estimateGasCost({ transaction });

    getGasPrice

    import { getGasPrice } from "thirdweb";
    
    const gasPrice = await getGasPrice({ client, chain });

Patch Changes