> ## Documentation Index
> Fetch the complete documentation index at: https://docs.initia.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Configuration

## Overview

Configuring autosign requires setting up the `enableAutoSign` prop in your
`InterwovenKitProvider`. InterwovenKit derives and manages the dedicated
AutoSign wallet automatically.

## Prerequisites

Before configuring autosign, ensure you have:

* InterwovenKit already integrated into your application
* An understanding of which transaction types you need to auto-sign

<Note>
  This page focuses on the `enableAutoSign` configuration. For the full provider
  tree and base setup, see [Provider Setup](../../references/setup/providers).
</Note>

## Setting Up Autosign

<Steps>
  <Step title="Install Dependencies">
    Ensure you have InterwovenKit and the required peer dependencies installed:

    <CodeGroup>
      ```bash npm theme={null}
      npm install @initia/interwovenkit-react @tanstack/react-query wagmi viem
      ```

      ```bash yarn theme={null}
      yarn add @initia/interwovenkit-react @tanstack/react-query wagmi viem
      ```

      ```bash pnpm theme={null}
      pnpm add @initia/interwovenkit-react @tanstack/react-query wagmi viem
      ```

      ```bash bun theme={null}
      bun add @initia/interwovenkit-react @tanstack/react-query wagmi viem
      ```
    </CodeGroup>
  </Step>

  <Step title="Configure InterwovenKitProvider">
    Add the `enableAutoSign` prop to your `InterwovenKitProvider`:

    ```tsx providers.tsx theme={null}
    import { createConfig, http, WagmiProvider } from 'wagmi'
    import { mainnet } from 'wagmi/chains'
    import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
    import {
      injectStyles,
      InterwovenKitProvider,
    } from '@initia/interwovenkit-react'
    import css from '@initia/interwovenkit-react/styles.css?inline'

    import type { PropsWithChildren } from 'react'

    injectStyles(css)

    const wagmiConfig = createConfig({
      chains: [mainnet],
      transports: { [mainnet.id]: http() },
    })
    const queryClient = new QueryClient()

    const chainId = 'your-chain-id'

    function InterwovenKitWrapper({ children }: PropsWithChildren) {
      return (
        <InterwovenKitProvider
          enableAutoSign={{
            [chainId]: [
              '/cosmos.bank.v1beta1.MsgSend',
              '/initia.move.v1.MsgExecute',
            ],
          }}
        >
          {children}
        </InterwovenKitProvider>
      )
    }

    export default function Providers({ children }: PropsWithChildren) {
      return (
        <QueryClientProvider client={queryClient}>
          <WagmiProvider config={wagmiConfig}>
            <InterwovenKitWrapper>{children}</InterwovenKitWrapper>
          </WagmiProvider>
        </QueryClientProvider>
      )
    }
    ```
  </Step>
</Steps>

## Configuring Autosign Permissions

### Select Your Autosign Mode

Before enabling autosign, decide which mode fits your application:

* **Boolean (`enableAutoSign`)**
  * Best for simple, single-chain apps
  * Automatically allows default contract execution messages for the chain
  * Does **not** allow token transfers, staking, or other non-default messages

* **Per-Chain Configuration**
  (`enableAutoSign: { "chain-id": ["msg.type.Url", ...] }`)
  * Required if your app sends tokens, delegates, or uses multiple chains
  * You must explicitly list every allowed message type

If your app does more than basic contract execution calls, you should skip the
boolean option and use the per-chain permissions in the
[Advanced Configuration](#advanced-configuration-explicit-permissions) section.

Most production applications will eventually require the per-chain
configuration.

### Simple Configuration (Limited)

This option only enables autosign for default contract execution messages and is
intentionally restrictive.

```tsx theme={null}
<InterwovenKitProvider enableAutoSign>{children}</InterwovenKitProvider>
```

<Info>
  If you later need to support token transfers, staking, or multiple chains, you
  must switch from the boolean configuration to the per-chain configuration in
  the [Advanced Configuration](#advanced-configuration-explicit-permissions)
  section.
</Info>

When using boolean configuration, InterwovenKit automatically:

* Detects your chain's VM type
* Grants permission for the appropriate message type:
  * **MiniEVM**: `/minievm.evm.v1.MsgCall`
  * **MiniWasm**: `/cosmwasm.wasm.v1.MsgExecuteContract`
  * **MiniMove**: `/initia.move.v1.MsgExecute`

### Advanced Configuration (Explicit Permissions)

For multi-chain applications or when you need custom message types, specify
autosign permissions per chain:

```tsx theme={null}
<InterwovenKitProvider
  enableAutoSign={{
    'interwoven-1': [
      '/cosmos.bank.v1beta1.MsgSend', // native token transfers
      '/cosmos.staking.v1beta1.MsgDelegate', // staking
    ],
    'evm-1': ['/minievm.evm.v1.MsgCall'],
    'wasm-1': ['/cosmwasm.wasm.v1.MsgExecuteContract'],
    'move-1': ['/initia.move.v1.MsgExecute', '/cosmos.bank.v1beta1.MsgSend'],
  }}
  // ... other config
>
  {children}
</InterwovenKitProvider>
```

**Configuration Format:**

The `enableAutoSign` prop accepts an object where:

* **Keys**: Chain IDs (strings)
* **Values**: Arrays of message type URLs (strings)

**Common Message Types:**

* **EVM Chains**: `/minievm.evm.v1.MsgCall`
* **Wasm Chains**: `/cosmwasm.wasm.v1.MsgExecuteContract`
* **Move Chains**: `/initia.move.v1.MsgExecute`
* **Bank Module**: `/cosmos.bank.v1beta1.MsgSend`
* **Staking**: `/cosmos.staking.v1beta1.MsgDelegate`

<Warning>
  Only grant permissions for message types that your application actually needs.
  Granting overly broad permissions increases security risk.
</Warning>
