Skip to main content

Overview

Wallets are automatically created for users after authentication when embedded wallets are enabled in your Dynamic dashboard. You don’t need to manually create wallets - the SDK handles this for you.

Prerequisites

Automatic wallet creation

When embedded wallets are enabled, wallets are automatically created for users after they authenticate.

Listening for wallet changes

// Get all user wallets
List<BaseWallet> wallets = DynamicSDK.Instance.Wallets.UserWallets;

// Subscribe to wallet changes
DynamicSDK.Instance.Wallets.OnUserWalletsChanged += (wallets) =>
{
    foreach (var wallet in wallets)
    {
        Debug.Log($"{wallet.Chain}: {wallet.Address}");
    }
};

Displaying wallets

using DynamicSDK.Core;
using UnityEngine;
using System.Collections.Generic;

public class WalletDisplay : MonoBehaviour
{
    private void Start()
    {
        DynamicSDK.Instance.Wallets.OnUserWalletsChanged += OnWalletsChanged;
        
        // Check for existing wallets
        DisplayWallets(DynamicSDK.Instance.Wallets.UserWallets);
    }
    
    private void OnWalletsChanged(List<BaseWallet> wallets)
    {
        DisplayWallets(wallets);
    }
    
    private void DisplayWallets(List<BaseWallet> wallets)
    {
        if (wallets.Count == 0)
        {
            Debug.Log("No wallets available");
            return;
        }
        
        foreach (var wallet in wallets)
        {
            Debug.Log($"Wallet: {wallet.Address}");
            Debug.Log($"Chain: {wallet.Chain}");
            Debug.Log($"Name: {wallet.WalletName}");
        }
    }
}

Manual wallet creation

You can also create embedded wallets manually:
// Create EVM wallet without password
await DynamicSDK.Instance.Wallets.Embedded.CreateWallet(EmbeddedWalletChain.Evm);

// Create Solana wallet with password protection
await DynamicSDK.Instance.Wallets.Embedded.CreateWallet(
    EmbeddedWalletChain.Sol,
    password: "user_password"
);

// Create SUI wallet
await DynamicSDK.Instance.Wallets.Embedded.CreateWallet(EmbeddedWalletChain.Sui);

Supported chains

ChainEnum Value
EVMEmbeddedWalletChain.Evm
SolanaEmbeddedWalletChain.Sol
SUIEmbeddedWalletChain.Sui
TONEmbeddedWalletChain.Ton
BitcoinEmbeddedWalletChain.Btc

Wallet properties

Each BaseWallet has the following properties:
BaseWallet wallet = DynamicSDK.Instance.Wallets.UserWallets[0];

// Wallet address
string address = wallet.Address;  // "0x..." for EVM, base58 for Solana

// Chain type
string chain = wallet.Chain;  // "EVM", "SOL", "SUI", etc.

// Wallet name (optional)
string name = wallet.WalletName;  // e.g., "turnkey"

// Wallet ID (for API operations)
string id = wallet.Id;

Get wallet balance

string balance = await DynamicSDK.Instance.Wallets.GetBalance(wallet);
Debug.Log($"Balance: {balance}");

Reveal private key

await DynamicSDK.Instance.UI.RevealEmbeddedWalletPrivateKey();

Multi-chain support

When you have EVM, Solana, and SUI enabled in your dashboard, users can have wallets for all chains:
using DynamicSDK.Core;
using System.Collections.Generic;
using System.Linq;

public class MultiChainWalletManager
{
    public List<BaseWallet> GetEvmWallets()
    {
        return DynamicSDK.Instance.Wallets.UserWallets
            .Where(w => w.Chain.ToUpper() == "EVM")
            .ToList();
    }
    
    public List<BaseWallet> GetSolanaWallets()
    {
        return DynamicSDK.Instance.Wallets.UserWallets
            .Where(w => w.Chain.ToUpper() == "SOL")
            .ToList();
    }
    
    public List<BaseWallet> GetSuiWallets()
    {
        return DynamicSDK.Instance.Wallets.UserWallets
            .Where(w => w.Chain.ToUpper() == "SUI")
            .ToList();
    }
    
    public void DisplayWalletsByChain()
    {
        var evmWallets = GetEvmWallets();
        var solWallets = GetSolanaWallets();
        var suiWallets = GetSuiWallets();
        
        Debug.Log($"EVM Wallets: {evmWallets.Count}");
        Debug.Log($"Solana Wallets: {solWallets.Count}");
        Debug.Log($"SUI Wallets: {suiWallets.Count}");
    }
}

Next steps

After wallets are created, you can: