@vechain/vechain-kit 2.0.0-rc.5 → 2.0.0-rc.7
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/README.md +1 -1
- package/dist/index.cjs +25 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +25 -10
- package/dist/index.js.map +1 -1
- package/dist/metafile-cjs.json +1 -1
- package/dist/metafile-esm.json +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#### An all-in-one library for building VeChain applications.
|
|
2
2
|
|
|
3
3
|
<div align="center">
|
|
4
|
-
<img src="https://
|
|
4
|
+
<img src="https://prod-vechainkit-docs-images-bucket.s3.eu-west-1.amazonaws.com/intro.png" alt="VeChain Kit Banner">
|
|
5
5
|
</div>
|
|
6
6
|
|
|
7
7
|
## Introduction
|
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.
|
|
4828
|
+
version: "2.0.0-rc.7"};
|
|
4829
4829
|
var VersionFooter = ({ ...props }) => {
|
|
4830
4830
|
const { darkMode: isDark } = useVeChainKitConfig();
|
|
4831
4831
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -17855,8 +17855,13 @@ var getAllEventLogs = async ({
|
|
|
17855
17855
|
};
|
|
17856
17856
|
|
|
17857
17857
|
// src/hooks/thor/transactions/transactionUtils.ts
|
|
17858
|
-
var estimateTxGas = async (thor, clauses, caller
|
|
17859
|
-
|
|
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
|
+
});
|
|
17860
17865
|
if (response.reverted) throw new Error("Failed to estimate gas");
|
|
17861
17866
|
return response.totalGas;
|
|
17862
17867
|
};
|
|
@@ -17866,7 +17871,8 @@ var useSendTransaction = ({
|
|
|
17866
17871
|
onTxConfirmed,
|
|
17867
17872
|
onTxFailedOrCancelled,
|
|
17868
17873
|
suggestedMaxGas,
|
|
17869
|
-
privyUIOptions
|
|
17874
|
+
privyUIOptions,
|
|
17875
|
+
gasPadding
|
|
17870
17876
|
}) => {
|
|
17871
17877
|
const thor = dappKitReact.useThor();
|
|
17872
17878
|
const { signer } = dappKitReact.useWallet();
|
|
@@ -17893,16 +17899,21 @@ var useSendTransaction = ({
|
|
|
17893
17899
|
estimatedGas = await estimateTxGas(
|
|
17894
17900
|
thor,
|
|
17895
17901
|
[..._clauses],
|
|
17896
|
-
signerAccountAddress
|
|
17902
|
+
signerAccountAddress,
|
|
17903
|
+
{
|
|
17904
|
+
revision: "next",
|
|
17905
|
+
...gasPadding ? { gasPadding } : {}
|
|
17906
|
+
//If gasPadding is provided, use it, otherwise it will apply only revision
|
|
17907
|
+
}
|
|
17897
17908
|
);
|
|
17898
17909
|
} catch (e) {
|
|
17899
17910
|
console.error("Gas estimation failed", e);
|
|
17900
17911
|
}
|
|
17901
17912
|
const txBody = await thor.transactions.buildTransactionBody(
|
|
17902
17913
|
_clauses,
|
|
17903
|
-
estimatedGas,
|
|
17914
|
+
suggestedMaxGas ?? estimatedGas,
|
|
17915
|
+
//Provide either the suggested max gas (gas Limit) or the estimated gas
|
|
17904
17916
|
{
|
|
17905
|
-
gasLimit: suggestedMaxGas?.toString(),
|
|
17906
17917
|
// TODO: kit-migration check how to pass the delegator url
|
|
17907
17918
|
isDelegated: feeDelegation?.delegateAllTransactions
|
|
17908
17919
|
}
|
|
@@ -19081,9 +19092,13 @@ var LegalDocumentsContext = React10.createContext(void 0);
|
|
|
19081
19092
|
var useLegalDocuments = () => {
|
|
19082
19093
|
const context = React10.useContext(LegalDocumentsContext);
|
|
19083
19094
|
if (!context) {
|
|
19084
|
-
|
|
19085
|
-
|
|
19086
|
-
|
|
19095
|
+
return {
|
|
19096
|
+
hasAgreedToRequiredDocuments: true,
|
|
19097
|
+
agreements: [],
|
|
19098
|
+
walletAddress: void 0,
|
|
19099
|
+
documents: [],
|
|
19100
|
+
documentsNotAgreed: []
|
|
19101
|
+
};
|
|
19087
19102
|
}
|
|
19088
19103
|
return context;
|
|
19089
19104
|
};
|