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”).
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 with UI modal, returning the transaction hash immediately without waiting for block inclusion.
Signs and broadcasts a transaction directly without UI modal, returning the transaction hash immediately. Requires explicit fee.
Signs, broadcasts, and waits for transaction block inclusion directly without UI modal. Returns complete transaction response. Requires explicit fee.
Signs, broadcasts, and waits for block inclusion with pre-calculated fee, returning the complete transaction response.
Signs and broadcasts a transaction with pre-calculated fee, returning the transaction hash immediately without waiting for block inclusion.
Polls for transaction confirmation on-chain using a transaction hash.
Transaction Method Comparison
| Method | InterwovenKit UI | Fee Required | Use Case |
|---|---|---|---|
| requestTxSync | ✅ Yes | ❌ Optional | Standard UX, get hash |
| requestTxBlock | ✅ Yes | ❌ Optional | Standard UX, need full results |
| submitTxSync | ❌ Skipped | ✅ Required | Custom UX, get hash |
| submitTxBlock | ❌ Skipped | ✅ Required | Custom UX, need full results |
When to Use Each Method
UserequestTx* methods when:
- Building standard applications with InterwovenKit UI
- You want InterwovenKit’s built-in fee selection UI
- Users should choose fees through InterwovenKit modal
submitTx* methods when:
- You want to skip InterwovenKit’s modal
- Building custom transaction confirmation UI
- You need control over fee calculation and display
- Want direct browser wallet confirmation
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.