Skip to main content
The ledgerApi method lets your dApp read ledger state on behalf of the connected user. It forwards a Canton JSON Ledger API request through Walley’s authenticated, read-only proxy and returns the upstream response. This implements the CIP-0103 ledgerApi provider method. Unlike prepareExecute, ledgerApi does not open a popup and does not submit transactions — it’s a read path that runs against the user’s existing session token.

Making a request

Parameters

Result

The response is the raw upstream body as a string. Parse it with JSON.parse for JSON endpoints.

Example with a body

Authentication & tokens

The proxy authenticates with the short-lived access token issued when the user connected. You don’t manage the token directly — the SDK attaches it automatically — but you do need to handle expiry.
Access tokens are short-lived. When a token has expired, a ledgerApi call throws providerErrors.unauthorized. Recover by calling connect again to refresh the session, then retry the request.

Errors

When to use it