# Interface: NodeContacts

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

The account's contacts: each a private space for two, listed in the contacts space

## Methods

### accept()

```ts
accept(spaceId, requestKey): Promise<ContactView>;
```

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

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

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `spaceId` | `string` |
| `requestKey` | `string` |

#### Returns

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

***

### ask()

```ts
ask(
   spaceId, 
   did, 
   options?
): Promise<{
  carried: boolean;
  request: string;
  space: string;
}>;
```

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

Asks someone in a shared space to add you: a space for two, its invite sealed
to them as a `std.contact-request`. `carried`: whether a carrier held it first.

#### Parameters

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

#### Returns

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

***

### block()

```ts
block(did): Promise<void>;
```

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

Leaves your space for two, and hides their knocks from now on

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `did` | `string` |

#### Returns

`Promise`\<`void`\>

***

### get()

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

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

One person on the list, or null

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `did` | `string` |

#### Returns

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

***

### invite()

```ts
invite(
   did, 
   spaceId, 
   options?
): Promise<void>;
```

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

Invites a contact into one of your spaces: an invite for `role` (as
`spaces.invite` makes one), left in your space for two with them. Only a
contact who has joined that space can be invited.

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `did` | `string` |
| `spaceId` | `string` |
| `options?` | \{ `role?`: `string`; \} |
| `options.role?` | `string` |

#### Returns

`Promise`\<`void`\>

***

### invites()

```ts
invites(): Promise<readonly SpaceInviteView[]>;
```

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

Invites your contacts left for you, to spaces you don't hold yet, newest
first. Also closes invites of yours a contact has used, and deletes them.

#### Returns

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

***

### join()

```ts
join(pairSpace, key): Promise<SpaceSummary>;
```

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

Joins the space an invite from a contact is for; its maker closes the invite once they see you there

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `pairSpace` | `string` |
| `key` | `string` |

#### Returns

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

***

### list()

```ts
list(): Promise<readonly ContactView[]>;
```

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

Everyone in the list, blocked people too, by name

#### Returns

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

***

### others()

```ts
others(did): Promise<readonly string[]>;
```

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

Accounts in your space for two besides the two of you

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `did` | `string` |

#### Returns

`Promise`\<readonly `string`[]\>

***

### put()

```ts
put(contact): Promise<ContactView>;
```

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

Adds someone, or changes what the list says about them

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `contact` | \{ `did`: `string`; `name`: `string`; `note?`: `string`; `space?`: `string` \| `null`; \} |
| `contact.did` | `string` |
| `contact.name` | `string` |
| `contact.note?` | `string` |
| `contact.space?` | `string` \| `null` |

#### Returns

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

***

### remove()

```ts
remove(did): Promise<void>;
```

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

Takes them off the list and leaves your space for two. Nobody else's space is touched.

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `did` | `string` |

#### Returns

`Promise`\<`void`\>

***

### requests()

```ts
requests(spaceId): Promise<readonly ContactRequest[]>;
```

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

Knocks left for this account in a space, except blocked and accepted ones

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `spaceId` | `string` |

#### Returns

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

***

### space()

```ts
space(): Promise<string | null>;
```

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

The contacts space's id, or null for a node not given it

#### Returns

`Promise`\<`string` \| `null`\>
