@aephia/atlas-kit 0.8.0-next.3 → 0.8.0-next.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/claim-stakes/actions/index.d.ts +153 -0
- package/dist/claim-stakes/actions/index.d.ts.map +1 -1
- package/dist/claim-stakes/actions/index.js +560 -72
- package/dist/claim-stakes/actions/index.js.map +1 -1
- package/dist/claim-stakes/index.d.ts +1 -1
- package/dist/claim-stakes/index.d.ts.map +1 -1
- package/dist/claim-stakes/index.js +1 -1
- package/dist/claim-stakes/index.js.map +1 -1
- package/dist/client/contracts.d.ts +1 -1
- package/dist/client/contracts.d.ts.map +1 -1
- package/dist/client/deployments.d.ts +1 -1
- package/dist/client/deployments.js +1 -1
- package/dist/client/errors.d.ts +1 -1
- package/dist/client/errors.d.ts.map +1 -1
- package/dist/client/errors.js.map +1 -1
- package/dist/combat/actions/index.d.ts +137 -0
- package/dist/combat/actions/index.d.ts.map +1 -1
- package/dist/combat/actions/index.js +602 -1
- package/dist/combat/actions/index.js.map +1 -1
- package/dist/crafting/actions/habs.d.ts +366 -0
- package/dist/crafting/actions/habs.d.ts.map +1 -0
- package/dist/crafting/actions/habs.js +1030 -0
- package/dist/crafting/actions/habs.js.map +1 -0
- package/dist/crafting/actions/index.d.ts +22 -9
- package/dist/crafting/actions/index.d.ts.map +1 -1
- package/dist/crafting/actions/index.js +68 -20
- package/dist/crafting/actions/index.js.map +1 -1
- package/dist/crafting/index.d.ts +22 -3
- package/dist/crafting/index.d.ts.map +1 -1
- package/dist/crafting/index.js +6 -2
- package/dist/crafting/index.js.map +1 -1
- package/dist/fleets/actions/index.d.ts +10 -8
- package/dist/fleets/actions/index.d.ts.map +1 -1
- package/dist/fleets/actions/index.js +15 -13
- package/dist/fleets/actions/index.js.map +1 -1
- package/dist/identity/actions/daily-check-in.d.ts +57 -0
- package/dist/identity/actions/daily-check-in.d.ts.map +1 -0
- package/dist/identity/actions/daily-check-in.js +200 -0
- package/dist/identity/actions/daily-check-in.js.map +1 -0
- package/dist/identity/actions/index.d.ts +1 -0
- package/dist/identity/actions/index.d.ts.map +1 -1
- package/dist/identity/actions/index.js +1 -0
- package/dist/identity/actions/index.js.map +1 -1
- package/dist/identity/index.d.ts +169 -17
- package/dist/identity/index.d.ts.map +1 -1
- package/dist/identity/index.js +142 -9
- package/dist/identity/index.js.map +1 -1
- package/dist/internal/c4/career-xp.d.ts +113 -26
- package/dist/internal/c4/career-xp.d.ts.map +1 -1
- package/dist/internal/c4/career-xp.js +101 -38
- package/dist/internal/c4/career-xp.js.map +1 -1
- package/dist/internal/c4/character-registration.d.ts.map +1 -1
- package/dist/internal/c4/character-registration.js +3 -0
- package/dist/internal/c4/character-registration.js.map +1 -1
- package/dist/internal/c4/character.d.ts +68 -0
- package/dist/internal/c4/character.d.ts.map +1 -1
- package/dist/internal/c4/character.js +46 -2
- package/dist/internal/c4/character.js.map +1 -1
- package/dist/internal/c4/claim-stake.d.ts +8 -1
- package/dist/internal/c4/claim-stake.d.ts.map +1 -1
- package/dist/internal/c4/claim-stake.js +28 -1
- package/dist/internal/c4/claim-stake.js.map +1 -1
- package/dist/internal/c4/combat-storage.d.ts +4 -0
- package/dist/internal/c4/combat-storage.d.ts.map +1 -1
- package/dist/internal/c4/combat-storage.js +6 -1
- package/dist/internal/c4/combat-storage.js.map +1 -1
- package/dist/internal/c4/crafting-hab-storage.d.ts +38 -0
- package/dist/internal/c4/crafting-hab-storage.d.ts.map +1 -0
- package/dist/internal/c4/crafting-hab-storage.js +164 -0
- package/dist/internal/c4/crafting-hab-storage.js.map +1 -0
- package/dist/internal/c4/crafting.d.ts +11 -1
- package/dist/internal/c4/crafting.d.ts.map +1 -1
- package/dist/internal/c4/crafting.js +5 -0
- package/dist/internal/c4/crafting.js.map +1 -1
- package/dist/internal/c4/discriminators.d.ts +39 -0
- package/dist/internal/c4/discriminators.d.ts.map +1 -1
- package/dist/internal/c4/discriminators.js +79 -1
- package/dist/internal/c4/discriminators.js.map +1 -1
- package/dist/internal/c4/fleet-storage.d.ts +2 -1
- package/dist/internal/c4/fleet-storage.d.ts.map +1 -1
- package/dist/internal/c4/fleet-storage.js +14 -5
- package/dist/internal/c4/fleet-storage.js.map +1 -1
- package/dist/internal/c4/fleet.d.ts +49 -0
- package/dist/internal/c4/fleet.d.ts.map +1 -1
- package/dist/internal/c4/fleet.js +88 -5
- package/dist/internal/c4/fleet.js.map +1 -1
- package/dist/internal/c4/game.d.ts +26 -0
- package/dist/internal/c4/game.d.ts.map +1 -1
- package/dist/internal/c4/game.js +35 -0
- package/dist/internal/c4/game.js.map +1 -1
- package/dist/internal/c4/governance.d.ts +313 -0
- package/dist/internal/c4/governance.d.ts.map +1 -0
- package/dist/internal/c4/governance.js +471 -0
- package/dist/internal/c4/governance.js.map +1 -0
- package/dist/internal/c4/runtime-bindings.d.ts +1 -1
- package/dist/internal/c4/runtime-bindings.d.ts.map +1 -1
- package/dist/internal/c4/runtime-bindings.js +1 -1
- package/dist/internal/c4/runtime-bindings.js.map +1 -1
- package/dist/internal/c4/starbase-upgrade.d.ts +20 -0
- package/dist/internal/c4/starbase-upgrade.d.ts.map +1 -0
- package/dist/internal/c4/starbase-upgrade.js +44 -0
- package/dist/internal/c4/starbase-upgrade.js.map +1 -0
- package/dist/internal/c4/world.d.ts +3 -2
- package/dist/internal/c4/world.d.ts.map +1 -1
- package/dist/internal/c4/world.js +4 -18
- package/dist/internal/c4/world.js.map +1 -1
- package/dist/internal/crafting-process-state.d.ts +16 -3
- package/dist/internal/crafting-process-state.d.ts.map +1 -1
- package/dist/internal/crafting-process-state.js +44 -0
- package/dist/internal/crafting-process-state.js.map +1 -1
- package/dist/internal/fleet.d.ts.map +1 -1
- package/dist/internal/fleet.js +1 -0
- package/dist/internal/fleet.js.map +1 -1
- package/dist/internal/planning/authorization-adapter.d.ts +404 -1
- package/dist/internal/planning/authorization-adapter.d.ts.map +1 -1
- package/dist/internal/planning/authorization-adapter.js +578 -1
- package/dist/internal/planning/authorization-adapter.js.map +1 -1
- package/dist/internal/planning/building-xp.d.ts +50 -0
- package/dist/internal/planning/building-xp.d.ts.map +1 -0
- package/dist/internal/planning/building-xp.js +166 -0
- package/dist/internal/planning/building-xp.js.map +1 -0
- package/dist/internal/planning/claim-stake-transfer-window.d.ts +18 -0
- package/dist/internal/planning/claim-stake-transfer-window.d.ts.map +1 -0
- package/dist/internal/planning/claim-stake-transfer-window.js +57 -0
- package/dist/internal/planning/claim-stake-transfer-window.js.map +1 -0
- package/dist/internal/planning/combat-storage-actions.d.ts +3 -2
- package/dist/internal/planning/combat-storage-actions.d.ts.map +1 -1
- package/dist/internal/planning/combat-storage-actions.js +26 -4
- package/dist/internal/planning/combat-storage-actions.js.map +1 -1
- package/dist/internal/planning/crafting-hab-storage-actions.d.ts +10 -0
- package/dist/internal/planning/crafting-hab-storage-actions.d.ts.map +1 -0
- package/dist/internal/planning/crafting-hab-storage-actions.js +46 -0
- package/dist/internal/planning/crafting-hab-storage-actions.js.map +1 -0
- package/dist/internal/planning/currency-cache-guard.d.ts.map +1 -1
- package/dist/internal/planning/currency-cache-guard.js +5 -1
- package/dist/internal/planning/currency-cache-guard.js.map +1 -1
- package/dist/internal/planning/daily-check-in.d.ts +71 -0
- package/dist/internal/planning/daily-check-in.d.ts.map +1 -0
- package/dist/internal/planning/daily-check-in.js +201 -0
- package/dist/internal/planning/daily-check-in.js.map +1 -0
- package/dist/internal/planning/democracy-history.d.ts +15 -0
- package/dist/internal/planning/democracy-history.d.ts.map +1 -1
- package/dist/internal/planning/democracy-history.js +23 -7
- package/dist/internal/planning/democracy-history.js.map +1 -1
- package/dist/internal/planning/democracy-storage-actions.d.ts +12 -0
- package/dist/internal/planning/democracy-storage-actions.d.ts.map +1 -0
- package/dist/internal/planning/democracy-storage-actions.js +81 -0
- package/dist/internal/planning/democracy-storage-actions.js.map +1 -0
- package/dist/internal/planning/fleet-state.d.ts.map +1 -1
- package/dist/internal/planning/fleet-state.js +1 -0
- package/dist/internal/planning/fleet-state.js.map +1 -1
- package/dist/internal/planning/governance-storage-actions.d.ts +9 -0
- package/dist/internal/planning/governance-storage-actions.d.ts.map +1 -0
- package/dist/internal/planning/governance-storage-actions.js +89 -0
- package/dist/internal/planning/governance-storage-actions.js.map +1 -0
- package/dist/internal/planning/loyalty-earning.d.ts +42 -0
- package/dist/internal/planning/loyalty-earning.d.ts.map +1 -0
- package/dist/internal/planning/loyalty-earning.js +143 -0
- package/dist/internal/planning/loyalty-earning.js.map +1 -0
- package/dist/internal/planning/placement-fee.d.ts +6 -0
- package/dist/internal/planning/placement-fee.d.ts.map +1 -0
- package/dist/internal/planning/placement-fee.js +9 -0
- package/dist/internal/planning/placement-fee.js.map +1 -0
- package/dist/internal/planning/plan-guards.d.ts.map +1 -1
- package/dist/internal/planning/plan-guards.js +11 -0
- package/dist/internal/planning/plan-guards.js.map +1 -1
- package/dist/internal/planning/profile-storage-funding-guard.d.ts +1 -1
- package/dist/internal/planning/profile-storage-funding-guard.d.ts.map +1 -1
- package/dist/internal/planning/profile-storage-funding-guard.js +66 -1
- package/dist/internal/planning/profile-storage-funding-guard.js.map +1 -1
- package/dist/internal/planning/rent-catalog.d.ts.map +1 -1
- package/dist/internal/planning/rent-catalog.js +37 -1
- package/dist/internal/planning/rent-catalog.js.map +1 -1
- package/dist/internal/planning/research-unlock.d.ts.map +1 -1
- package/dist/internal/planning/research-unlock.js.map +1 -1
- package/dist/internal/planning/reward-epoch.d.ts +44 -0
- package/dist/internal/planning/reward-epoch.d.ts.map +1 -0
- package/dist/internal/planning/reward-epoch.js +220 -0
- package/dist/internal/planning/reward-epoch.js.map +1 -0
- package/dist/internal/planning/runtime-guards.d.ts.map +1 -1
- package/dist/internal/planning/runtime-guards.js +92 -13
- package/dist/internal/planning/runtime-guards.js.map +1 -1
- package/dist/internal/planning/starbase-repair-guard.d.ts +12 -0
- package/dist/internal/planning/starbase-repair-guard.d.ts.map +1 -0
- package/dist/internal/planning/starbase-repair-guard.js +54 -0
- package/dist/internal/planning/starbase-repair-guard.js.map +1 -0
- package/dist/internal/planning/starbase-system-guard.d.ts.map +1 -1
- package/dist/internal/planning/starbase-system-guard.js +48 -3
- package/dist/internal/planning/starbase-system-guard.js.map +1 -1
- package/dist/internal/planning/starbase-upgrade-storage-actions.d.ts +7 -0
- package/dist/internal/planning/starbase-upgrade-storage-actions.d.ts.map +1 -0
- package/dist/internal/planning/starbase-upgrade-storage-actions.js +71 -0
- package/dist/internal/planning/starbase-upgrade-storage-actions.js.map +1 -0
- package/dist/internal/planning/starbase-upgrade-window.d.ts +22 -0
- package/dist/internal/planning/starbase-upgrade-window.d.ts.map +1 -0
- package/dist/internal/planning/starbase-upgrade-window.js +64 -0
- package/dist/internal/planning/starbase-upgrade-window.js.map +1 -0
- package/dist/internal/planning/storage-action-readers.d.ts.map +1 -1
- package/dist/internal/planning/storage-action-readers.js +25 -0
- package/dist/internal/planning/storage-action-readers.js.map +1 -1
- package/dist/mining/actions/index.d.ts +6 -1
- package/dist/mining/actions/index.d.ts.map +1 -1
- package/dist/mining/actions/index.js +14 -1
- package/dist/mining/actions/index.js.map +1 -1
- package/dist/mining/exit-fuel.d.ts +47 -0
- package/dist/mining/exit-fuel.d.ts.map +1 -0
- package/dist/mining/exit-fuel.js +47 -0
- package/dist/mining/exit-fuel.js.map +1 -0
- package/dist/mining/index.d.ts +1 -0
- package/dist/mining/index.d.ts.map +1 -1
- package/dist/mining/index.js +1 -0
- package/dist/mining/index.js.map +1 -1
- package/dist/mining/profile.d.ts +2 -1
- package/dist/mining/profile.d.ts.map +1 -1
- package/dist/mining/profile.js +2 -1
- package/dist/mining/profile.js.map +1 -1
- package/dist/planning/assembly.d.ts +2 -0
- package/dist/planning/assembly.d.ts.map +1 -1
- package/dist/planning/assembly.js +5 -1
- package/dist/planning/assembly.js.map +1 -1
- package/dist/planning/execution.d.ts.map +1 -1
- package/dist/planning/execution.js +132 -5
- package/dist/planning/execution.js.map +1 -1
- package/dist/planning/index.d.ts +75 -0
- package/dist/planning/index.d.ts.map +1 -1
- package/dist/planning/index.js +1 -0
- package/dist/planning/index.js.map +1 -1
- package/dist/planning/plan-validation.d.ts.map +1 -1
- package/dist/planning/plan-validation.js +27 -0
- package/dist/planning/plan-validation.js.map +1 -1
- package/dist/planning/selected-references.d.ts +83 -1
- package/dist/planning/selected-references.d.ts.map +1 -1
- package/dist/planning/selected-references.js +192 -2
- package/dist/planning/selected-references.js.map +1 -1
- package/dist/planning/simulation.d.ts.map +1 -1
- package/dist/planning/simulation.js +11 -3
- package/dist/planning/simulation.js.map +1 -1
- package/dist/starbases/actions/democracy.d.ts +205 -0
- package/dist/starbases/actions/democracy.d.ts.map +1 -0
- package/dist/starbases/actions/democracy.js +861 -0
- package/dist/starbases/actions/democracy.js.map +1 -0
- package/dist/starbases/actions/governance.d.ts +78 -0
- package/dist/starbases/actions/governance.d.ts.map +1 -0
- package/dist/starbases/actions/governance.js +382 -0
- package/dist/starbases/actions/governance.js.map +1 -0
- package/dist/starbases/actions/index.d.ts +3 -1
- package/dist/starbases/actions/index.d.ts.map +1 -1
- package/dist/starbases/actions/index.js +3 -0
- package/dist/starbases/actions/index.js.map +1 -1
- package/dist/starbases/actions/upgrades.d.ts +116 -0
- package/dist/starbases/actions/upgrades.d.ts.map +1 -0
- package/dist/starbases/actions/upgrades.js +474 -0
- package/dist/starbases/actions/upgrades.js.map +1 -0
- package/dist/starbases/governance.d.ts +445 -0
- package/dist/starbases/governance.d.ts.map +1 -0
- package/dist/starbases/governance.js +503 -0
- package/dist/starbases/governance.js.map +1 -0
- package/dist/starbases/index.d.ts +1 -0
- package/dist/starbases/index.d.ts.map +1 -1
- package/dist/starbases/index.js +1 -0
- package/dist/starbases/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/starbases/actions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAgB,MA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,KAAK,CAAC,4CAA4C,MAAM,CAAC,UAAU,CAAC,qBAAqB,MAAM,CAAC,UAAU,CAAC,gHAAgH,MAAM,sDAAsD,CAAC;IACziB,OAAO,gBAAgB,CAAC,GAAG,CAAC,QAAQ,EAAE;QACpC,IAAI,EAAE,0BAA0B;QAChC,aAAa,EAAE;YACb,MAAM,wBAAwB,CAC5B,aAAa,EACb,kBAAkB,MAAM,CAAC,OAAO,uDAAuD,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,GAAG,CACxH;YACD,aAAa;SACd;QACD,KAAK,EAAE;YACL;gBACE,SAAS,EAAE,WAAW;gBACtB,WAAW,EAAE,qCAAqC,CAAC,GAAG,CAAC,QAAQ,EAAE;oBAC/D,MAAM;oBACN,IAAI;oBACJ,OAAO,EAAE,UAAU,CAAC,aAAa;oBACjC,cAAc,EAAE,MAAM,CAAC,OAAO;oBAC9B,MAAM,EAAE,MAAM,CAAC,OAAO;iBACvB,CAAC;gBACF,OAAO,EAAE,CAAC,MAAM,CAAC;aAClB;SACF;QACD,OAAO,EAAE,0BAA0B,MAAM,CAAC,OAAO,mBAAmB,UAAU,CAAC,IAAI,GAAG;KACvF,CAAC,CAAC;AACL,CAAC;AAED,OAAO,EACL,8BAA8B,EAC9B,sCAAsC,GAGvC,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACL,2BAA2B,EAC3B,2BAA2B,EAC3B,2BAA2B,EAC3B,+BAA+B,EAC/B,6BAA6B,GAO9B,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,qCAAqC,EACrC,+BAA+B,EAC/B,kCAAkC,GAGnC,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { type Address } from '@solana/kit';
|
|
2
|
+
import type { SageContext } from '../../client/contracts.js';
|
|
3
|
+
import { type PlanAuthorization } from '../../internal/planning/authorization-adapter.js';
|
|
4
|
+
import type { Plan } from '../../planning/index.js';
|
|
5
|
+
import type { StarbasePlayerSnapshot, StarbaseUpgradeProcessSnapshot } from '../index.js';
|
|
6
|
+
/** Inputs for contributing one Starbase upgrade material.
|
|
7
|
+
*
|
|
8
|
+
* `upgradeProcess` is the address of a new caller-generated signer that
|
|
9
|
+
* becomes the contribution's StarbaseUpgradeProcess; planning keeps only its
|
|
10
|
+
* address.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* declare const authorization: PlanAuthorization;
|
|
15
|
+
* declare const upgradeProcess: Address;
|
|
16
|
+
* const options: PlanContributeToStarbaseUpgradeOptions = {
|
|
17
|
+
* authorization,
|
|
18
|
+
* upgradeProcess,
|
|
19
|
+
* cargoId: 1060,
|
|
20
|
+
* quantity: 10_000n,
|
|
21
|
+
* crew: 10,
|
|
22
|
+
* };
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export interface PlanContributeToStarbaseUpgradeOptions {
|
|
26
|
+
readonly authorization: PlanAuthorization;
|
|
27
|
+
/** The new StarbaseUpgradeProcess signer address. */
|
|
28
|
+
readonly upgradeProcess: Address;
|
|
29
|
+
/** The upgrade material, by cargo id. */
|
|
30
|
+
readonly cargoId: number;
|
|
31
|
+
/** Raw units taken from the Starbase Player's cargo. */
|
|
32
|
+
readonly quantity: bigint;
|
|
33
|
+
/** Idle crew assigned until the contribution is installed or cancelled. */
|
|
34
|
+
readonly crew: number;
|
|
35
|
+
}
|
|
36
|
+
/** Inputs for cancelling or installing one Starbase upgrade contribution.
|
|
37
|
+
* @example
|
|
38
|
+
* ```ts
|
|
39
|
+
* declare const authorization: PlanAuthorization;
|
|
40
|
+
* const options: PlanStarbaseUpgradeContributionOptions = { authorization };
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
export interface PlanStarbaseUpgradeContributionOptions {
|
|
44
|
+
readonly authorization: PlanAuthorization;
|
|
45
|
+
}
|
|
46
|
+
/** Plans one Starbase upgrade contribution: one material and idle crew from a
|
|
47
|
+
* Starbase Player go into a new StarbaseUpgradeProcess, which can be installed
|
|
48
|
+
* once its time has passed.
|
|
49
|
+
*
|
|
50
|
+
* The planner requires a Starbase below its maximum level whose current
|
|
51
|
+
* upgrade still needs the material, refuses more than the Starbase still
|
|
52
|
+
* needs, fewer crew than the material requires or than are idle, and cargo the
|
|
53
|
+
* Starbase Player does not hold. Running contributions reserve nothing: the
|
|
54
|
+
* game counts only installed material, and returns at installation whatever
|
|
55
|
+
* the Starbase no longer needs. Key permissions and research access to the
|
|
56
|
+
* material remain chain-authoritative.
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```ts
|
|
60
|
+
* declare const ctx: SageContext;
|
|
61
|
+
* declare const player: StarbasePlayerSnapshot;
|
|
62
|
+
* declare const options: PlanContributeToStarbaseUpgradeOptions;
|
|
63
|
+
* const plan = await planContributeToStarbaseUpgrade(ctx, player, options);
|
|
64
|
+
* console.log(plan.describe());
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
export declare function planContributeToStarbaseUpgrade(ctx: SageContext, starbasePlayer: StarbasePlayerSnapshot, input: PlanContributeToStarbaseUpgradeOptions): Promise<Plan>;
|
|
68
|
+
/** Plans the cancellation of a running Starbase upgrade contribution: the game
|
|
69
|
+
* returns its whole material and crew to the Starbase Player and closes the
|
|
70
|
+
* StarbaseUpgradeProcess.
|
|
71
|
+
*
|
|
72
|
+
* The game cancels only a contribution whose time has not yet passed, so the
|
|
73
|
+
* planner refuses a finished one, which can be installed instead. The Plan
|
|
74
|
+
* must execute before the contribution ends.
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* ```ts
|
|
78
|
+
* declare const ctx: SageContext;
|
|
79
|
+
* declare const process: StarbaseUpgradeProcessSnapshot;
|
|
80
|
+
* declare const authorization: PlanAuthorization;
|
|
81
|
+
* const plan = await planCancelStarbaseUpgradeContribution(ctx, process, {
|
|
82
|
+
* authorization,
|
|
83
|
+
* });
|
|
84
|
+
* console.log(plan.describe());
|
|
85
|
+
* ```
|
|
86
|
+
*/
|
|
87
|
+
export declare function planCancelStarbaseUpgradeContribution(ctx: SageContext, process: StarbaseUpgradeProcessSnapshot, input: PlanStarbaseUpgradeContributionOptions): Promise<Plan>;
|
|
88
|
+
/** Plans the installation of a finished Starbase upgrade contribution: the
|
|
89
|
+
* game applies the material to the Starbase's current upgrade, returns what it
|
|
90
|
+
* no longer needs and the crew to the Starbase Player, closes the
|
|
91
|
+
* StarbaseUpgradeProcess and raises the Starbase's level once every material
|
|
92
|
+
* is installed.
|
|
93
|
+
*
|
|
94
|
+
* A Starbase rebuilt from level 0 joins the contributor's faction when it
|
|
95
|
+
* reaches level 1, except in a sanctuary System. Installed material can earn
|
|
96
|
+
* the contributor Loyalty Points for the current reward epoch; for a material
|
|
97
|
+
* with a configured rate, the game then needs the faction's Loyalty epoch and
|
|
98
|
+
* the Profile's contribution record, and the Plan opens whichever is missing
|
|
99
|
+
* first, its rent paid by the authorization key's wallet. The game refuses
|
|
100
|
+
* the installation outside the current reward epoch while rewards are
|
|
101
|
+
* enabled. Requires Disabled rent: the Game's rent catalog and the System's
|
|
102
|
+
* Starbase-level rent history must not exist.
|
|
103
|
+
*
|
|
104
|
+
* @example
|
|
105
|
+
* ```ts
|
|
106
|
+
* declare const ctx: SageContext;
|
|
107
|
+
* declare const process: StarbaseUpgradeProcessSnapshot;
|
|
108
|
+
* declare const authorization: PlanAuthorization;
|
|
109
|
+
* const plan = await planInstallStarbaseUpgradeResource(ctx, process, {
|
|
110
|
+
* authorization,
|
|
111
|
+
* });
|
|
112
|
+
* console.log(plan.describe());
|
|
113
|
+
* ```
|
|
114
|
+
*/
|
|
115
|
+
export declare function planInstallStarbaseUpgradeResource(ctx: SageContext, process: StarbaseUpgradeProcessSnapshot, input: PlanStarbaseUpgradeContributionOptions): Promise<Plan>;
|
|
116
|
+
//# sourceMappingURL=upgrades.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upgrades.d.ts","sourceRoot":"","sources":["../../../src/star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AA8B,EACvC,KAAK,EAAE,sCAAsC,GAC5C,OAAO,CAAC,IAAI,CAAC,CAgKf"}
|
|
@@ -0,0 +1,474 @@
|
|
|
1
|
+
import { isAddress } from '@solana/kit';
|
|
2
|
+
import { InvalidActionInputError, SageSdkError } from '../../client/errors.js';
|
|
3
|
+
import { readContextRawAccounts } from '../../client/reconciliation.js';
|
|
4
|
+
import { findCharacterPda } from '../../internal/c4/character.js';
|
|
5
|
+
import { factionValue } from '../../internal/c4/faction.js';
|
|
6
|
+
import { deriveFactionOwnershipAddress, deriveKingSystemTrackerAddress, deriveRegionTrackerAddress, } from '../../internal/c4/factions.js';
|
|
7
|
+
import { deriveStarbasePlayerAddress, starbasePlayerAccountDefinition, starbaseUpgradeProcessAccountDefinition, } from '../../internal/c4/starbase.js';
|
|
8
|
+
import { currentUpgradeMaterials, installableUpgradeQuantity, } from '../../internal/c4/starbase-upgrade.js';
|
|
9
|
+
import { deriveStarSystemAddress, starSystemAccountDefinition, } from '../../internal/c4/world.js';
|
|
10
|
+
import { requireGameAddress } from '../../internal/game-context.js';
|
|
11
|
+
import { accountAbsentPrecondition, accountStatePrecondition, } from '../../internal/planning/account-state.js';
|
|
12
|
+
import { resolveDemocracyHistory } from '../../internal/planning/democracy-history.js';
|
|
13
|
+
import { adaptCancelStarbaseUpgradeContributionInstruction, adaptContributeToStarbaseUpgradeInstruction, adaptInstallStarbaseUpgradeResourceInstruction, readPlanAuthorization, } from '../../internal/planning/authorization-adapter.js';
|
|
14
|
+
import { CLOCK_ADDRESS, readClock, } from '../../internal/planning/faction-enrollment.js';
|
|
15
|
+
import { resolveLoyaltyEarning, resolveRewardContext, } from '../../internal/planning/loyalty-earning.js';
|
|
16
|
+
import { requireDisabledLevelRent } from '../../internal/planning/rent-catalog.js';
|
|
17
|
+
import { RENT_ADDRESS } from '../../internal/planning/rent.js';
|
|
18
|
+
import { readStarbaseUpgradeStorageAction } from '../../internal/planning/starbase-upgrade-storage-actions.js';
|
|
19
|
+
import { planStorageFunding } from '../../internal/planning/storage-actions.js';
|
|
20
|
+
import { buildPlannerPlan } from '../../planning/plan-construction.js';
|
|
21
|
+
const U16_MAX = 65_535;
|
|
22
|
+
const U64_MAX = 18446744073709551615n;
|
|
23
|
+
function fail(message, address) {
|
|
24
|
+
throw new SageSdkError('ACTION_PRECONDITION_FAILED', message, { address });
|
|
25
|
+
}
|
|
26
|
+
function invalid(field, value, accepted, remedy) {
|
|
27
|
+
throw new InvalidActionInputError(field, value, accepted, remedy);
|
|
28
|
+
}
|
|
29
|
+
function readOptions(value, required) {
|
|
30
|
+
if (value === null || typeof value !== 'object' || Array.isArray(value))
|
|
31
|
+
return invalid('options', value, 'a plain object', 'Provide the documented options object before retrying.');
|
|
32
|
+
const options = value;
|
|
33
|
+
const missing = required.find((key) => !Object.hasOwn(options, key));
|
|
34
|
+
const unexpected = Object.keys(options).find((key) => !required.includes(key));
|
|
35
|
+
if (missing !== undefined || unexpected !== undefined)
|
|
36
|
+
invalid('options', missing === undefined ? unexpected : `missing ${missing}`, `exactly the fields ${required.join(', ')}`, 'Remove unknown fields and provide every required option before retrying.');
|
|
37
|
+
return options;
|
|
38
|
+
}
|
|
39
|
+
function present(account, address, message) {
|
|
40
|
+
return account ?? fail(message, address);
|
|
41
|
+
}
|
|
42
|
+
/** Decodes the fresh Star System and requires its current Starbase in the
|
|
43
|
+
* configured Game at `sequenceId`. */
|
|
44
|
+
async function readStarbaseSystem(ctx, game, raw, sequenceId, staleRemedy) {
|
|
45
|
+
const system = starSystemAccountDefinition.decode(raw, ctx.programs);
|
|
46
|
+
if (system.game !== game ||
|
|
47
|
+
(await deriveStarSystemAddress(ctx.programs, game, system.systemId)) !==
|
|
48
|
+
raw.address)
|
|
49
|
+
fail(`Star System ${raw.address} is not the canonical System of its id in configured Game ${game}. Refresh it through this context and retry.`, raw.address);
|
|
50
|
+
if (system.starbase === undefined)
|
|
51
|
+
fail(`Star System ${system.name} (${raw.address}) has no Starbase. Choose a System with a Starbase and retry.`, raw.address);
|
|
52
|
+
if (system.sequenceId !== sequenceId)
|
|
53
|
+
fail(`The Starbase at Star System ${system.name} (${raw.address}) is at sequence ${String(system.sequenceId)}, not ${String(sequenceId)}: it was destroyed or replaced. ${staleRemedy}`, raw.address);
|
|
54
|
+
return system;
|
|
55
|
+
}
|
|
56
|
+
function starbaseSystemGuard(system, game, sequenceId) {
|
|
57
|
+
return {
|
|
58
|
+
kind: 'starbase-system',
|
|
59
|
+
address: system,
|
|
60
|
+
game,
|
|
61
|
+
starbaseSequenceId: sequenceId,
|
|
62
|
+
describes: `Star System ${system} retains its canonical Game identity, active Starbase and sequence ${String(sequenceId)}; unrelated shared activity may change.`,
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
/** The game's contribution time: the material's base duration per unit of
|
|
66
|
+
* crew, rounded up, and never less than the base duration. */
|
|
67
|
+
function contributionSeconds(baseSeconds, quantity, crew) {
|
|
68
|
+
const base = BigInt(baseSeconds);
|
|
69
|
+
const scaled = (base * quantity + BigInt(crew) - 1n) / BigInt(crew);
|
|
70
|
+
return scaled > base ? scaled : base;
|
|
71
|
+
}
|
|
72
|
+
/** Plans one Starbase upgrade contribution: one material and idle crew from a
|
|
73
|
+
* Starbase Player go into a new StarbaseUpgradeProcess, which can be installed
|
|
74
|
+
* once its time has passed.
|
|
75
|
+
*
|
|
76
|
+
* The planner requires a Starbase below its maximum level whose current
|
|
77
|
+
* upgrade still needs the material, refuses more than the Starbase still
|
|
78
|
+
* needs, fewer crew than the material requires or than are idle, and cargo the
|
|
79
|
+
* Starbase Player does not hold. Running contributions reserve nothing: the
|
|
80
|
+
* game counts only installed material, and returns at installation whatever
|
|
81
|
+
* the Starbase no longer needs. Key permissions and research access to the
|
|
82
|
+
* material remain chain-authoritative.
|
|
83
|
+
*
|
|
84
|
+
* @example
|
|
85
|
+
* ```ts
|
|
86
|
+
* declare const ctx: SageContext;
|
|
87
|
+
* declare const player: StarbasePlayerSnapshot;
|
|
88
|
+
* declare const options: PlanContributeToStarbaseUpgradeOptions;
|
|
89
|
+
* const plan = await planContributeToStarbaseUpgrade(ctx, player, options);
|
|
90
|
+
* console.log(plan.describe());
|
|
91
|
+
* ```
|
|
92
|
+
*/
|
|
93
|
+
export async function planContributeToStarbaseUpgrade(ctx, starbasePlayer, input) {
|
|
94
|
+
const options = readOptions(input, [
|
|
95
|
+
'authorization',
|
|
96
|
+
'upgradeProcess',
|
|
97
|
+
'cargoId',
|
|
98
|
+
'quantity',
|
|
99
|
+
'crew',
|
|
100
|
+
]);
|
|
101
|
+
const authorization = readPlanAuthorization(options.authorization);
|
|
102
|
+
const { upgradeProcess, cargoId, quantity, crew } = options;
|
|
103
|
+
if (typeof upgradeProcess !== 'string' || !isAddress(upgradeProcess))
|
|
104
|
+
invalid('upgradeProcess', upgradeProcess, 'one valid z.ink/Solana account address', 'Generate a new signer for the StarbaseUpgradeProcess and pass its address before retrying.');
|
|
105
|
+
if (!Number.isSafeInteger(cargoId) ||
|
|
106
|
+
cargoId < 0 ||
|
|
107
|
+
cargoId > U16_MAX)
|
|
108
|
+
invalid('cargoId', cargoId, 'a cargo id from the Starbase upgrade materials', 'Choose one of the materials the Starbase still needs before retrying.');
|
|
109
|
+
if (typeof quantity !== 'bigint' || quantity <= 0n || quantity > U64_MAX)
|
|
110
|
+
invalid('quantity', quantity, 'a positive u64 bigint', 'Provide the number of raw units to contribute before retrying.');
|
|
111
|
+
if (!Number.isSafeInteger(crew) ||
|
|
112
|
+
crew < 1 ||
|
|
113
|
+
crew > U16_MAX)
|
|
114
|
+
invalid('crew', crew, 'a positive integer of at most 65,535', 'Assign at least the crew the material requires before retrying.');
|
|
115
|
+
const amount = quantity;
|
|
116
|
+
const crewCount = crew;
|
|
117
|
+
const material = cargoId;
|
|
118
|
+
if (upgradeProcess === authorization.authority)
|
|
119
|
+
invalid('upgradeProcess', upgradeProcess, 'a new signer address other than the authorization key', 'Generate a new signer for the StarbaseUpgradeProcess before retrying.');
|
|
120
|
+
const game = requireGameAddress(ctx);
|
|
121
|
+
const { profile } = authorization;
|
|
122
|
+
if (starbasePlayer.playerProfile.address !== profile)
|
|
123
|
+
fail(`Starbase Player ${starbasePlayer.address} belongs to Profile ${starbasePlayer.playerProfile.address}, not authorization Profile ${profile}. Use the owning Profile and retry.`, starbasePlayer.address);
|
|
124
|
+
const system = starbasePlayer.system.address;
|
|
125
|
+
const character = await findCharacterPda(ctx.programs, profile, game);
|
|
126
|
+
const [systemCandidate, playerCandidate, profileCandidate, characterCandidate, processCandidate, rent,] = await readContextRawAccounts(ctx, [
|
|
127
|
+
system,
|
|
128
|
+
starbasePlayer.address,
|
|
129
|
+
profile,
|
|
130
|
+
character,
|
|
131
|
+
upgradeProcess,
|
|
132
|
+
RENT_ADDRESS,
|
|
133
|
+
]);
|
|
134
|
+
const playerRaw = present(playerCandidate, starbasePlayer.address, `Starbase Player ${starbasePlayer.address} is missing. Refresh it and retry.`);
|
|
135
|
+
present(characterCandidate, character, `Profile ${profile} has no Character ${character}. Register the Character and retry.`);
|
|
136
|
+
const player = starbasePlayerAccountDefinition.decode(playerRaw, ctx.programs);
|
|
137
|
+
if (player.playerProfile !== profile ||
|
|
138
|
+
player.system !== system ||
|
|
139
|
+
player.character !== character ||
|
|
140
|
+
(await deriveStarbasePlayerAddress(ctx.programs, system, character)) !==
|
|
141
|
+
starbasePlayer.address)
|
|
142
|
+
fail(`Starbase Player ${starbasePlayer.address} is not the canonical registration of Profile ${profile} and its Character at Star System ${system}. Refresh it and retry.`, starbasePlayer.address);
|
|
143
|
+
const systemData = await readStarbaseSystem(ctx, game, present(systemCandidate, system, `Star System ${system} is missing. Refresh it and retry.`), player.sequenceId, 'Register a Starbase Player at the current Starbase and retry.');
|
|
144
|
+
const materials = currentUpgradeMaterials(systemData.starbase);
|
|
145
|
+
if (materials === undefined)
|
|
146
|
+
fail(`The Starbase at ${systemData.name} (${system}) is at its maximum level, ${systemData.starbase.level}, so it takes no upgrade materials.`, system);
|
|
147
|
+
const requirement = materials.find((entry) => entry.cargoId === material);
|
|
148
|
+
if (requirement === undefined)
|
|
149
|
+
invalid('cargoId', material, `one of the upgrade materials ${materials.map((entry) => entry.cargoId).join(', ')}`, `Choose a material the ${systemData.starbase.level} Starbase at ${systemData.name} needs before retrying.`);
|
|
150
|
+
const remaining = requirement.needed > requirement.deposited
|
|
151
|
+
? requirement.needed - requirement.deposited
|
|
152
|
+
: 0n;
|
|
153
|
+
if (remaining === 0n)
|
|
154
|
+
fail(`The Starbase at ${systemData.name} (${system}) already has all ${String(requirement.needed)} of cargo ${String(material)} installed. Contribute another material, or install finished contributions to complete the upgrade.`, system);
|
|
155
|
+
if (amount > remaining)
|
|
156
|
+
fail(`The Starbase at ${systemData.name} (${system}) needs ${String(remaining)} more of cargo ${String(material)} (${String(requirement.deposited)} of ${String(requirement.needed)} installed); contribute at most that and retry.`, system);
|
|
157
|
+
if (crewCount < requirement.crew)
|
|
158
|
+
fail(`Cargo ${String(material)} needs at least ${String(requirement.crew)} crew per contribution, more than the ${String(crewCount)} requested. Assign more crew and retry.`, system);
|
|
159
|
+
const idle = player.totalCrew - player.busyCrew;
|
|
160
|
+
if (crewCount > idle)
|
|
161
|
+
fail(`Starbase Player ${starbasePlayer.address} has ${String(idle)} idle crew, fewer than the ${String(crewCount)} requested. Assign fewer crew or wait for busy crew to return, then retry.`, starbasePlayer.address);
|
|
162
|
+
const held = player.cargo.amounts.find((entry) => entry.cargoId === material)?.amount ??
|
|
163
|
+
0n;
|
|
164
|
+
if (held < amount)
|
|
165
|
+
fail(`Starbase Player ${starbasePlayer.address} holds ${String(held)} of cargo ${String(material)}, fewer than the ${String(amount)} to contribute. Bring more to the Starbase or contribute less, then retry.`, starbasePlayer.address);
|
|
166
|
+
if (processCandidate !== undefined)
|
|
167
|
+
fail(`Account ${upgradeProcess} already exists. Generate a new signer for the StarbaseUpgradeProcess and retry.`, upgradeProcess);
|
|
168
|
+
const instruction = adaptContributeToStarbaseUpgradeInstruction(ctx.programs, {
|
|
169
|
+
authorization,
|
|
170
|
+
character,
|
|
171
|
+
system,
|
|
172
|
+
starbasePlayer: starbasePlayer.address,
|
|
173
|
+
upgradeProcess,
|
|
174
|
+
game,
|
|
175
|
+
cargoId: material,
|
|
176
|
+
quantity: amount,
|
|
177
|
+
crew: crewCount,
|
|
178
|
+
});
|
|
179
|
+
const accounts = new Map([
|
|
180
|
+
[playerRaw.address, playerRaw],
|
|
181
|
+
[system, systemCandidate],
|
|
182
|
+
[profile, profileCandidate],
|
|
183
|
+
[RENT_ADDRESS, rent],
|
|
184
|
+
]);
|
|
185
|
+
const funding = planStorageFunding(ctx.programs, {
|
|
186
|
+
action: readStarbaseUpgradeStorageAction(ctx.programs, instruction, accounts),
|
|
187
|
+
accounts,
|
|
188
|
+
label: 'Starbase upgrade contribution',
|
|
189
|
+
});
|
|
190
|
+
const seconds = contributionSeconds(requirement.durationSeconds, amount, crewCount);
|
|
191
|
+
const description = `Contribute ${String(amount)} of cargo ${String(material)} and ${String(crewCount)} crew from Starbase Player ${starbasePlayer.address} to the ${systemData.starbase.level} Starbase at ${systemData.name} (${String(requirement.deposited)} of ${String(requirement.needed)} installed). The game takes the cargo now, caps it at what the Starbase still needs when the transaction executes, and keeps the crew busy until the contribution is installed or cancelled; it can be installed ${String(seconds)} seconds after the transaction. ${funding.disclosure} Key permissions and research access to the material remain chain-authoritative.`;
|
|
192
|
+
return buildPlannerPlan(ctx.programs, {
|
|
193
|
+
kind: 'starbases.contribute-upgrade',
|
|
194
|
+
preconditions: [
|
|
195
|
+
await accountStatePrecondition(playerRaw, `Starbase Player ${starbasePlayer.address} keeps its cargo, crew and Starbase.`),
|
|
196
|
+
starbaseSystemGuard(system, game, player.sequenceId),
|
|
197
|
+
accountAbsentPrecondition(upgradeProcess, `StarbaseUpgradeProcess ${upgradeProcess} remains absent until execution.`),
|
|
198
|
+
funding.guard,
|
|
199
|
+
],
|
|
200
|
+
steps: [
|
|
201
|
+
{
|
|
202
|
+
describes: description,
|
|
203
|
+
instruction,
|
|
204
|
+
signers: [authorization.authority, upgradeProcess],
|
|
205
|
+
},
|
|
206
|
+
],
|
|
207
|
+
summary: `Contribute ${String(amount)} of cargo ${String(material)} to the Starbase at ${systemData.name}.`,
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
/** Reads and validates a contribution, its Starbase Player and Star System,
|
|
211
|
+
* and the chain Clock, for cancellation or installation. */
|
|
212
|
+
async function readProcess(ctx, process, input) {
|
|
213
|
+
const options = readOptions(input, ['authorization']);
|
|
214
|
+
const authorization = readPlanAuthorization(options.authorization);
|
|
215
|
+
const game = requireGameAddress(ctx);
|
|
216
|
+
const { profile } = authorization;
|
|
217
|
+
if (process.playerProfile.address !== profile)
|
|
218
|
+
fail(`StarbaseUpgradeProcess ${process.address} belongs to Profile ${process.playerProfile.address}; only that Profile can cancel or install it.`, process.address);
|
|
219
|
+
const character = await findCharacterPda(ctx.programs, profile, game);
|
|
220
|
+
const [processCandidate, playerCandidate, systemCandidate, clock] = await readContextRawAccounts(ctx, [
|
|
221
|
+
process.address,
|
|
222
|
+
process.starbasePlayer.address,
|
|
223
|
+
process.system.address,
|
|
224
|
+
CLOCK_ADDRESS,
|
|
225
|
+
]);
|
|
226
|
+
const processRaw = present(processCandidate, process.address, `StarbaseUpgradeProcess ${process.address} is missing, so it was already cancelled or installed. Refresh the Starbase Player's upgrade processes.`);
|
|
227
|
+
const data = starbaseUpgradeProcessAccountDefinition.decode(processRaw, ctx.programs);
|
|
228
|
+
if (data.playerProfile !== profile ||
|
|
229
|
+
data.starbasePlayer !== process.starbasePlayer.address ||
|
|
230
|
+
data.system !== process.system.address ||
|
|
231
|
+
data.starbaseSequenceId !== process.starbaseSequenceId ||
|
|
232
|
+
data.resourceId !== process.resource.id ||
|
|
233
|
+
data.quantityRaw !== process.resource.quantityRaw ||
|
|
234
|
+
data.numCrew !== process.numCrew ||
|
|
235
|
+
data.endsAtUnixSeconds !== process.endsAtUnixSeconds)
|
|
236
|
+
fail(`StarbaseUpgradeProcess ${process.address} no longer matches its Profile, Starbase Player, System, material, crew or end time. Refresh it and retry.`, process.address);
|
|
237
|
+
const playerRaw = present(playerCandidate, process.starbasePlayer.address, `Starbase Player ${process.starbasePlayer.address} is missing. Refresh it and retry.`);
|
|
238
|
+
const player = starbasePlayerAccountDefinition.decode(playerRaw, ctx.programs);
|
|
239
|
+
if (player.playerProfile !== profile ||
|
|
240
|
+
player.character !== character ||
|
|
241
|
+
player.system !== process.system.address ||
|
|
242
|
+
(await deriveStarbasePlayerAddress(ctx.programs, process.system.address, character)) !== process.starbasePlayer.address)
|
|
243
|
+
fail(`Starbase Player ${process.starbasePlayer.address} is not the canonical registration of Profile ${profile} and its Character at Star System ${process.system.address}. Refresh it and retry.`, process.starbasePlayer.address);
|
|
244
|
+
const systemRaw = present(systemCandidate, process.system.address, `Star System ${process.system.address} is missing. Refresh it and retry.`);
|
|
245
|
+
const system = await readStarbaseSystem(ctx, game, systemRaw, process.starbaseSequenceId, 'A contribution to an earlier Starbase can be neither cancelled nor installed; Atlas Kit does not plan its removal yet.');
|
|
246
|
+
if (player.sequenceId !== process.starbaseSequenceId)
|
|
247
|
+
fail(`Starbase Player ${process.starbasePlayer.address} belongs to an earlier Starbase at Star System ${process.system.address}. Refresh it and retry.`, process.starbasePlayer.address);
|
|
248
|
+
const [profileCandidate, rent] = await readContextRawAccounts(ctx, [
|
|
249
|
+
profile,
|
|
250
|
+
RENT_ADDRESS,
|
|
251
|
+
]);
|
|
252
|
+
return {
|
|
253
|
+
authorization,
|
|
254
|
+
game,
|
|
255
|
+
now: readClock(present(clock, CLOCK_ADDRESS, 'The chain Clock is missing. Retry against a complete RPC provider.')),
|
|
256
|
+
processRaw,
|
|
257
|
+
playerRaw,
|
|
258
|
+
player,
|
|
259
|
+
systemRaw,
|
|
260
|
+
system,
|
|
261
|
+
storageAccounts: new Map([
|
|
262
|
+
[playerRaw.address, playerRaw],
|
|
263
|
+
[processRaw.address, processRaw],
|
|
264
|
+
[profile, profileCandidate],
|
|
265
|
+
[RENT_ADDRESS, rent],
|
|
266
|
+
]),
|
|
267
|
+
};
|
|
268
|
+
}
|
|
269
|
+
/** Plans the cancellation of a running Starbase upgrade contribution: the game
|
|
270
|
+
* returns its whole material and crew to the Starbase Player and closes the
|
|
271
|
+
* StarbaseUpgradeProcess.
|
|
272
|
+
*
|
|
273
|
+
* The game cancels only a contribution whose time has not yet passed, so the
|
|
274
|
+
* planner refuses a finished one, which can be installed instead. The Plan
|
|
275
|
+
* must execute before the contribution ends.
|
|
276
|
+
*
|
|
277
|
+
* @example
|
|
278
|
+
* ```ts
|
|
279
|
+
* declare const ctx: SageContext;
|
|
280
|
+
* declare const process: StarbaseUpgradeProcessSnapshot;
|
|
281
|
+
* declare const authorization: PlanAuthorization;
|
|
282
|
+
* const plan = await planCancelStarbaseUpgradeContribution(ctx, process, {
|
|
283
|
+
* authorization,
|
|
284
|
+
* });
|
|
285
|
+
* console.log(plan.describe());
|
|
286
|
+
* ```
|
|
287
|
+
*/
|
|
288
|
+
export async function planCancelStarbaseUpgradeContribution(ctx, process, input) {
|
|
289
|
+
const context = await readProcess(ctx, process, input);
|
|
290
|
+
const { authorization, game, now } = context;
|
|
291
|
+
if (now >= process.endsAtUnixSeconds)
|
|
292
|
+
fail(`StarbaseUpgradeProcess ${process.address} finished at ${String(process.endsAtUnixSeconds)} (chain time ${String(now)}), and the game cancels only a running contribution. Install it instead with planInstallStarbaseUpgradeResource.`, process.address);
|
|
293
|
+
const instruction = adaptCancelStarbaseUpgradeContributionInstruction(ctx.programs, {
|
|
294
|
+
authorization,
|
|
295
|
+
system: process.system.address,
|
|
296
|
+
starbasePlayer: process.starbasePlayer.address,
|
|
297
|
+
upgradeProcess: process.address,
|
|
298
|
+
game,
|
|
299
|
+
});
|
|
300
|
+
const funding = planStorageFunding(ctx.programs, {
|
|
301
|
+
action: readStarbaseUpgradeStorageAction(ctx.programs, instruction, context.storageAccounts),
|
|
302
|
+
accounts: context.storageAccounts,
|
|
303
|
+
label: 'Starbase upgrade cancellation',
|
|
304
|
+
});
|
|
305
|
+
const description = `Cancel the contribution of ${String(process.resource.quantityRaw)} ${process.resource.name} to the Starbase at ${context.system.name}, returning the material and ${String(process.numCrew)} crew to Starbase Player ${process.starbasePlayer.address} and closing StarbaseUpgradeProcess ${process.address}. The game refuses the cancellation once the contribution ends at ${String(process.endsAtUnixSeconds)}. ${funding.disclosure}`;
|
|
306
|
+
return buildPlannerPlan(ctx.programs, {
|
|
307
|
+
kind: 'starbases.cancel-upgrade-contribution',
|
|
308
|
+
preconditions: [
|
|
309
|
+
{
|
|
310
|
+
kind: 'starbase-upgrade-cancel-window',
|
|
311
|
+
address: process.address,
|
|
312
|
+
endsAtUnixSeconds: process.endsAtUnixSeconds,
|
|
313
|
+
describes: `StarbaseUpgradeProcess ${process.address} is still running when the cancellation executes, before ${String(process.endsAtUnixSeconds)}; afterwards install it instead.`,
|
|
314
|
+
},
|
|
315
|
+
await accountStatePrecondition(context.processRaw, `StarbaseUpgradeProcess ${process.address} keeps its material, crew and end time.`),
|
|
316
|
+
starbaseSystemGuard(process.system.address, game, process.starbaseSequenceId),
|
|
317
|
+
funding.guard,
|
|
318
|
+
],
|
|
319
|
+
steps: [
|
|
320
|
+
{
|
|
321
|
+
describes: description,
|
|
322
|
+
instruction,
|
|
323
|
+
signers: [authorization.authority],
|
|
324
|
+
},
|
|
325
|
+
],
|
|
326
|
+
summary: `Cancel the ${process.resource.name} contribution to the Starbase at ${context.system.name}.`,
|
|
327
|
+
});
|
|
328
|
+
}
|
|
329
|
+
/** Plans the installation of a finished Starbase upgrade contribution: the
|
|
330
|
+
* game applies the material to the Starbase's current upgrade, returns what it
|
|
331
|
+
* no longer needs and the crew to the Starbase Player, closes the
|
|
332
|
+
* StarbaseUpgradeProcess and raises the Starbase's level once every material
|
|
333
|
+
* is installed.
|
|
334
|
+
*
|
|
335
|
+
* A Starbase rebuilt from level 0 joins the contributor's faction when it
|
|
336
|
+
* reaches level 1, except in a sanctuary System. Installed material can earn
|
|
337
|
+
* the contributor Loyalty Points for the current reward epoch; for a material
|
|
338
|
+
* with a configured rate, the game then needs the faction's Loyalty epoch and
|
|
339
|
+
* the Profile's contribution record, and the Plan opens whichever is missing
|
|
340
|
+
* first, its rent paid by the authorization key's wallet. The game refuses
|
|
341
|
+
* the installation outside the current reward epoch while rewards are
|
|
342
|
+
* enabled. Requires Disabled rent: the Game's rent catalog and the System's
|
|
343
|
+
* Starbase-level rent history must not exist.
|
|
344
|
+
*
|
|
345
|
+
* @example
|
|
346
|
+
* ```ts
|
|
347
|
+
* declare const ctx: SageContext;
|
|
348
|
+
* declare const process: StarbaseUpgradeProcessSnapshot;
|
|
349
|
+
* declare const authorization: PlanAuthorization;
|
|
350
|
+
* const plan = await planInstallStarbaseUpgradeResource(ctx, process, {
|
|
351
|
+
* authorization,
|
|
352
|
+
* });
|
|
353
|
+
* console.log(plan.describe());
|
|
354
|
+
* ```
|
|
355
|
+
*/
|
|
356
|
+
export async function planInstallStarbaseUpgradeResource(ctx, process, input) {
|
|
357
|
+
const context = await readProcess(ctx, process, input);
|
|
358
|
+
const { authorization, game, now, system } = context;
|
|
359
|
+
const systemAddress = process.system.address;
|
|
360
|
+
if (now < process.endsAtUnixSeconds)
|
|
361
|
+
fail(`StarbaseUpgradeProcess ${process.address} runs until ${String(process.endsAtUnixSeconds)} (chain time ${String(now)}). Wait until it ends and retry, or cancel it with planCancelStarbaseUpgradeContribution.`, process.address);
|
|
362
|
+
const materials = currentUpgradeMaterials(system.starbase);
|
|
363
|
+
const installed = installableUpgradeQuantity(materials, process.resource.id, process.resource.quantityRaw);
|
|
364
|
+
const returned = process.resource.quantityRaw - installed;
|
|
365
|
+
const completes = installed > 0n &&
|
|
366
|
+
materials.every((entry) => entry.deposited +
|
|
367
|
+
(entry.cargoId === process.resource.id ? installed : 0n) >=
|
|
368
|
+
entry.needed);
|
|
369
|
+
const [kingTracker, regionTracker, factionOwnership, rentState] = await Promise.all([
|
|
370
|
+
deriveKingSystemTrackerAddress(ctx.programs, game),
|
|
371
|
+
deriveRegionTrackerAddress(ctx.programs, game),
|
|
372
|
+
deriveFactionOwnershipAddress(ctx.programs, game, 'starbase', systemAddress),
|
|
373
|
+
requireDisabledLevelRent(ctx, game, { address: systemAddress, systemId: system.systemId }, 'the Starbase upgrade installation'),
|
|
374
|
+
]);
|
|
375
|
+
const reward = await resolveRewardContext(ctx, game, now, 'installations');
|
|
376
|
+
const [kingCandidate, regionCandidate] = await readContextRawAccounts(ctx, [
|
|
377
|
+
kingTracker,
|
|
378
|
+
regionTracker,
|
|
379
|
+
]);
|
|
380
|
+
// Both trackers are the Game's own by derivation; the game validates them.
|
|
381
|
+
for (const [candidate, address, name] of [
|
|
382
|
+
[kingCandidate, kingTracker, 'KingSystemTracker'],
|
|
383
|
+
[regionCandidate, regionTracker, 'RegionTracker'],
|
|
384
|
+
]) {
|
|
385
|
+
if (candidate === undefined || candidate.owner !== ctx.programs.sage)
|
|
386
|
+
fail(`${name} ${address} is missing for configured Game ${game}. Refresh world ownership and retry.`, address);
|
|
387
|
+
}
|
|
388
|
+
// Loyalty Points need the faction's epoch and the Profile's record; only
|
|
389
|
+
// the three major factions earn them.
|
|
390
|
+
const rate = reward.config.upgradeLpRates.find((entry) => entry.cargoId === process.resource.id)?.lpPerRawUnit ?? 0n;
|
|
391
|
+
const faction = factionValue(context.player.faction);
|
|
392
|
+
const earns = installed > 0n && rate > 0n && faction >= 1 && faction <= 3;
|
|
393
|
+
const loyalty = await resolveLoyaltyEarning(ctx, {
|
|
394
|
+
game,
|
|
395
|
+
profile: authorization.profile,
|
|
396
|
+
funder: authorization.authority,
|
|
397
|
+
faction,
|
|
398
|
+
reward,
|
|
399
|
+
earns,
|
|
400
|
+
});
|
|
401
|
+
const steps = [...loyalty.steps];
|
|
402
|
+
// The installation records the System's history and takes no Career XP or
|
|
403
|
+
// fee accounts.
|
|
404
|
+
const history = await resolveDemocracyHistory(ctx, {
|
|
405
|
+
game,
|
|
406
|
+
system: systemAddress,
|
|
407
|
+
});
|
|
408
|
+
const instruction = adaptInstallStarbaseUpgradeResourceInstruction(ctx.programs, {
|
|
409
|
+
...history.accounts,
|
|
410
|
+
...rentState.accounts,
|
|
411
|
+
authorization,
|
|
412
|
+
system: systemAddress,
|
|
413
|
+
starbasePlayer: process.starbasePlayer.address,
|
|
414
|
+
upgradeProcess: process.address,
|
|
415
|
+
regionTracker,
|
|
416
|
+
game,
|
|
417
|
+
rewardRegistry: reward.registry,
|
|
418
|
+
rewardConfig: reward.rewardConfig,
|
|
419
|
+
...(loyalty.loyaltyEpoch === undefined
|
|
420
|
+
? {}
|
|
421
|
+
: { loyaltyEpoch: loyalty.loyaltyEpoch }),
|
|
422
|
+
...(loyalty.loyaltyContribution === undefined
|
|
423
|
+
? {}
|
|
424
|
+
: { loyaltyContribution: loyalty.loyaltyContribution }),
|
|
425
|
+
kingTracker,
|
|
426
|
+
factionOwnership,
|
|
427
|
+
});
|
|
428
|
+
const funding = planStorageFunding(ctx.programs, {
|
|
429
|
+
action: readStarbaseUpgradeStorageAction(ctx.programs, instruction, context.storageAccounts),
|
|
430
|
+
accounts: context.storageAccounts,
|
|
431
|
+
label: 'Starbase upgrade installation',
|
|
432
|
+
});
|
|
433
|
+
const material = `${String(process.resource.quantityRaw)} ${process.resource.name}`;
|
|
434
|
+
const outcome = installed === 0n
|
|
435
|
+
? `The Starbase no longer needs ${process.resource.name}, so the game returns all ${material} to the Starbase Player.`
|
|
436
|
+
: `The game installs ${String(installed)} ${process.resource.name}${returned > 0n ? ` and returns the other ${String(returned)}` : ''}${completes ? `, which completes the ${system.starbase.level} upgrade and raises the Starbase's level` : ''}.`;
|
|
437
|
+
const points = earns
|
|
438
|
+
? ` The installed material can earn up to ${String(installed * rate)} Loyalty Points in reward epoch ${String(reward.currentEpoch)}.`
|
|
439
|
+
: installed > 0n && rate > 0n
|
|
440
|
+
? ` This material earns Loyalty Points only for MUD, ONI or Ustur players, so the game may refuse this installation for an unaligned Starbase Player.`
|
|
441
|
+
: '';
|
|
442
|
+
const description = `Install the contribution of ${material} to the Starbase at ${system.name}, returning ${String(process.numCrew)} crew to Starbase Player ${process.starbasePlayer.address} and closing StarbaseUpgradeProcess ${process.address}. ${outcome}${points} The amount installed follows the Starbase's state when the transaction executes. ${funding.disclosure}`;
|
|
443
|
+
steps.push({
|
|
444
|
+
describes: description,
|
|
445
|
+
instruction,
|
|
446
|
+
signers: [authorization.authority],
|
|
447
|
+
});
|
|
448
|
+
return buildPlannerPlan(ctx.programs, {
|
|
449
|
+
kind: 'starbases.install-upgrade-resource',
|
|
450
|
+
preconditions: [
|
|
451
|
+
{
|
|
452
|
+
kind: 'starbase-upgrade-install-window',
|
|
453
|
+
address: process.address,
|
|
454
|
+
endsAtUnixSeconds: process.endsAtUnixSeconds,
|
|
455
|
+
describes: `StarbaseUpgradeProcess ${process.address} has ended when the installation executes, at or after ${String(process.endsAtUnixSeconds)}.`,
|
|
456
|
+
},
|
|
457
|
+
loyalty.guard,
|
|
458
|
+
await accountStatePrecondition(context.processRaw, `StarbaseUpgradeProcess ${process.address} keeps its material, crew and end time.`),
|
|
459
|
+
...loyalty.preconditions,
|
|
460
|
+
...rentState.guards,
|
|
461
|
+
{
|
|
462
|
+
kind: 'democracy-history',
|
|
463
|
+
address: history.intent.address,
|
|
464
|
+
intent: history.intent,
|
|
465
|
+
accounts: history.accounts,
|
|
466
|
+
describes: 'The canonical System history remains eligible on the observed chain day; initialized history and effective policy must still match. Close pending checkpoints and recreate the Plan if the day changes.',
|
|
467
|
+
},
|
|
468
|
+
funding.guard,
|
|
469
|
+
],
|
|
470
|
+
steps,
|
|
471
|
+
summary: `Install the ${process.resource.name} contribution to the Starbase at ${system.name}.`,
|
|
472
|
+
});
|
|
473
|
+
}
|
|
474
|
+
//# sourceMappingURL=upgrades.js.map
|