@vechain/vechain-kit 2.0.0-rc.7 → 2.0.0-rc.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -4825,7 +4825,7 @@ var AddressDisplay = ({
4825
4825
 
4826
4826
  // package.json
4827
4827
  var package_default = {
4828
- version: "2.0.0-rc.7"};
4828
+ version: "2.0.0-rc.8"};
4829
4829
  var VersionFooter = ({ ...props }) => {
4830
4830
  const { darkMode: isDark } = useVeChainKitConfig();
4831
4831
  return /* @__PURE__ */ jsxRuntime.jsxs(
@@ -17855,15 +17855,18 @@ var getAllEventLogs = async ({
17855
17855
  };
17856
17856
 
17857
17857
  // src/hooks/thor/transactions/transactionUtils.ts
17858
- var estimateTxGas = async (thor, clauses, caller, options = {
17859
- revision: "next"
17860
- // default revision is next
17861
- }) => {
17862
- const response = await thor.transactions.estimateGas(clauses, caller, {
17863
- ...options
17864
- });
17858
+ var estimateTxGas = async (thor, clauses, caller, options) => {
17859
+ const response = await thor.transactions.estimateGas(
17860
+ clauses,
17861
+ caller,
17862
+ options
17863
+ );
17865
17864
  if (response.reverted) throw new Error("Failed to estimate gas");
17866
- return response.totalGas;
17865
+ let totalGas = response?.totalGas ?? 0;
17866
+ if (!totalGas || Number.isNaN(totalGas)) {
17867
+ totalGas = 0;
17868
+ }
17869
+ return Math.ceil(totalGas);
17867
17870
  };
17868
17871
  var useSendTransaction = ({
17869
17872
  signerAccountAddress,
@@ -18167,7 +18170,8 @@ var useBuildTransaction = ({
18167
18170
  invalidateCache = true,
18168
18171
  onSuccess,
18169
18172
  onFailure,
18170
- suggestedMaxGas
18173
+ suggestedMaxGas,
18174
+ gasPadding
18171
18175
  }) => {
18172
18176
  const { account } = useWallet();
18173
18177
  const queryClient = reactQuery.useQueryClient();
@@ -18188,7 +18192,8 @@ var useBuildTransaction = ({
18188
18192
  signerAccountAddress: account?.address,
18189
18193
  onTxConfirmed: handleOnSuccess,
18190
18194
  suggestedMaxGas,
18191
- onTxFailedOrCancelled: onFailure
18195
+ onTxFailedOrCancelled: onFailure,
18196
+ gasPadding
18192
18197
  });
18193
18198
  const sendTransaction = React10.useCallback(
18194
18199
  async (props) => {