Explorer

Get Account

Learn how to get the account of a user using the Okto SDK.

Okto SDK provides the getAccount() method to retrieve details of wallets connected to the current user's Okto account. This includes both embedded wallets created via Okto and external wallets connected by the user (e.g., MetaMask, Phantom).

Available on

Ethereum
Ethereum
Polygon
Polygon
Solana
Solana
Aptos
Aptos
Avalanche
Avalanche
Arbitrum
Arbitrum
BSC
BSC
Fantom
Fantom
Linea
Linea
Metis
Metis
Optimism
Optimism
Base
Base
Base Sepolia
Base Sepolia
HyperEVM Testnet
HyperEVM Testnet
Polygon Amoy
Polygon Amoy

To enable these chains for your application, please configure them in the Okto Dashboard.

Not available on

Example

namespace OktoSDK
{
public class Account : MonoBehaviour
{
    public async Task<List<Wallet>> GetWallets()
    {
        try
        {
            var bffWallets = await BffClientRepository.GetWallets();
            return bffWallets;
        }
        catch (Exception error)
        {
            CustomLogger.LogError($"Failed to retrieve wallets: {error}");
            throw new Exception("Unable to fetch wallet information");
        }
    }
}
}

Note

For error handling:

Method Overview

MethodsDescription
async getAccountGet the account of a user

Get Account

async getAccount() retrieves the list of all wallets associated with the currently authenticated user.

In Okto, an account represents the user's identity in the Okto ecosystem, encompassing both embedded wallets seamlessly created by Okto and external wallets users choose to connect.

Parameters

ParameterTypeDescriptionRequired
oktoClientOktoClientInstance of OktoClient obtained from OktoClient.csYes

Response

Success Response

Field NameTypeDescription
resultTask<List<Wallet>>Returns the list of wallet of the user