Use get_self() to fetch information about the account that owns the session:
use danog\MadelineProto\API;
$api = new API('session.file');
$me = $api->get_self();
Response example:
Array
(
[_] => user
[self] => 1
[contact] => 1
[mutual_contact] =>
[deleted] =>
[bot] =>
[bot_chat_history] =>
[bot_nochats] =>
[verified] =>
[restricted] =>
[min] =>
[bot_inline_geo] =>
[id] => 109075721
[access_hash] => -8161497169871068283
[first_name] => Andrew
[last_name] => Dorokhov
[username] => dorohoff
[phone] => 380665550062
[photo] => Array
(
[_] => userProfilePhoto
[photo_id] => 468476654938859527
[photo_small] => Array
(
[_] => fileLocation
[dc_id] => 2
[volume_id] => 238226218
[local_id] => 229615
[secret] => -2050381823259470921
)
[photo_big] => Array
(
[_] => fileLocation
[dc_id] => 2
[volume_id] => 238226218
[local_id] => 229617
[secret] => 3279272717315329957
)
)
[status] => Array
(
[_] => userStatusOffline
[was_online] => 1537478044
)
)
Andrew Dorokhov