async function resolveRecipient(input: string): Promise<string> { // If it's already a valid address, return it if (align.blockchain.utils.isValidAddress(input)) { return input; } // Try to resolve as ENS if (input.endsWith(".eth")) { const provider = align.blockchain.providers.getProvider("ethereum"); const resolved = await align.blockchain.utils.resolveName(input, provider); if (resolved) { return resolved; } throw new Error(`Could not resolve ENS: ${input}`); } throw new Error("Invalid address or ENS name");}
ENS resolution only works on Ethereum mainnet. The SDK uses the mainnet
provider regardless of which network you’re transacting on.