@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 +16 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +16 -11
- package/dist/index.js.map +1 -1
- package/dist/metafile-cjs.json +1 -1
- package/dist/metafile-esm.json +1 -1
- package/package.json +3 -3
package/dist/index.d.cts
CHANGED
|
@@ -2187,6 +2187,7 @@ type BuildTransactionProps<ClausesParams> = {
|
|
|
2187
2187
|
onSuccess?: () => void;
|
|
2188
2188
|
invalidateCache?: boolean;
|
|
2189
2189
|
suggestedMaxGas?: number;
|
|
2190
|
+
gasPadding?: number;
|
|
2190
2191
|
onFailure?: () => void;
|
|
2191
2192
|
};
|
|
2192
2193
|
/**
|
|
@@ -2197,9 +2198,10 @@ type BuildTransactionProps<ClausesParams> = {
|
|
|
2197
2198
|
* @param onSuccess - An optional callback function to be called after the transaction is successfully sent.
|
|
2198
2199
|
* @param onFailure - An optional callback function to be called after the transaction is failed or cancelled.
|
|
2199
2200
|
* @param suggestedMaxGas - The suggested maximum gas for the transaction.
|
|
2201
|
+
* @param gasPadding - The padding to add to the suggested maximum gas.
|
|
2200
2202
|
* @returns An object containing the result of the `useSendTransaction` hook and a `sendTransaction` function.
|
|
2201
2203
|
*/
|
|
2202
|
-
declare const useBuildTransaction: <ClausesParams>({ clauseBuilder, refetchQueryKeys, invalidateCache, onSuccess, onFailure, suggestedMaxGas, }: BuildTransactionProps<ClausesParams>) => {
|
|
2204
|
+
declare const useBuildTransaction: <ClausesParams>({ clauseBuilder, refetchQueryKeys, invalidateCache, onSuccess, onFailure, suggestedMaxGas, gasPadding, }: BuildTransactionProps<ClausesParams>) => {
|
|
2203
2205
|
sendTransaction: (props: ClausesParams) => Promise<void>;
|
|
2204
2206
|
isTransactionPending: boolean;
|
|
2205
2207
|
isWaitingForWalletConfirmation: boolean;
|
package/dist/index.d.ts
CHANGED
|
@@ -2187,6 +2187,7 @@ type BuildTransactionProps<ClausesParams> = {
|
|
|
2187
2187
|
onSuccess?: () => void;
|
|
2188
2188
|
invalidateCache?: boolean;
|
|
2189
2189
|
suggestedMaxGas?: number;
|
|
2190
|
+
gasPadding?: number;
|
|
2190
2191
|
onFailure?: () => void;
|
|
2191
2192
|
};
|
|
2192
2193
|
/**
|
|
@@ -2197,9 +2198,10 @@ type BuildTransactionProps<ClausesParams> = {
|
|
|
2197
2198
|
* @param onSuccess - An optional callback function to be called after the transaction is successfully sent.
|
|
2198
2199
|
* @param onFailure - An optional callback function to be called after the transaction is failed or cancelled.
|
|
2199
2200
|
* @param suggestedMaxGas - The suggested maximum gas for the transaction.
|
|
2201
|
+
* @param gasPadding - The padding to add to the suggested maximum gas.
|
|
2200
2202
|
* @returns An object containing the result of the `useSendTransaction` hook and a `sendTransaction` function.
|
|
2201
2203
|
*/
|
|
2202
|
-
declare const useBuildTransaction: <ClausesParams>({ clauseBuilder, refetchQueryKeys, invalidateCache, onSuccess, onFailure, suggestedMaxGas, }: BuildTransactionProps<ClausesParams>) => {
|
|
2204
|
+
declare const useBuildTransaction: <ClausesParams>({ clauseBuilder, refetchQueryKeys, invalidateCache, onSuccess, onFailure, suggestedMaxGas, gasPadding, }: BuildTransactionProps<ClausesParams>) => {
|
|
2203
2205
|
sendTransaction: (props: ClausesParams) => Promise<void>;
|
|
2204
2206
|
isTransactionPending: boolean;
|
|
2205
2207
|
isWaitingForWalletConfirmation: boolean;
|
package/dist/index.js
CHANGED
|
@@ -4818,7 +4818,7 @@ var AddressDisplay = ({
|
|
|
4818
4818
|
|
|
4819
4819
|
// package.json
|
|
4820
4820
|
var package_default = {
|
|
4821
|
-
version: "2.0.0-rc.
|
|
4821
|
+
version: "2.0.0-rc.8"};
|
|
4822
4822
|
var VersionFooter = ({ ...props }) => {
|
|
4823
4823
|
const { darkMode: isDark } = useVeChainKitConfig();
|
|
4824
4824
|
return /* @__PURE__ */ jsxs(
|
|
@@ -17848,15 +17848,18 @@ var getAllEventLogs = async ({
|
|
|
17848
17848
|
};
|
|
17849
17849
|
|
|
17850
17850
|
// src/hooks/thor/transactions/transactionUtils.ts
|
|
17851
|
-
var estimateTxGas = async (thor, clauses, caller, options
|
|
17852
|
-
|
|
17853
|
-
|
|
17854
|
-
|
|
17855
|
-
|
|
17856
|
-
|
|
17857
|
-
});
|
|
17851
|
+
var estimateTxGas = async (thor, clauses, caller, options) => {
|
|
17852
|
+
const response = await thor.transactions.estimateGas(
|
|
17853
|
+
clauses,
|
|
17854
|
+
caller,
|
|
17855
|
+
options
|
|
17856
|
+
);
|
|
17858
17857
|
if (response.reverted) throw new Error("Failed to estimate gas");
|
|
17859
|
-
|
|
17858
|
+
let totalGas = response?.totalGas ?? 0;
|
|
17859
|
+
if (!totalGas || Number.isNaN(totalGas)) {
|
|
17860
|
+
totalGas = 0;
|
|
17861
|
+
}
|
|
17862
|
+
return Math.ceil(totalGas);
|
|
17860
17863
|
};
|
|
17861
17864
|
var useSendTransaction = ({
|
|
17862
17865
|
signerAccountAddress,
|
|
@@ -18160,7 +18163,8 @@ var useBuildTransaction = ({
|
|
|
18160
18163
|
invalidateCache = true,
|
|
18161
18164
|
onSuccess,
|
|
18162
18165
|
onFailure,
|
|
18163
|
-
suggestedMaxGas
|
|
18166
|
+
suggestedMaxGas,
|
|
18167
|
+
gasPadding
|
|
18164
18168
|
}) => {
|
|
18165
18169
|
const { account } = useWallet();
|
|
18166
18170
|
const queryClient = useQueryClient();
|
|
@@ -18181,7 +18185,8 @@ var useBuildTransaction = ({
|
|
|
18181
18185
|
signerAccountAddress: account?.address,
|
|
18182
18186
|
onTxConfirmed: handleOnSuccess,
|
|
18183
18187
|
suggestedMaxGas,
|
|
18184
|
-
onTxFailedOrCancelled: onFailure
|
|
18188
|
+
onTxFailedOrCancelled: onFailure,
|
|
18189
|
+
gasPadding
|
|
18185
18190
|
});
|
|
18186
18191
|
const sendTransaction = useCallback(
|
|
18187
18192
|
async (props) => {
|