# wallet_listAccounts

> For the complete documentation index, see [llms.txt](/docs/llms.txt).

POST https://api.g.alchemy.com/v2/{apiKey}

This method is used to list all smart accounts for a given signer.

Reference: https://www.alchemy.com/docs/wallets/api-reference/smart-wallets/wallet-api-endpoints/wallet-list-accounts

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| params[0] | object | Yes |  |

## Result

**listAccountsResponse** (object)

## Example

### Request

```json
{
  "jsonrpc": "2.0",
  "method": "wallet_listAccounts",
  "params": [
    {
      "signerAddress": "0x6275B53E98D07c729108A177207634eA22F5A748"
    }
  ],
  "id": 1
}
```

### Response

```json
{
  "jsonrpc": "2.0",
  "result": {
    "accounts": [
      {
        "accountAddress": "0xafdABa1E09e82F780721963eba39bA9e6d9FE4d2",
        "id": "3d8b3315-4aa1-4c67-8c82-20221e8dbf16"
      }
    ],
    "meta": {
      "totalCount": 1,
      "after": null
    }
  },
  "id": 1
}
```

## Code Examples

### cURL

```bash
curl --request POST \
  --url https://api.g.alchemy.com/v2/docs-demo \
  --header 'Content-Type: application/json' \
  --data '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "wallet_listAccounts",
  "params": [
    {
      "signerAddress": "0x6275B53E98D07c729108A177207634eA22F5A748"
    }
  ]
}'
```

### JavaScript

```javascript
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: JSON.stringify({
    jsonrpc: '2.0',
    id: 1,
    method: 'wallet_listAccounts',
    params: [{signerAddress: '0x6275B53E98D07c729108A177207634eA22F5A748'}]
  })
};

fetch('https://api.g.alchemy.com/v2/docs-demo', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.g.alchemy.com/v2/docs-demo"

payload = {
    "jsonrpc": "2.0",
    "id": 1,
    "method": "wallet_listAccounts",
    "params": [{ "signerAddress": "0x6275B53E98D07c729108A177207634eA22F5A748" }]
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

### Go

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.g.alchemy.com/v2/docs-demo"

	payload := strings.NewReader("{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"wallet_listAccounts\",\n  \"params\": [\n    {\n      \"signerAddress\": \"0x6275B53E98D07c729108A177207634eA22F5A748\"\n    }\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
```

### Java

```java
HttpResponse<String> response = Unirest.post("https://api.g.alchemy.com/v2/docs-demo")
  .header("Content-Type", "application/json")
  .body("{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"wallet_listAccounts\",\n  \"params\": [\n    {\n      \"signerAddress\": \"0x6275B53E98D07c729108A177207634eA22F5A748\"\n    }\n  ]\n}")
  .asString();
```

### C#

```csharp
using RestSharp;


var options = new RestClientOptions("https://api.g.alchemy.com/v2/docs-demo");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddJsonBody("{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"wallet_listAccounts\",\n  \"params\": [\n    {\n      \"signerAddress\": \"0x6275B53E98D07c729108A177207634eA22F5A748\"\n    }\n  ]\n}", false);
var response = await client.PostAsync(request);

Console.WriteLine("{0}", response.Content);

```


## OpenRPC Method Specification

```yaml
name: wallet_listAccounts
description: This method is used to list all smart accounts for a given signer.
params:
  - name: params[0]
    required: true
    schema:
      type: object
      required:
        - signerAddress
      properties:
        signerAddress:
          type: string
          pattern: ^0x.*$
          errorMessage: Must be a valid Ethereum address starting with '0x' (e.g., '0xa363219d7C0b8673df17529D469Db9eFF0f35D2A')
        limit:
          type: number
          minimum: 1
          maximum: 100
          default: 100
        after:
          type: string
          format: base64url
result:
  name: listAccountsResponse
  schema:
    type: object
    required:
      - accounts
      - meta
    properties:
      accounts:
        type: array
        items:
          type: object
          required:
            - accountAddress
            - id
          properties:
            accountAddress:
              type: string
              pattern: ^0x.*$
              errorMessage: Must be a valid Ethereum address starting with '0x' (e.g., '0xa363219d7C0b8673df17529D469Db9eFF0f35D2A')
            id:
              type: string
              format: uuid
              errorMessage: Must be a valid UUID v4 string (e.g., '3061cc5f-1f96-48a9-ab45-41faad2dd23b')
      meta:
        type: object
        required:
          - totalCount
          - after
        properties:
          totalCount:
            type: integer
          after:
            anyOf:
              - type: string
                format: base64url
              - type: 'null'
examples:
  - name: wallet_listAccounts example
    params:
      - name: param0
        value:
          signerAddress: '0x6275B53E98D07c729108A177207634eA22F5A748'
    result:
      name: Response
      value:
        accounts:
          - accountAddress: '0xafdABa1E09e82F780721963eba39bA9e6d9FE4d2'
            id: 3d8b3315-4aa1-4c67-8c82-20221e8dbf16
        meta:
          totalCount: 1
          after: null
```
