lookupOriginalAccountAddress

abstract suspend fun lookupOriginalAccountAddress(authenticationKey: AccountAddressInput, ledgerVersion: Int? = null): Result<AccountAddressInput, AptosSdkError>

Retrieves the original account address for a given authentication key.

This function can resolve the address for both rotated and non-rotated keys.

Usage

// Note: An authentication key can be created from an account address
val authKey = AccountAddress.fromString("0x...")
val resolution = aptos.lookupOriginalAccountAddress(authKey)

when (resolution) {
is Result.Ok -> {
val address = resolution.value
println("Original account address: $address")
}
is Result.Err -> println("Error looking up address: ${resolution.error.message}")
}

Return

A Result which is either Result.Ok containing the associated account address, or Result.Err containing an AptosSdkError.

Parameters

authenticationKey

The authentication key to look up.

ledgerVersion

An optional ledger version to query; if not provided, it will use the latest version.