# Read balances

{% hint style="info" %}
An API key is required to use the infrastructure to power gasless transactions. Visit  <https://app.rallyprotocol.com/> to generate both Amoy and Mainnet Polygon API keys.&#x20;
{% endhint %}

## Check balances with RLY token

{% hint style="success" %}
In this section, we leverage the RLY token ([polygonscan](https://polygonscan.com/token/0x76b8D57e5ac6afAc5D415a054453d1DD2c3C0094)) and our faucet to enable developers to read on-chain balances in just seconds. Use the following code to claim test RLY tokens and check the RLY balance of wallets.
{% endhint %}

```dart
import 'package:rly_network_flutter_sdk/network.dart';

//get Amoy config
final amoy = rlyAmoyNetwork;

//add your API Key
amoy.setApiKey(env.API_KEY);

//claim 10 test RLY tokens gaslessly for testing
await amoy.claimRly();

//get balance of RLY token on Amoy testnet for display purposes
await amoy.getBalance();

//get exact balance of RLY token on Amoy testnet for transfer purposes
await amoy.getExactBalance();
```

## Check balances with your chosen ERC-20 token

Use the following code to check the chosen token balance of wallets.&#x20;

```dart
import 'package:rly_network_flutter_sdk/network.dart';

//get Amoy config
final amoy = rlyAmoyNetwork;

//add your API Key
amoy.setApiKey(env.API_KEY);

//hex address of token contract.
final tokenAddress = "0x...." 

//get balance of any ERC20 token on Amoy testnet for display purposes
await amoy.getBalance(tokenAddress);

//get exact balance of any ERC20 token on Amoy testnet for transfer purposes
await amoy.getExactBalance(tokenAddress);
```

<br>
