# starbases/actions
Documentation: 0.7.0 (source: v0.7.0).

Markdown source of https://docs-v0-7-0.atlas-kit-docs.pages.dev/reference/starbases/actions/ — see https://docs-v0-7-0.atlas-kit-docs.pages.dev/ai/ for the full machine-readable surface.

## Interfaces

<a id="plandestroystarbaseplayeroptions"></a>

### PlanDestroyStarbasePlayerOptions

Defined in: [packages/sage/src/starbases/actions/index.ts:95](https://github.com/Aephia/atlas-kit/blob/v0.7.0/packages/sage/src/starbases/actions/index.ts#L95)

Address-only stale StarbasePlayer recovery input.

The funder is the sole required signer, pays any rent the recovered account
grows by and receives any surplus rent. It must stay rent-exempt afterwards.

#### Example

```ts
declare const funder: Address;
const options: PlanDestroyStarbasePlayerOptions = { funder };
```

#### Properties

<a id="funder"></a>

##### funder

```ts
readonly funder: Address;
```

Defined in: [packages/sage/src/starbases/actions/index.ts:96](https://github.com/Aephia/atlas-kit/blob/v0.7.0/packages/sage/src/starbases/actions/index.ts#L96)

***

<a id="planregisterstarbaseplayeroptions"></a>

### PlanRegisterStarbasePlayerOptions

Defined in: [packages/sage/src/starbases/actions/index.ts:80](https://github.com/Aephia/atlas-kit/blob/v0.7.0/packages/sage/src/starbases/actions/index.ts#L80)

Address-only StarbasePlayer registration input.

The funder is the sole required signer and pays account rent. Reusing the
later assembly fee payer is convenient, but the planner does not require the
two addresses to match.

#### Example

```ts
declare const funder: Address;
const options: PlanRegisterStarbasePlayerOptions = { funder };
```

#### Properties

<a id="funder-1"></a>

##### funder

```ts
readonly funder: Address;
```

Defined in: [packages/sage/src/starbases/actions/index.ts:81](https://github.com/Aephia/atlas-kit/blob/v0.7.0/packages/sage/src/starbases/actions/index.ts#L81)

## Functions

<a id="plandestroystarbaseplayer"></a>

### planDestroyStarbasePlayer()

```ts
function planDestroyStarbasePlayer(
   ctx, 
   player, 
   system, 
input): Promise<Plan>;
```

Defined in: [packages/sage/src/starbases/actions/index.ts:495](https://github.com/Aephia/atlas-kit/blob/v0.7.0/packages/sage/src/starbases/actions/index.ts#L495)

Plans recovery of one StarbasePlayer left on an older Starbase generation.

Destroying a Starbase at Level 1 or below hands it to the attacker and advances
its Star System's sequence, and every StarbasePlayer on the old sequence is
refused until it is recovered. A higher-level Starbase only loses a level.
Recovery cannot be undone: crew and ships move to their respawn queues,
respawn-protected cargo moves to the cargo respawn queue, all other cargo is
lost, and the account joins the current generation. Any funder may sign,
including one the Profile does not know, and keeps any surplus rent. Recover the StarbasePlayer before
respawning a Claim Stake or Crafting Hab in the same System, which the
program otherwise refuses.

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `ctx` | [`SageContext`](/reference/#sagecontext) |
| `player` | `StarbasePlayerSnapshot` |
| `system` | `StarSystemSnapshot` |
| `input` | [`PlanDestroyStarbasePlayerOptions`](/reference/starbases/actions/#plandestroystarbaseplayeroptions) |

#### Returns

`Promise`\<[`Plan`](/reference/planning/#plan)\>

#### Example

```ts
declare const ctx: SageContext;
declare const player: StarbasePlayerSnapshot;
declare const system: StarSystemSnapshot;
declare const funder: Address;
const plan = await planDestroyStarbasePlayer(ctx, player, system, {
  funder,
});
console.log(plan.describe());
```

***

<a id="planregisterstarbaseplayer"></a>

### planRegisterStarbasePlayer()

```ts
function planRegisterStarbasePlayer(
   ctx, 
   character, 
   system, 
input): Promise<Plan>;
```

Defined in: [packages/sage/src/starbases/actions/index.ts:162](https://github.com/Aephia/atlas-kit/blob/v0.7.0/packages/sage/src/starbases/actions/index.ts#L162)

Plans one StarbasePlayer registration without signing, assembly, or writes.

The Character and Star System must already be loaded public snapshots. The
planner derives and directly validates every plumbing account and returns a
Plan only when the canonical StarbasePlayer address is absent. The Starbase
FactionOwnership sidecar is always passed by address; when it is
uninitialized the chain admits by the legacy Starbase owner, and the Plan
guards that it stays unallocated. Optional faction
expansion accounts use the generated omitted-account convention.

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `ctx` | [`SageContext`](/reference/#sagecontext) |
| `character` | `CharacterSnapshot` |
| `system` | `StarSystemSnapshot` |
| `input` | [`PlanRegisterStarbasePlayerOptions`](/reference/starbases/actions/#planregisterstarbaseplayeroptions) |

#### Returns

`Promise`\<[`Plan`](/reference/planning/#plan)\>

#### Example

```ts
declare const ctx: SageContext;
declare const character: CharacterSnapshot;
declare const system: StarSystemSnapshot;
declare const funder: Address;
const plan = await planRegisterStarbasePlayer(
  ctx,
  character,
  system,
  { funder },
);
console.log(plan.describe());
```
