get Account Owned Objects
open suspend override fun getAccountOwnedObjects(accountAddress: AccountAddressInput, sortOrder: List<ObjectSortOrder>?, page: PaginationArgs?, minimumLedgerVersion: Long?): Result<GetObjectDataQuery.Data?, AptosIndexerError>
Queries for objects owned by a specific account.
This function can wait for the indexer to be synchronized to a specific ledger version before querying to ensure the data is up-to-date.
Usage
val address = AccountAddress.fromString("0x...")
val resolution = aptos.getAccountOwnedObjects(address)
when (resolution) {
is Result.Ok -> {
val data = resolution.value
println("Successfully retrieved owned objects data: $data")
}
is Result.Err -> println("Error retrieving owned objects: ${resolution.error.message}")
}Content copied to clipboard
Return
A Result which is either Result.Ok containing the query data, or Result.Err containing an AptosIndexerError.
Parameters
account Address
The address of the account to query.
sort Order
An optional list of sorting options for the results.
page
Optional pagination arguments (limit and offset).
minimum Ledger Version
An optional ledger version. The function will wait for the indexer to be at or beyond this version before querying.