Skip to main content

Overview

Configuring autosign requires setting up the enableAutoSign prop in your InterwovenKitProvider. InterwovenKit handles ghost wallet creation and management automatically—no external wallet provider setup is required.

Prerequisites

Before configuring autosign, ensure you have:
  • InterwovenKit already integrated into your application
  • An understanding of which transaction types you need to auto-sign

Setting Up Autosign

1

Install Dependencies

Ensure you have InterwovenKit and the required peer dependencies installed:
npm install @initia/interwovenkit-react @tanstack/react-query wagmi viem
2

Configure InterwovenKitProvider

Add the enableAutoSign prop to your InterwovenKitProvider:
providers.tsx
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>
  )
}

Configuring Autosign Permissions

Choose 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 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.
<InterwovenKitProvider enableAutoSign>{children}</InterwovenKitProvider>
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 section.
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:
<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
Only grant permissions for message types that your application actually needs. Granting overly broad permissions increases security risk.