useInterwovenKit
hook provides access to wallet connection state, account information, UI controls, and transaction utilities for interacting with the Initia blockchain.
This hook must be used within a component wrapped by
InterwovenKitProvider
to access wallet functionality.Account Information
The hook provides multiple address formats and account details for the currently connected wallet:Current address in either Bech32 or hex format, depending on the configured
minitia
type.Bech32-formatted Initia wallet address of the connected account.
Hex-encoded Ethereum-compatible address of the connected account.
Optional username linked to the account. Returns
null
if no username is associated.UI Controls
The hook provides methods for controlling wallet-related UI components:Opens a drawer for connecting an external wallet.
Opens the main wallet drawer showing balances for the connected account.
Opens the bridge drawer to onboard assets with optional pre-populated values.
Bridge Form Interface
TheBridgeFormValues
interface defines the optional parameters for pre-populating the bridge form:
Source chain ID for the bridge transaction.
Source token denomination to bridge from.
Destination chain ID for the bridge transaction.
Destination token denomination to bridge to.
Initial bridge amount as entered by the user. Use human-readable values (e.g., “1” for 1 INIT, not “1000000”).
All bridge form values are optional. You can pre-populate any subset of fields to improve the user experience.
Example Usage
Transaction Methods
The hook provides utilities for estimating, signing, and sending transactions on the blockchain:Estimates the gas required for a transaction before execution.
Signs, broadcasts, and waits for block inclusion, returning the complete transaction response.
Signs and broadcasts a transaction, returning the transaction hash immediately without waiting for block inclusion.
Polls for transaction confirmation on-chain using a transaction hash.
Use
requestTxSync
for better UX when you want to show immediate feedback, then use waitForTxConfirmation
to track the final transaction status. Use requestTxBlock
when you need the complete transaction result immediately.Transaction Request Interface
TheTxRequest
interface defines the parameters for transaction operations:
Array of encoded transaction messages to include in the transaction.
Optional memo to attach to the transaction.
Target chain ID for the transaction. Defaults to the provider’s
defaultChainId
.Multiplier applied to the estimated gas amount for safety margin.
Explicit gas limit for the transaction. If provided, skips gas estimation.
Explicit fee for the transaction. If provided, skips the fee denomination selection UI.
Transaction Query Interface
TheTxQuery
interface defines parameters for tracking transaction confirmation:
Hash of the transaction to track for confirmation.
Chain ID where the transaction was broadcast.
Maximum time to wait for transaction confirmation before failing.
Polling interval in seconds for checking transaction status.