# Interface: NodeInbox

Defined in: [packages/core/src/node/types.ts:995](https://github.com/leifriksheim/minca/blob/main/core/src/node/types.ts#L995)

The inbox: how people you share no space with ask to become your contact (`spec/07-inbox.md`)

## Methods

### accept()

```ts
accept(id): Promise<ContactView>;
```

Defined in: [packages/core/src/node/types.ts:1030](https://github.com/leifriksheim/minca/blob/main/core/src/node/types.ts#L1030)

Joins the space for two a knock invites you to, and puts whoever knocked on your list

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `id` | `string` |

#### Returns

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

***

### claim()

```ts
claim(username): Promise<InboxView>;
```

Defined in: [packages/core/src/node/types.ts:1014](https://github.com/leifriksheim/minca/blob/main/core/src/node/types.ts#L1014)

Claims a username (`leif@minca.social`) for your inbox on its domain's
name service, opening the inbox first if need be. The name follows the
inbox: replacing it, or changing its name or mailboxes, points the name at
the new code, and it is renewed before it lapses.

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `username` | `string` |

#### Returns

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

***

### clear()

```ts
clear(): Promise<void>;
```

Defined in: [packages/core/src/node/types.ts:1007](https://github.com/leifriksheim/minca/blob/main/core/src/node/types.ts#L1007)

Clears every knock waiting in your inbox, and keeps it open

#### Returns

`Promise`\<`void`\>

***

### dismiss()

```ts
dismiss(id): Promise<void>;
```

Defined in: [packages/core/src/node/types.ts:1032](https://github.com/leifriksheim/minca/blob/main/core/src/node/types.ts#L1032)

Lets a knock go without blocking whoever knocked

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `id` | `string` |

#### Returns

`Promise`\<`void`\>

***

### get()

```ts
get(): Promise<InboxView | null>;
```

Defined in: [packages/core/src/node/types.ts:997](https://github.com/leifriksheim/minca/blob/main/core/src/node/types.ts#L997)

Your inbox, or null until it is opened

#### Returns

`Promise`\<[`InboxView`](https://minca.dev/api/core/interfaces/InboxView.md) \| `null`\>

***

### knock()

```ts
knock(code, options?): Promise<{
  carried: boolean;
  space: string;
}>;
```

Defined in: [packages/core/src/node/types.ts:1021](https://github.com/leifriksheim/minca/blob/main/core/src/node/types.ts#L1021)

Knocks on someone's inbox, by its code, a link, or a username, with a
space for two; `carried` as for `contacts.ask`

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `code` | `string` |
| `options?` | \{ `note?`: `string`; \} |
| `options.note?` | `string` |

#### Returns

`Promise`\<\{
  `carried`: `boolean`;
  `space`: `string`;
\}\>

***

### knocks()

```ts
knocks(): Promise<readonly KnockView[]>;
```

Defined in: [packages/core/src/node/types.ts:1026](https://github.com/leifriksheim/minca/blob/main/core/src/node/types.ts#L1026)

Knocks waiting in your inbox; also turns your knocks someone joined into contacts

#### Returns

`Promise`\<readonly [`KnockView`](https://minca.dev/api/core/interfaces/KnockView.md)[]\>

***

### open()

```ts
open(options?): Promise<InboxView>;
```

Defined in: [packages/core/src/node/types.ts:1003](https://github.com/leifriksheim/minca/blob/main/core/src/node/types.ts#L1003)

Opens your inbox, or changes its mailboxes (1–3) and the name its code gives. Keeps the
current ones by default; a new inbox waits at up to 3 of this node's relays, under the
account's name.

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `options?` | \{ `name?`: `string`; `places?`: readonly `string`[]; \} |
| `options.name?` | `string` |
| `options.places?` | readonly `string`[] |

#### Returns

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

***

### release()

```ts
release(): Promise<InboxView>;
```

Defined in: [packages/core/src/node/types.ts:1016](https://github.com/leifriksheim/minca/blob/main/core/src/node/types.ts#L1016)

Gives your username up: it leads nowhere, and anyone may claim it

#### Returns

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

***

### rotate()

```ts
rotate(): Promise<InboxView>;
```

Defined in: [packages/core/src/node/types.ts:1005](https://github.com/leifriksheim/minca/blob/main/core/src/node/types.ts#L1005)

Replaces your inbox with the next generation, clearing it first: codes for the old one lead nowhere

#### Returns

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

***

### sent()

```ts
sent(): Promise<readonly SentKnockView[]>;
```

Defined in: [packages/core/src/node/types.ts:1028](https://github.com/leifriksheim/minca/blob/main/core/src/node/types.ts#L1028)

Knocks you left that nobody has joined yet

#### Returns

`Promise`\<readonly [`SentKnockView`](https://minca.dev/api/core/interfaces/SentKnockView.md)[]\>
