getCoins

abstract suspend fun getCoins(address: AccountAddress, first: Int? = null, cursor: String? = null, type: String? = null): Result<GetCoinsQuery.Data?, SuiError>

Fetches coin objects owned by a given address.

This method supports pagination and can be filtered by a specific coin type.

Return

A Result which is either:

  • Ok: Containing a nullable GetCoinsQuery.Data object. This object includes a list of coin objects and a nextCursor field for pagination.

  • Err: Containing a SuiError object with a list of GraphQLErrors.

Parameters

address

The AccountAddress of the owner.

first

An optional integer to specify the maximum number of coin objects to return per page.

cursor

An optional cursor string for pagination. Use the nextCursor from a previous response to fetch the next page of results.

type

An optional string representing the coin type to filter by (e.g., "0x2::sui::SUI").