- Delegation is blockchain-specific.
- Authorizing a delegate on one blockchain does not grant them access on other blockchains.
- An authorized delegate can call
spendwithsourceAccountset to your address so funds are drawn from your Unified Balance.
Prerequisites
Before you begin, ensure that you’ve: These are required so any example below runs with a validkit and adapter.
Check delegate status
The following example reads delegate status for an address.TypeScript
getDelegateStatus resolves to 'none' when no delegate is set, 'pending'
while delegation is still confirming, and 'ready' when the delegate is active
and authorized to spend.
Poll until ready
UsegetDelegateStatus in a poll loop to wait until the delegate is active
before spending. Confirmation time varies by blockchain. For example, on
Ethereum, Base, and Arbitrum it can take up to 15 minutes, while on Arc and
Avalanche it is near-instant. If the delegate was added well before the spend,
getDelegateStatus returns 'ready' immediately and no polling is needed.
This example polls until the delegate is ready before spending:
TypeScript
Add a delegate
The following example authorizes a delegate to spend from a Unified Balance on Base Sepolia.TypeScript
addDelegate for each blockchain.
Remove a delegate
This example removes a delegate from a Unified Balance on Base Sepolia:TypeScript