> For the complete documentation index, see [llms.txt](https://docs.rallyprotocol.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rallyprotocol.com/react-native-expo/gasless-transactions/read-balances.md).

# 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 %}

```javascript
import { 
    Network,
    RlyAmoyNetwork, 
    getAccount, 
} from '@rly-network/mobile-sdk';

//get Amoy config
const rlyNetwork: Network = RlyAmoyNetwork;

//add your API Key
rlyNetwork.setApiKey(YourAPIKey...)

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

//get balance of RLY token on Amoy testnet for display purposes
const balance = await rlyNetwork.getDisplayBalance(); 

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

## Check balances with your chosen ERC-20 token

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

```javascript
import { 
    Network,
    RlyAmoyNetwork, 
    getAccount, 
} from '@rly-network/mobile-sdk';

//get Amoy config
const rlyNetwork: Network = RlyAmoyNetwork;

//add your API Key
rlyNetwork.setApiKey(YourAPIKey...)

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

//get balance of RLY token on Amoy testnet for display purposes
const balance = await rlyNetwork.getDisplayBalance(tokenAddress); 

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

<br>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.rallyprotocol.com/react-native-expo/gasless-transactions/read-balances.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
