# Get Sponsor Balance

```typescript
import 'dotenv/config';
import { PaymasterUtils } from '@kanalabs/mirai';

(async () => {
   
   // Define the sponsorAddress and chainId
   const sponsorAddress = '0x7305B1a9bDD8247DeB288BC2d271626159cB8c4c'; // bifrost -> 0x8ffdf51ebf23761d762f028a6e1cb88db25a85bf
   const chainId = 80001;
   const apiKey = process.env.PAYMASTER_API_KEY || '';

   // initializating Paymaster service using the apiKey...
   const paymasterService = new PaymasterUtils(apiKey);
   
   // get a sponsor balance using the specified sponsorAddress and chainId
   const response = await paymasterService.getSponsorBalance(sponsorAddress, chainId);

   // Log the get sponsor balance response
   console.log('response', response);
})()
```


---

# Agent Instructions: 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:

```
GET https://docs.kanalabs.io/smart-wallet-sdk/mirai-sdk-the-evm-smart-wallet-and-paymaster/paymaster/get-sponsor-balance.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
