> ## Documentation Index
> Fetch the complete documentation index at: https://docs.spire.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Monitor Account

> Track DA Builder GasTank balance, outstanding charges, request status, and receipts.

## Summary

DA Builder account monitoring uses `dab_accountInfo` for GasTank balances and `eth_getTransactionReceipt` or `dab_transactionStatus` for request tracking.

## Account Information

`dab_accountInfo` returns the current GasTank balance and outstanding charges for an account.

| Response field       | Meaning                           |
| :------------------- | :-------------------------------- |
| `balance`            | GasTank balance in wei            |
| `outstanding_charge` | Charges pending settlement in wei |

## Authenticated cURL Request

```bash theme={null}
curl -s https://da-builder.mainnet.spire.dev/ \
  -H "Content-Type: application/json" \
  -H "X-Flashbots-Signature: 0xYOUR_ADDRESS:0xYOUR_SIGNATURE" \
  --data '{
    "jsonrpc": "2.0",
    "method": "dab_accountInfo",
    "params": ["0xYOUR_ACCOUNT_ADDRESS"],
    "id": 1
  }'
```

Example response:

```json theme={null}
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "balance": "1000000000000000000",
    "outstanding_charge": "50000000000000000"
  }
}
```

## Authentication Header

The `X-Flashbots-Signature` header format is:

```text theme={null}
X-Flashbots-Signature: <address>:<signature>
```

The signature is an EIP-191 signature of the JSON-RPC request body hash.

## TypeScript: Account Info With ethers v6

```typescript theme={null}
import { Wallet, getBytes, id } from "ethers";

const rpcUrl = "https://da-builder.mainnet.spire.dev/";

async function accountInfo(privateKey: string, account: string) {
  const wallet = new Wallet(privateKey);
  const body = JSON.stringify({
    jsonrpc: "2.0",
    method: "dab_accountInfo",
    params: [account],
    id: 1
  });

  const signature = await wallet.signMessage(getBytes(id(body)));

  const response = await fetch(rpcUrl, {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
      "X-Flashbots-Signature": `${wallet.address.toLowerCase()}:${signature}`
    },
    body
  });

  const json = await response.json();
  if (json.error) throw new Error(`${json.error.code}: ${json.error.message}`);
  return json.result as { balance: string; outstanding_charge: string };
}
```

## Recommended Monitoring Workflow

1. Check GasTank balance before submitting transactions.
2. Submit through DA Builder and store the transaction hash.
3. Poll `eth_getTransactionReceipt` with bounded retries.
4. Use `dab_transactionStatus` for richer cost and status data.
5. Alert when GasTank `balance` minus `outstanding_charge` falls below your operating threshold.

## Troubleshooting

| Symptom                 | Likely cause                                    | Recommended action                                                      |
| :---------------------- | :---------------------------------------------- | :---------------------------------------------------------------------- |
| `Account not found`     | GasTank is not funded or deposit is not indexed | Deposit ETH and retry after a couple minutes                            |
| `Insufficient balance.` | GasTank cannot cover expected cost              | Add ETH to GasTank or use direct RPC fallback if the EOA has enough ETH |
| Receipt returns `null`  | Request has not landed yet                      | Continue polling with backoff                                           |
| `Transaction not found` | Transaction hash is wrong or not yet indexed    | Verify the transaction hash and retry                                   |
| Auth failure            | Header signature does not match request body    | Recreate the JSON body string and sign that exact body                  |

## FAQ

### What is the best way to monitor DA Builder in production?

Monitor GasTank balance with `dab_accountInfo`, store every transaction hash, poll receipts with bounded retries, and keep direct RPC fallback.

### Should monitoring code use DA Builder for all Ethereum reads?

No. Use DA Builder for documented monitoring methods. Use a standard Ethereum RPC provider for general Ethereum reads.

## Next Steps

* [Quick Reference](/da-builder/quick-reference) - Method signatures and examples.
* [Cost Structure](/da-builder/cost-structure) - Understand balances and charges.
* [Full Integration Guide](/da-builder/integrate) - Add production fallback.
