> For the complete documentation index, see [llms.txt](https://xerial.gitbook.io/xerial-doc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://xerial.gitbook.io/xerial-doc/gaming-toolkit/xerial-unity-sdk-guide/xerial-services/service-managers/wallet-manager/userdata-class/creating-userdata-class.md).

# 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);
    }
}
```
