getNFTBalancesForAddress method
- EthereumAddress address,
- {EthereumAddress? tokenAddress,
- int page = 1,
- int pageSize = 20}
override
Retrieves NFT balances for a specific address.
Given the address
, this method returns a NFTBalancesResponse
with
information about NFT balances. Additional parameters like tokenAddress
,
page
, and pageSize
can be specified for more targeted results.
Implementation
@override
Future<NFTBalancesResponse> getNFTBalancesForAddress(
EthereumAddress address, {
EthereumAddress? tokenAddress,
int page = 1,
int pageSize = 20,
}) async {
return NFTBalancesResponse.fromJson(await _restClient
.get<Map<String, dynamic>>('/account/nfts', queryParameters: {
'address': address.hex,
'chain_id': _chain.chainId,
if (tokenAddress != null) 'contract_address': tokenAddress.hex,
'page': page,
'limit': pageSize,
}));
}