Interface ConnectWalletOptions

Options for connecting a wallet via connectWallet() High-level configuration that gets transformed into internal WalletConfiguration

interface ConnectWalletOptions {
    getUser?: GetUserFunction;
    clientId?: string;
    chains?: ChainConfig[];
    initialChainId?: number;
    popupOverlayOptions?: wallet.PopupOverlayOptions;
    announceProvider?: boolean;
    crossSdkBridgeEnabled?: boolean;
    jsonRpcReferrer?: string;
    feeTokenSymbol?: string;
    forceScwDeployBeforeMessageSignature?: boolean;
    passportEventEmitter?: TypedEventEmitter<WalletEventMap>;
}

Properties

getUser?: GetUserFunction

Function that returns the current user with fresh tokens. This is the primary way to provide authentication to the wallet.

For NextAuth integration:

import { connectWallet } from '@imtbl/wallet';
import { useImmutableSession } from '@imtbl/auth-next-client';

const { getUser } = useImmutableSession();
const provider = await connectWallet({ getUser });

If not provided, a default implementation using @imtbl/auth will be created.

clientId?: string

Client ID for Immutable authentication. Required when getUser is not provided (for default auth). Also used for session activity tracking.

chains?: ChainConfig[]

Chain configurations (supports multi-chain) Defaults to [IMMUTABLE_ZKEVM_TESTNET_CHAIN, IMMUTABLE_ZKEVM_MAINNET_CHAIN] if not provided

initialChainId?: number

Initial chain ID (defaults to first chain in chains array) Use IMMUTABLE_ZKEVM_MAINNET_CHAIN_ID or IMMUTABLE_ZKEVM_TESTNET_CHAIN_ID

popupOverlayOptions?: wallet.PopupOverlayOptions

Optional popup overlay options

announceProvider?: boolean

Announce provider via EIP-6963 (default: true)

crossSdkBridgeEnabled?: boolean

Enable cross-SDK bridge mode (default: false)

jsonRpcReferrer?: string

Optional referrer URL to be sent with JSON-RPC requests

feeTokenSymbol?: string

Preferred token symbol for relayer fees (default: 'IMX')

forceScwDeployBeforeMessageSignature?: boolean

If true, forces SCW deployment before allowing message signature

passportEventEmitter?: TypedEventEmitter<WalletEventMap>
  • Only used by Passport for internal event communication