---
title: "2. Gateway SDK: Reading Ledger State"
url: "https://radix.wiki/developers/frontend/02-gateway-sdk"
version: "1.3.0"
updated: 2026-08-08
last_verified: 2026-08-08
license: CC-BY-4.0
license_url: "https://creativecommons.org/licenses/by/4.0/"
---

# 2. Gateway SDK: Reading Ledger State

|  |  |
| --- | --- |
| NPM | [@radixdlt/babylon-gateway-api-sdk](https://www.npmjs.com/package/@radixdlt/babylon-gateway-api-sdk) |

## Overview

The Gateway SDK is a TypeScript client for the [Radix Gateway API](/developers/infrastructure/02-radix-apis). It lets you query account balances, read component state, look up transaction history, and submit transactions – all the read/write operations your dApp frontend needs.

```bash
npm install @radixdlt/babylon-gateway-api-sdk
```

## Setup

```typescript
import { GatewayApiClient, RadixNetwork } from '@radixdlt/babylon-gateway-api-sdk'

const gatewayApi = GatewayApiClient.initialize({
  networkId: RadixNetwork.Mainnet,  // or RadixNetwork.Stokenet
  applicationName: 'My dApp',
  applicationVersion: '1.0.0',
  applicationDappDefinitionAddress: 'account_rdx...'
})
```

The SDK connects to the [Radix Foundation](/ecosystem/radix-foundation)'s public Gateway by default. For production dApps with high traffic, consider running your own [Gateway node](/developers/infrastructure/02-radix-apis) or using a third-party provider.

## Common Queries

### Account Balances

```typescript
const details = await gatewayApi.state.getEntityDetailsVaultAggregated(
  'account_rdx1c956...'  // account address
)
// details.fungible_resources — token balances
// details.non_fungible_resources — NFT holdings
```

### Component State

```typescript
const component = await gatewayApi.state.getEntityDetailsVaultAggregated(
  'component_rdx1cp...'  // component address
)
// Read state, vaults, metadata
```

### Entity Metadata

```typescript
const metadata = await gatewayApi.state.getAllEntityMetadata(
  'resource_rdx1t...'  // any entity address
)
// Returns: name, symbol, description, icon_url, etc.
```

### Transaction Status

```typescript
const status = await gatewayApi.transaction.getStatus(
  'txid_rdx1...'  // intent hash from sendTransaction
)
// status.intent_status: "CommittedSuccess" | "CommittedFailure" | "Pending" | ...
```

### Historical State

Query state at a specific point in time by passing `at_ledger_state`:

```typescript
const historicalDetails = await gatewayApi.state.innerClient.stateEntityDetails({
  stateEntityDetailsRequest: {
    addresses: ['account_rdx1...']
    at_ledger_state: { state_version: 12345678 }
  }
})
```

## Maintenance Status (checked August 2026)

The SDK and the service it talks to are on different clocks, and it is worth knowing which is which. [The client library](https://www.npmjs.com/package/@radixdlt/babylon-gateway-api-sdk) has been at **1.10.1** since March 2025 — it is a generated client over a stable API, so age here mostly means the API has not changed underneath it. The [Gateway service](https://github.com/radixdlt/babylon-gateway) is more recent but also slowing: release **v1.10.6** on 7 April 2026, and a final documentation-only commit on 20 May 2026. As of 7 August 2026 the Gateway is [maintained on a volunteer basis with bug fixes only](https://t.me/RadixDevelopers/65908), alongside the [dApp Toolkit](/developers/frontend/01-radix-dapp-toolkit) and the [Radix Wallet](/contents/tech/core-protocols/radix-wallet).

The practical consequence is about hosting rather than code. The public Gateway this SDK defaults to is [Foundation](/ecosystem/radix-foundation)-operated infrastructure now in maintenance mode, and it sits at the top of the [Accountability Council](/ecosystem/radix-accountability-council)'s inventory of services a community DAO would need to take over. If your dApp cannot tolerate that dependency, run your own Gateway or use a third-party provider — see [Radix APIs](/developers/infrastructure/02-radix-apis).

## Next Steps

- [ROLA Authentication](/developers/frontend/03-rola-authentication) – prove server-side that a user really controls the account they claim

## External Links

- [@radixdlt/babylon-gateway-api-sdk on npm](https://www.npmjs.com/package/@radixdlt/babylon-gateway-api-sdk)
- [Gateway API reference](https://docs.radixdlt.com/api-reference/gateway-api-specs.html)
- [Mainnet Gateway Swagger UI](https://mainnet.radixdlt.com/swagger/)
