# Interface: NodeHosting

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

Hosts: carriers the account pays for (spec/06-nodes-and-sessions.md, Hosts)

## Methods

### list()

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

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

The hosts the account uses, each asked how it stands; a host paid since gets the spaces, handed over at most once a minute

#### Returns

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

***

### over()

```ts
over(spaceId): Promise<readonly object[]>;
```

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

The account's hosts that last said a space is over their free line (spec 08 §1.1). Asks no host.

#### Parameters

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

#### Returns

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

***

### pay()

```ts
pay(url, payment): Promise<PayAnswer>;
```

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

Adds to the account's balance at a host: a `checkout` page to open, or a `request` for a wallet

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `url` | `string` |
| `payment` | [`FundPayment`](https://minca.dev/api/core/interfaces/FundPayment.md) |

#### Returns

`Promise`\<[`PayAnswer`](https://minca.dev/api/core/type-aliases/PayAnswer.md)\>

***

### payForSpace()

```ts
payForSpace(
   spaceId, 
   url, 
   payment
): Promise<PayAnswer>;
```

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

Adds to a space's fund at a host it names, once or monthly. Anyone in it may.

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `spaceId` | `string` |
| `url` | `string` |
| `payment` | [`FundPayment`](https://minca.dev/api/core/interfaces/FundPayment.md) |

#### Returns

`Promise`\<[`PayAnswer`](https://minca.dev/api/core/type-aliases/PayAnswer.md)\>

***

### remind()

```ts
remind(url, email): Promise<void>;
```

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

Asks a host for reminders by email before paid time runs out

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `url` | `string` |
| `email` | `string` |

#### Returns

`Promise`\<`void`\>

***

### remindForSpace()

```ts
remindForSpace(
   spaceId, 
   url, 
   email
): Promise<void>;
```

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

Asks a host a space names for reminders by email before the space's paid time runs out

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `spaceId` | `string` |
| `url` | `string` |
| `email` | `string` |

#### Returns

`Promise`\<`void`\>

***

### space()

```ts
space(spaceId): Promise<readonly SpaceHostingView[]>;
```

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

The hosts a space pays (`std.host`), each asked how it stands; one paid gets the pass

#### Parameters

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

#### Returns

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

***

### startBot()

```ts
startBot(
   spaceId, 
   url, 
   bot
): Promise<{
  bot: string;
  status: HostStatus;
}>;
```

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

Asks a host the space names to run a bot there with `role`; removing the bot stops it

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `spaceId` | `string` |
| `url` | `string` |
| `bot` | \{ `name`: `string`; `role?`: `string`; \} |
| `bot.name` | `string` |
| `bot.role?` | `string` |

#### Returns

`Promise`\<\{
  `bot`: `string`;
  `status`: [`HostStatus`](https://minca.dev/api/core/interfaces/HostStatus.md);
\}\>

***

### stop()

```ts
stop(url): Promise<void>;
```

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

Stops using a host: it forgets the spaces. Cancel a renewing card first (`manage`).

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `url` | `string` |

#### Returns

`Promise`\<`void`\>

***

### stopForSpace()

```ts
stopForSpace(spaceId, url): Promise<{
  bots: readonly string[];
  newKey: boolean;
}>;
```

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

Stops a space using a host: its `std.host` record goes, and with `manage` its bots and key

#### Parameters

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

#### Returns

`Promise`\<\{
  `bots`: readonly `string`[];
  `newKey`: `boolean`;
\}\>

***

### use()

```ts
use(url): Promise<HostingView>;
```

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

Starts using a host: reads its description and writes a `sys.hosting` record, with a
subscription key every device signs as. The spaces follow once it is paid.

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `url` | `string` |

#### Returns

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