getOwnedObjects method

  1. @override
Future<Page<ObjectData>> getOwnedObjects(
  1. String address, {
  2. String? type,
  3. String? cursor,
  4. int? limit,
  5. ObjectIncludeOptions? include,
})
override

Objects owned by address, optionally filtered by move type.

Implementation

@override
Future<Page<ObjectData>> getOwnedObjects(
  String address, {
  String? type,
  String? cursor,
  int? limit,
  ObjectIncludeOptions? include,
}) async {
  final data = await _client.executeData(
    _getOwnedObjectsOperation,
    generated.Variables$Query$GetOwnedObjects(
      address: address,
      type: type,
      first: limit,
      after: cursor,
    ),
  );
  final connection = data.address?.objects;
  if (connection == null) return const Page(data: [], hasNextPage: false);
  return Page(
    data: connection.nodes.map(_mapOwnedObject).toList(),
    hasNextPage: connection.pageInfo.hasNextPage,
    nextCursor: connection.pageInfo.endCursor,
  );
}