# Creating UserData Class

```csharp
using System.Collections.Generic;
using Xerial;

public class DeserializeUserData
{
  public UserData ProcessJsonResponse(string jsonResponse)
  {
      // Method implementation
  }
}
```

## Deserializing Account Data

To deserialize the account data from the JSON response, we first retrieve the relevant node from the JSON data and then create an instance of the `Account` class. Here's how it's done:

#### Explanation

We extract the `"user"` object from the JSON data and create a new instance of the `Account` class. We then assign the values of the `"identifier"` and `"id"` properties to the corresponding properties of the `Account` instance.

#### Example

```csharp
// Process the "user" object
JSONNode userNode = jsonNode["user"];
Account user = new Account
{
    identifier = userNode["identifier"],
    id = userNode["id"]
};
```

### Deserializing Wallet Data

To deserialize the wallet data from the JSON response, we iterate through the `"wallets"` array, create `Wallet` instances for each object, and collect them in a list. Here's how it's done:

#### Explanation

We iterate through the `"wallets"` array in the JSON data. For each object in the array, we create a new `Wallet` instance and assign its properties by extracting values from the corresponding JSON properties. We then add each `Wallet` instance to a list.

#### Example

```csharp
List<Wallet> walletList = new List<Wallet>();

// Process the "wallets" array
JSONArray walletsArray = jsonNode["wallets"].AsArray;
if (walletsArray != null)
{
    foreach (JSONNode walletNode in walletsArray)
    {
        Wallet wallet = new Wallet
        {
            user = walletNode["user"],
            address = walletNode["address"],         
            smartAccount = walletNode["smartAccount"],
            custodial = walletNode["custodial"].AsBool,
            id = walletNode["id"]
        };
        walletList.Add(wallet);
    }
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://xerial.gitbook.io/xerial-doc/gaming-toolkit/xerial-unity-sdk-guide/xerial-services/service-managers/wallet-manager/userdata-class/creating-userdata-class.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
