# Function: resolveUsername()

```ts
function resolveUsername(
   text, 
   provider, 
   fetcher?
): Promise<ResolvedUsername>;
```

Defined in: [packages/core/src/inbox/names.ts:78](https://github.com/leifriksheim/minca/blob/main/core/src/inbox/names.ts#L78)

Asks a username's domain for its inbox code, and checks the code as any
other (spec 07 §3). The domain must answer itself: a redirect is refused.

## Parameters

| Parameter | Type | Default value |
| ------ | ------ | ------ |
| `text` | `string` | `undefined` |
| `provider` | [`CryptoProvider`](https://minca.dev/api/core/interfaces/CryptoProvider.md) | `undefined` |
| `fetcher?` | (`input`, `init?`) => `Promise`\<`Response`\> | `globalThis.fetch` |

## Returns

`Promise`\<[`ResolvedUsername`](https://minca.dev/api/inbox/interfaces/ResolvedUsername.md)\>

## Throws

When the name isn't one, the domain doesn't know it, or its code doesn't check out
