Skip to main content
In your application, when a user is logged in, you’ll want to request delegation for your application.
Make sure you have configured delegated access in the dashboard before triggering delegation.

Dynamic’s UI

Auto-prompt user on sign in

If you chose to prompt the user on sign in during the configuration step, the user is prompted to approve delegation for your application when they next sign in.

Trigger delegation manually

You can use the InitDelegationProcess method to open the delegation modal UI:
// Open the delegation modal for all eligible wallets
await DynamicSDK.Instance.Wallets.InitDelegationProcess();

// Or specify which wallets to delegate
await DynamicSDK.Instance.Wallets.InitDelegationProcess(
    walletIds: new List<string> { "wallet-id-1", "wallet-id-2" }
);

Check if user should be prompted

Before prompting, you can check whether the user should see a delegation prompt:
bool shouldPrompt = await DynamicSDK.Instance.Wallets.ShouldPromptWalletDelegation();

if (shouldPrompt)
{
    await DynamicSDK.Instance.Wallets.InitDelegationProcess();
}

Your own UI

You can use DelegateKeyShares to delegate wallets programmatically without showing any Dynamic UI:
using DynamicSDK.Core;
using System.Collections.Generic;

// Delegate all eligible wallets
await DynamicSDK.Instance.Wallets.Waas.Delegation.DelegateKeyShares();

// Or delegate specific wallets
await DynamicSDK.Instance.Wallets.Waas.Delegation.DelegateKeyShares(
    new List<DelegationWalletIdentifier>
    {
        new()
        {
            ChainName = ChainEnum.Evm,
            AccountAddress = "0x123...",
        },
        new()
        {
            ChainName = ChainEnum.Sol,
            AccountAddress = "ABC123...",
        },
    }
);

Check wallet delegation status

// Check if wallet is eligible for delegation
bool eligible = DynamicSDK.Instance.Wallets.Waas.Delegation.IsWalletEligibleForDelegation(wallet);

// Get status for a specific wallet
var status = DynamicSDK.Instance.Wallets.Waas.Delegation.GetDelegationStatusForWallet(wallet.Id);
Debug.Log($"Status: {status}"); // delegated, pending, or denied

Dismiss or deny delegation

// Dismiss the prompt for the current session only (resets on logout/restart)
await DynamicSDK.Instance.Wallets.Waas.Delegation.DismissDelegationPrompt();

// Or dismiss for a specific wallet
await DynamicSDK.Instance.Wallets.Waas.Delegation.DismissDelegationPrompt(walletId: "wallet-id");

What's next?

Learn how to properly receive the delegation materials on your server