Function assertValidAddressByChainId

  • Given a wagmi config and a map of chain id's to addresses, determine an address/chainId combo that maps to the currently connected chain id, or throw a typed error.

    Parameters

    • config: Config
    • addressByChainId: Record<number, `0x${string}`>
    • OptionaldesiredChainId: number

    Returns {
        chainId: number;
        address: Address;
    }

    • chainId: number
    • address: Address