# Account abstraction transaction relay

Source: https://docs.settlemint.com/docs/developers/developer-guides/api-integration/bundler
Discover the active ERC-4337 chain and EntryPoint through DALP's account abstraction JSON-RPC endpoint.



DALP exposes `POST /api/v2/bundler` as an ERC-4337-style JSON-RPC discovery surface. Wallets and SDKs call it to read the active chain ID or EntryPoint address before they build account abstraction flows. DALP does not expose UserOperation submission, gas estimation, lookup, or receipt retrieval through this endpoint.

For the concept model, see [Bundlers](/docs/architects/architecture/concepts/bundlers), [UserOperations](/docs/architects/architecture/concepts/user-operations), and [Account abstraction model](/docs/architects/architecture/concepts/account-abstraction). For paymaster deposits, sponsorship settings, and signer-key rotation, see [System paymasters](/docs/developers/developer-guides/api-integration/system-paymasters) and [Paymasters and gas sponsorship](/docs/architects/architecture/concepts/paymasters-and-gas-sponsorship). For the broader REST API, see [API reference](/docs/developers/developer-guides/api-integration/api-reference).

## Before you call [#before-you-call]

You need the DALP API base URL for the environment you are integrating with. The endpoint reads the active chain from platform configuration and resolves the EntryPoint from the indexed Directory registration for that network.

Send requests as JSON-RPC 2.0 objects with `Content-Type: application/json`. Use an `id` when the caller needs a response body. Requests without `id` are JSON-RPC notifications and return `204 No Content`.

## Endpoint [#endpoint]

| Endpoint               | Protocol     | Content type       | Use it for                                         |
| ---------------------- | ------------ | ------------------ | -------------------------------------------------- |
| `POST /api/v2/bundler` | JSON-RPC 2.0 | `application/json` | Discover the active chain and ERC-4337 EntryPoint. |

## Quickstart [#quickstart]

Call `eth_supportedEntryPoints` first when an integration needs the EntryPoint for the active network:

```bash
curl --request POST \
  "$DALP_API_URL/api/v2/bundler" \
  --header "Content-Type: application/json" \
  --data '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "eth_supportedEntryPoints",
    "params": []
  }'
```

Example response:

```json
{
  "jsonrpc": "2.0",
  "result": ["0x1111111111111111111111111111111111111111"],
  "id": 1
}
```

A successful response echoes the same `id` and places the EntryPoint list in `result`.

## Supported methods [#supported-methods]

| Method                     | Parameters | Result type   | Use it for                                              |
| -------------------------- | ---------- | ------------- | ------------------------------------------------------- |
| `eth_chainId`              | none       | hex string    | Read the active network chain ID.                       |
| `eth_supportedEntryPoints` | none       | address array | Read the ERC-4337 EntryPoint supported by the platform. |

### `eth_chainId` [#eth_chainid]

Returns the active chain ID as a hexadecimal string, matching the Ethereum JSON-RPC convention used by wallets.

```bash
curl --request POST \
  "$DALP_API_URL/api/v2/bundler" \
  --header "Content-Type: application/json" \
  --data '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "eth_chainId",
    "params": []
  }'
```

Example response:

```json
{
  "jsonrpc": "2.0",
  "result": "0x89",
  "id": 1
}
```

### `eth_supportedEntryPoints` [#eth_supportedentrypoints]

Returns the EntryPoint address DALP resolves for the active network. The response is an array so ERC-4337 clients can consume it through the standard bundler method shape.

```bash
curl --request POST \
  "$DALP_API_URL/api/v2/bundler" \
  --header "Content-Type: application/json" \
  --data '{
    "jsonrpc": "2.0",
    "id": 2,
    "method": "eth_supportedEntryPoints",
    "params": []
  }'
```

Example response:

```json
{
  "jsonrpc": "2.0",
  "result": ["0x1111111111111111111111111111111111111111"],
  "id": 2
}
```

If the network Directory contract is not configured, or if the EntryPoint registration has not been indexed yet, the endpoint returns a JSON-RPC error response. Retry after the network configuration is complete and indexing has caught up.

## UserOperation methods [#useroperation-methods]

The endpoint recognizes JSON-RPC method names through the standard dispatcher. UserOperation submission and lookup methods are not available from this API surface. Requests with an `id` return `method not found`. Requests without `id` are JSON-RPC notifications, so DALP returns `204 No Content` without an error body.

| Method                         | Response with `id` |
| ------------------------------ | ------------------ |
| `eth_sendUserOperation`        | Method not found   |
| `eth_estimateUserOperationGas` | Method not found   |
| `eth_getUserOperationByHash`   | Method not found   |
| `eth_getUserOperationReceipt`  | Method not found   |

Example response for a request with `id`:

```json
{
  "jsonrpc": "2.0",
  "error": {
    "code": -32601,
    "message": "Method not found: eth_sendUserOperation. See ERC-4337 bundler documentation for supported methods."
  },
  "id": 3
}
```

## Error responses [#error-responses]

The endpoint returns JSON-RPC error envelopes with HTTP 200 for parse, validation, and method errors, so bundler clients can handle failures through JSON-RPC semantics.

| Code     | Meaning          | When it appears                                                                                 |
| -------- | ---------------- | ----------------------------------------------------------------------------------------------- |
| `-32700` | Parse error      | The request body is not valid JSON.                                                             |
| `-32600` | Invalid request  | The request is not a JSON-RPC 2.0 object, has no string `method`, or uses an invalid `id` type. |
| `-32601` | Method not found | The requested method is not supported by this endpoint.                                         |
| `404`    | Not found        | The EntryPoint has not been indexed for the active network.                                     |
| `503`    | Unavailable      | The network Directory contract is not configured for EntryPoint discovery.                      |
| `-32603` | Internal error   | A supported method failed without a more specific JSON-RPC or DALP status code.                 |

Validation and method-resolution errors use this shape:

```json
{
  "jsonrpc": "2.0",
  "error": {
    "code": -32600,
    "message": "Invalid JSON-RPC request",
    "data": {
      "dapiError": {
        "id": "DALP-0085",
        "category": "client",
        "status": 400,
        "retryable": false,
        "message": "Invalid JSON-RPC request",
        "why": "The JSON-RPC request is missing required fields or uses an unsupported shape.",
        "fix": "Send a valid JSON-RPC 2.0 request with the required method, id, and params fields."
      }
    }
  },
  "id": 1
}
```

For invalid JSON, DALP cannot read a request `id`, so the response uses `id: null`. Unsupported method responses use the JSON-RPC error envelope without `data.dapiError` because the method dispatcher can return a specific method-not-found message directly.

## Integration notes [#integration-notes]

* Send `params` as an array. The supported methods do not require parameters, so `[]` is sufficient.
* Use request IDs when the caller needs a response. Omit `id` only for fire-and-forget JSON-RPC notifications.
* Treat the returned EntryPoint as network-specific. Private and local networks can return an EntryPoint address registered for that environment instead of a hardcoded canonical address.
* Retry EntryPoint discovery only after the Directory contract is configured and the indexer has processed the registration. A `503` means the Directory address is not configured. A `404` means DALP could not read an indexed EntryPoint for the active network.
* Use the REST paymaster endpoints for funding and sponsorship operations; this JSON-RPC endpoint is for bundler-compatible discovery.
