Signing Transactions
The Enoki SDK uses the wallet-standard to allow
signing transactions to be handle the same way it is done with other wallets. You can use the
useSignAndExecuteTransaction
hook from dapp-kit
to sign and execute transactions
Example
Consider the following code example. Unseen here, the SuiClientProvider wraps the root of this app and the Enoki wallets are already registered through the wallet standard. Doing this enables the wallet related hooks from dapp-kit to work with Enoki.
When the user taps or clicks the Sign and execute transaction button, if the currently connected wallet is an Enoki wallet, the Enoki SDK will automatically generate a signature for the transaction, before it is executed with dapp-kit.
Unlike other wallets, signing does not require confirmation to approve the transaction. In a production app, you should provide logic that informs the user they are performing a transaction and allow them to cancel it if it was unintended.