@aephia/atlas-kit 0.8.0-next.9 → 0.8.0
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 +596 -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 +14 -3
- package/dist/crafting/actions/index.d.ts.map +1 -1
- package/dist/crafting/actions/index.js +61 -25
- package/dist/crafting/actions/index.js.map +1 -1
- package/dist/crafting/index.d.ts +4 -1
- package/dist/crafting/index.d.ts.map +1 -1
- package/dist/crafting/index.js +1 -1
- 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 -0
- package/dist/internal/c4/claim-stake.d.ts.map +1 -1
- package/dist/internal/c4/claim-stake.js +5 -0
- 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 +42 -0
- package/dist/internal/c4/crafting-hab-storage.d.ts.map +1 -0
- package/dist/internal/c4/crafting-hab-storage.js +174 -0
- package/dist/internal/c4/crafting-hab-storage.js.map +1 -0
- package/dist/internal/c4/crafting-storage.d.ts +8 -0
- package/dist/internal/c4/crafting-storage.d.ts.map +1 -1
- package/dist/internal/c4/crafting-storage.js +18 -1
- package/dist/internal/c4/crafting-storage.js.map +1 -1
- package/dist/internal/c4/crafting.d.ts +8 -0
- 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 +27 -0
- package/dist/internal/c4/discriminators.d.ts.map +1 -1
- package/dist/internal/c4/discriminators.js +55 -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 +33 -4
- package/dist/internal/c4/fleet.d.ts.map +1 -1
- package/dist/internal/c4/fleet.js +27 -2
- package/dist/internal/c4/fleet.js.map +1 -1
- package/dist/internal/c4/game.d.ts +33 -0
- package/dist/internal/c4/game.d.ts.map +1 -1
- package/dist/internal/c4/game.js +46 -0
- package/dist/internal/c4/game.js.map +1 -1
- package/dist/internal/c4/governance.d.ts +72 -0
- package/dist/internal/c4/governance.d.ts.map +1 -1
- package/dist/internal/c4/governance.js +108 -3
- package/dist/internal/c4/governance.js.map +1 -1
- 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/planning/action-runtime.d.ts +3 -2
- package/dist/internal/planning/action-runtime.d.ts.map +1 -1
- package/dist/internal/planning/action-runtime.js +4 -3
- package/dist/internal/planning/action-runtime.js.map +1 -1
- package/dist/internal/planning/authorization-adapter.d.ts +363 -1
- package/dist/internal/planning/authorization-adapter.d.ts.map +1 -1
- package/dist/internal/planning/authorization-adapter.js +519 -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/crafting-storage-actions.d.ts +5 -3
- package/dist/internal/planning/crafting-storage-actions.d.ts.map +1 -1
- package/dist/internal/planning/crafting-storage-actions.js +66 -4
- package/dist/internal/planning/crafting-storage-actions.js.map +1 -1
- 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.js +1 -1
- package/dist/internal/planning/fleet-state.js.map +1 -1
- 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 +53 -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 +36 -3
- package/dist/internal/planning/storage-action-readers.js.map +1 -1
- package/dist/internal/planning/storage-actions.d.ts +5 -1
- package/dist/internal/planning/storage-actions.d.ts.map +1 -1
- package/dist/internal/planning/storage-actions.js +8 -1
- package/dist/internal/planning/storage-actions.js.map +1 -1
- package/dist/mining/actions/index.js +1 -1
- package/dist/mining/actions/index.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/index.d.ts +2 -0
- package/dist/starbases/actions/index.d.ts.map +1 -1
- package/dist/starbases/actions/index.js +2 -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 +75 -0
- package/dist/starbases/governance.d.ts.map +1 -1
- package/dist/starbases/governance.js +82 -1
- package/dist/starbases/governance.js.map +1 -1
- package/dist/starbases/index.d.ts +1 -1
- package/dist/starbases/index.d.ts.map +1 -1
- package/dist/starbases/index.js +1 -1
- package/dist/starbases/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -16,6 +16,7 @@ import { deriveProfileFactionAddress, profileFactionIdentityAccountDefinition, }
|
|
|
16
16
|
import { deriveStarbasePlayerAddress, starbasePlayerAccountDefinition, } from '../../internal/c4/starbase.js';
|
|
17
17
|
import { celestialBodyAccountDefinition, deriveCelestialBodyAddress, deriveStarSystemAddress, starSystemAccountDefinition, } from '../../internal/c4/world.js';
|
|
18
18
|
import { resolveXpRuntime } from '../../internal/planning/xp-runtime.js';
|
|
19
|
+
import { describeBuildingXpSettlement } from '../../internal/planning/building-xp.js';
|
|
19
20
|
import { readClaimStakeStorageAction } from '../../internal/planning/claim-stake-storage-actions.js';
|
|
20
21
|
import { RENT_ADDRESS } from '../../internal/planning/rent.js';
|
|
21
22
|
import { planStorageFunding } from '../../internal/planning/storage-actions.js';
|
|
@@ -25,11 +26,13 @@ import { readClaimStakeSystemCaps } from '../../internal/c4/claim-stake-system-c
|
|
|
25
26
|
import { readRegionBuildingPolicy } from '../../internal/c4/region-building-policy.js';
|
|
26
27
|
import { requireProfileStarbasePlayer } from '../../internal/planning/starbase-player-owner.js';
|
|
27
28
|
import { requireGameAddress } from '../../internal/game-context.js';
|
|
29
|
+
import { structurePlacementFee } from '../../internal/planning/placement-fee.js';
|
|
28
30
|
import { cargoStorageUnits, cargoStorageUnitsFloor, } from '../../internal/cargo.js';
|
|
29
|
-
import { adaptCancelClaimStakeBuildingChangesInstruction, adaptClaimStakeBuildingChangesInstruction, adaptDeconstructClaimStakeInstruction, adaptFinalizeClaimStakeBuildingChangesInstruction, adaptPlaceClaimStakeInstruction, adaptRecoverClaimStakeFleetTransferInstruction, adaptStartClaimStakeFleetTransferInstruction, adaptTopUpClaimStakeRentInstruction, readPlanAuthorization, } from '../../internal/planning/authorization-adapter.js';
|
|
31
|
+
import { adaptCancelClaimStakeBuildingChangesInstruction, adaptClaimStakeBuildingChangesInstruction, adaptDeconstructClaimStakeInstruction, adaptClaimStakeResourceProductionInstruction, adaptExitClaimStakeFleetTransferInstruction, adaptFinalizeClaimStakeBuildingChangesInstruction, adaptPlaceClaimStakeInstruction, adaptRecoverClaimStakeFleetTransferInstruction, adaptSettleClaimStakeBuildingXpInstruction, adaptStartClaimStakeFleetTransferInstruction, adaptTopUpClaimStakeRentInstruction, readPlanAuthorization, } from '../../internal/planning/authorization-adapter.js';
|
|
30
32
|
import { buildPlannerPlan } from '../../planning/plan-construction.js';
|
|
31
33
|
import { readFreshGameCargoDefinitions } from '../../registry/cargo.js';
|
|
32
|
-
import { listClaimStakeBuildingDefinitions, resolveCargo, } from '../../registry/index.js';
|
|
34
|
+
import { listClaimStakeBuildingDefinitions, resolveCargo, resolveClaimStakeDefinition, } from '../../registry/index.js';
|
|
35
|
+
import { CLOCK_ADDRESS, readClock, } from '../../internal/planning/faction-enrollment.js';
|
|
33
36
|
import { accountAbsentPrecondition, accountStatePrecondition, } from '../../internal/planning/account-state.js';
|
|
34
37
|
async function resolveClaimStakeXp(ctx, game, character) {
|
|
35
38
|
const xp = await resolveXpRuntime(ctx, {
|
|
@@ -188,6 +191,11 @@ function validateDeconstructOptions(value) {
|
|
|
188
191
|
exactKeys(options, 'options', ['authorization']);
|
|
189
192
|
return { authorization: readPlanAuthorization(options.authorization) };
|
|
190
193
|
}
|
|
194
|
+
function validateSettleBuildingXpOptions(value) {
|
|
195
|
+
const options = record(value, 'options');
|
|
196
|
+
exactKeys(options, 'options', ['authorization']);
|
|
197
|
+
return { authorization: readPlanAuthorization(options.authorization) };
|
|
198
|
+
}
|
|
191
199
|
function validateTopUpRentOptions(value) {
|
|
192
200
|
const options = record(value, 'options');
|
|
193
201
|
exactKeys(options, 'options', ['amount', 'authorization']);
|
|
@@ -237,16 +245,33 @@ function validateStartFleetTransferOptions(value) {
|
|
|
237
245
|
}
|
|
238
246
|
return { authorization, load, unload };
|
|
239
247
|
}
|
|
248
|
+
function unixSeconds(value, action) {
|
|
249
|
+
if (typeof value !== 'bigint' || value < 0n || value > U64_MAX) {
|
|
250
|
+
invalid('atUnixSeconds', value, `a non-negative bigint through ${String(U64_MAX)} (unsigned u64 Unix seconds)`, `Set atUnixSeconds to the explicit current Unix timestamp before retrying ${action}.`);
|
|
251
|
+
}
|
|
252
|
+
return value;
|
|
253
|
+
}
|
|
240
254
|
function validateRecoverFleetTransferOptions(value) {
|
|
241
255
|
const options = record(value, 'options');
|
|
242
256
|
exactKeys(options, 'options', ['atUnixSeconds', 'authorization']);
|
|
243
257
|
const authorization = readPlanAuthorization(options.authorization);
|
|
244
|
-
|
|
245
|
-
options.atUnixSeconds
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
258
|
+
return {
|
|
259
|
+
atUnixSeconds: unixSeconds(options.atUnixSeconds, 'recovery'),
|
|
260
|
+
authorization,
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
function validateExitFleetTransferOptions(value) {
|
|
264
|
+
const options = record(value, 'options');
|
|
265
|
+
exactKeys(options, 'options', ['atUnixSeconds', 'funder']);
|
|
266
|
+
return {
|
|
267
|
+
atUnixSeconds: unixSeconds(options.atUnixSeconds, 'the exit'),
|
|
268
|
+
funder: address(options.funder, 'funder'),
|
|
269
|
+
};
|
|
270
|
+
}
|
|
271
|
+
function validateSettleProductionOptions(value) {
|
|
272
|
+
const options = record(value, 'options');
|
|
273
|
+
exactKeys(options, 'options', ['funder']);
|
|
274
|
+
return { funder: address(options.funder, 'funder') };
|
|
250
275
|
}
|
|
251
276
|
function requireAccount(account, accountAddress, message) {
|
|
252
277
|
return account ?? fail(message, accountAddress);
|
|
@@ -475,7 +500,7 @@ export async function planPlaceClaimStake(ctx, body, player, input) {
|
|
|
475
500
|
fail(`Character ${character} may place up to tier ${String(modifiers.maxProductivePlotTier)}, below ${definition.name}'s tier ${definition.tier}. Research a higher plot tier or pick a lower tier.`, character);
|
|
476
501
|
if (currentCharacter.counts.claimStakes >= modifiers.maxProductivePlots)
|
|
477
502
|
fail(`Character ${character} already holds ${String(currentCharacter.counts.claimStakes)} of its ${String(modifiers.maxProductivePlots)} productive plots. Research more plots or deconstruct a Claim Stake.`, character);
|
|
478
|
-
const placementFee =
|
|
503
|
+
const placementFee = structurePlacementFee(currentDetails.baseClaimStakePlacementFee[level][tier].raw, definition.placementFeeMultiplier.raw);
|
|
479
504
|
const rentDeposit = options.initialRentAmount ?? 0n;
|
|
480
505
|
if (currentCharacter.atlasRaw < placementFee + rentDeposit)
|
|
481
506
|
fail(`Character ${character} has ${String(currentCharacter.atlasRaw)} raw ATLAS, below the ${String(placementFee)} raw placement fee plus ${String(rentDeposit)} raw initial rent. Add ATLAS or lower the rent, then retry.`, character);
|
|
@@ -555,10 +580,6 @@ async function planClaimStakeStorage(ctx, instruction, profile, known, label) {
|
|
|
555
580
|
/** The ATLAS placement fee: the Planet's U32F32 base fee for the Starbase
|
|
556
581
|
* level and tier, times the definition's U8F56 multiplier, rounded to the
|
|
557
582
|
* nearest raw unit with halves rounded up. */
|
|
558
|
-
function claimStakePlacementFee(baseFeeRaw, multiplierRaw) {
|
|
559
|
-
const product = ((baseFeeRaw << 24n) * multiplierRaw) >> 56n;
|
|
560
|
-
return (product + (1n << 55n)) >> 56n;
|
|
561
|
-
}
|
|
562
583
|
function quantities(buildings) {
|
|
563
584
|
return new Map(buildings.map(({ buildingId, quantity }) => [buildingId, quantity]));
|
|
564
585
|
}
|
|
@@ -1572,6 +1593,109 @@ export async function planTopUpClaimStakeRent(ctx, stake, input) {
|
|
|
1572
1593
|
summary: description,
|
|
1573
1594
|
});
|
|
1574
1595
|
}
|
|
1596
|
+
/** Plans settling the Building XP one owned Claim Stake has earned.
|
|
1597
|
+
*
|
|
1598
|
+
* The game first brings the stake's rent and production up to date, which
|
|
1599
|
+
* records any further paid operational time, then pays its recorded
|
|
1600
|
+
* operational work to the owner's Character as Building XP, up to the
|
|
1601
|
+
* Character's remaining Building allowance, and awards any claim Mining XP the
|
|
1602
|
+
* stake recorded. Work beyond the allowance is discarded rather than carried,
|
|
1603
|
+
* so the planner refuses while the allowance is empty, and it refuses a stake
|
|
1604
|
+
* that has recorded no work and is not operational. The Plan states the
|
|
1605
|
+
* recorded XP and the allowance; the exact grant remains chain-authoritative.
|
|
1606
|
+
*
|
|
1607
|
+
* Requires Disabled rent, the stake's current System generation and the
|
|
1608
|
+
* Profile's Starbase Player there from the current Starbase.
|
|
1609
|
+
* Bringing a large structure up to date can take more than the default
|
|
1610
|
+
* 200,000 compute units, so simulate first and raise `computeUnitLimit` when
|
|
1611
|
+
* assembling if needed.
|
|
1612
|
+
*
|
|
1613
|
+
* @example
|
|
1614
|
+
* ```ts
|
|
1615
|
+
* declare const ctx: SageContext;
|
|
1616
|
+
* declare const stake: ClaimStakeSnapshot;
|
|
1617
|
+
* declare const authorization: PlanAuthorization;
|
|
1618
|
+
* const plan = await planSettleClaimStakeBuildingXp(ctx, stake, {
|
|
1619
|
+
* authorization,
|
|
1620
|
+
* });
|
|
1621
|
+
* console.log(plan.describe());
|
|
1622
|
+
* ```
|
|
1623
|
+
*/
|
|
1624
|
+
export async function planSettleClaimStakeBuildingXp(ctx, stake, input) {
|
|
1625
|
+
const options = validateSettleBuildingXpOptions(input);
|
|
1626
|
+
const game = requireGameAddress(ctx);
|
|
1627
|
+
const { profile } = options.authorization;
|
|
1628
|
+
const character = await requireOwnedStake(ctx.programs, stake, game, profile);
|
|
1629
|
+
const currencyCache = await claimStakeCurrencyCache(ctx.programs, game);
|
|
1630
|
+
const action = 'the Building XP settlement';
|
|
1631
|
+
const [{ bodyAccount, currentBody, currentStake, extraAccounts: [characterCandidate, cacheCandidate], stakeAccount, }, rent, xp,] = await Promise.all([
|
|
1632
|
+
readOwnedStake(ctx, stake, action, [character, currencyCache]),
|
|
1633
|
+
requireDisabledStakeRent(ctx, game, stake.address, action),
|
|
1634
|
+
resolveClaimStakeXp(ctx, game, character),
|
|
1635
|
+
]);
|
|
1636
|
+
if (!sameOwnedStake(currentStake, stake, game, profile)) {
|
|
1637
|
+
fail(`Claim Stake ${stake.address} changed or does not match its loaded ownership, Body, definitions, buildings, or System generation. Refresh it and retry ${action}.`, stake.address);
|
|
1638
|
+
}
|
|
1639
|
+
// A Character's XP runtime names both accounts or refuses the Character.
|
|
1640
|
+
const xpBudget = xp.accounts.xpBudget;
|
|
1641
|
+
const xpBudgetConfig = xp.accounts.xpBudgetConfig;
|
|
1642
|
+
const { system } = await requireStakePlanet(ctx.programs, currentBody, stake, game, action);
|
|
1643
|
+
// The settlement writes the Character's XP, which other actions change
|
|
1644
|
+
// too, so the Plan checks its identity without pinning its state.
|
|
1645
|
+
requireProfileCharacter(ctx.programs, characterCandidate, character, profile, game, action);
|
|
1646
|
+
const [cacheGuard, { currentPlayer, currentSystem, player, playerAccount, systemAccount },] = await Promise.all([
|
|
1647
|
+
requireCurrencyCache(ctx.programs, cacheCandidate, currencyCache, game, action, 'planSettleClaimStakeBuildingXp'),
|
|
1648
|
+
readStakeStarbase(ctx, stake, game, system, character, profile, action),
|
|
1649
|
+
]);
|
|
1650
|
+
if (currentPlayer.sequenceId !== currentSystem.sequenceId)
|
|
1651
|
+
fail(`Starbase Player ${player} was registered at an earlier Starbase in Star System ${system}, which the game treats as destroyed. Register at the current Starbase and retry ${action}.`, player);
|
|
1652
|
+
const settlement = await describeBuildingXpSettlement(ctx, {
|
|
1653
|
+
structure: `Claim Stake ${stake.address}`,
|
|
1654
|
+
game,
|
|
1655
|
+
character,
|
|
1656
|
+
xpBudget,
|
|
1657
|
+
xpBudgetConfig,
|
|
1658
|
+
recorded: currentStake.operationalXp,
|
|
1659
|
+
operational: currentStake.state.kind === 'active' &&
|
|
1660
|
+
currentStake.constructionRemainingSeconds === 0n,
|
|
1661
|
+
});
|
|
1662
|
+
const description = `Settle Claim Stake ${stake.address}'s Building XP after bringing its rent and production up to date. ${settlement.description} Any claim Mining XP the stake recorded is awarded too.`;
|
|
1663
|
+
return buildPlannerPlan(ctx.programs, {
|
|
1664
|
+
kind: 'claim-stakes.settle-building-xp',
|
|
1665
|
+
preconditions: [
|
|
1666
|
+
...(await Promise.all([
|
|
1667
|
+
accountStatePrecondition(stakeAccount, `Claim Stake ${stake.address} retains its ownership, buildings, rent, production, lifecycle state, recorded Building work, Body, and System generation.`),
|
|
1668
|
+
planetPrecondition(bodyAccount, system),
|
|
1669
|
+
systemPrecondition(systemAccount, currentSystem.name),
|
|
1670
|
+
playerPrecondition(playerAccount, player),
|
|
1671
|
+
])),
|
|
1672
|
+
cacheGuard,
|
|
1673
|
+
xp.guard,
|
|
1674
|
+
settlement.guard,
|
|
1675
|
+
...rent.guards,
|
|
1676
|
+
],
|
|
1677
|
+
steps: [
|
|
1678
|
+
{
|
|
1679
|
+
describes: description,
|
|
1680
|
+
instruction: adaptSettleClaimStakeBuildingXpInstruction(ctx.programs, {
|
|
1681
|
+
authorization: options.authorization,
|
|
1682
|
+
celestialBody: stake.body.address,
|
|
1683
|
+
character,
|
|
1684
|
+
claimStakeInstance: stake.address,
|
|
1685
|
+
currencyCache,
|
|
1686
|
+
game,
|
|
1687
|
+
...rent.accounts,
|
|
1688
|
+
systemAndStarbasePlayerStarbasePlayer: player,
|
|
1689
|
+
systemAndStarbasePlayerSystem: system,
|
|
1690
|
+
xpBudget,
|
|
1691
|
+
xpBudgetConfig,
|
|
1692
|
+
}),
|
|
1693
|
+
signers: [options.authorization.authority],
|
|
1694
|
+
},
|
|
1695
|
+
],
|
|
1696
|
+
summary: description,
|
|
1697
|
+
});
|
|
1698
|
+
}
|
|
1575
1699
|
function cargoAmount(values, cargoId) {
|
|
1576
1700
|
return values.find((item) => item.cargoId === cargoId)?.amount ?? 0n;
|
|
1577
1701
|
}
|
|
@@ -1720,9 +1844,12 @@ export async function planStartClaimStakeFleetTransfer(ctx, fleet, stake, input)
|
|
|
1720
1844
|
if (fleet.state.kind !== 'idle') {
|
|
1721
1845
|
fail(`Fleet ${fleet.name} is ${fleet.state.kind}, but starting a Claim Stake transfer requires an idle Fleet. Return it to idle state, refresh it, and retry.`, fleet.address);
|
|
1722
1846
|
}
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1847
|
+
// The game starts a transfer only for a Fleet with normalized crew: at
|
|
1848
|
+
// least the crew its ships require.
|
|
1849
|
+
const crewFailure = (crew, required) => `Fleet ${fleet.name} has ${String(crew)} crew but needs ${String(required)}, and the game starts a Claim Stake transfer only for a Fleet with its required crew. Load crew, refresh it, and retry.`;
|
|
1850
|
+
if (!Number.isSafeInteger(fleet.crewCount) ||
|
|
1851
|
+
fleet.crewCount < fleet.stats.misc.requiredCrew) {
|
|
1852
|
+
fail(crewFailure(fleet.crewCount, fleet.stats.misc.requiredCrew), fleet.address);
|
|
1726
1853
|
}
|
|
1727
1854
|
if (stake.state.kind !== 'active') {
|
|
1728
1855
|
fail(`Claim Stake ${stake.address} is ${stake.state.kind}, but starting a Fleet transfer requires an active Claim Stake. Activate or restore it, refresh it, and retry.`, stake.address);
|
|
@@ -1736,8 +1863,8 @@ export async function planStartClaimStakeFleetTransfer(ctx, fleet, stake, input)
|
|
|
1736
1863
|
const fleetAccount = requireAccount(fleetCandidate, fleet.address, `Fleet ${fleet.name} is missing. Refresh it and retry the Fleet transfer.`);
|
|
1737
1864
|
const currentFleet = fleetAccountDefinition.decode(fleetAccount, ctx.programs);
|
|
1738
1865
|
if (!Number.isSafeInteger(currentFleet.crewCount) ||
|
|
1739
|
-
currentFleet.crewCount
|
|
1740
|
-
fail(crewFailure, fleet.address);
|
|
1866
|
+
currentFleet.crewCount < currentFleet.stats.misc.requiredCrew) {
|
|
1867
|
+
fail(crewFailure(currentFleet.crewCount, currentFleet.stats.misc.requiredCrew), fleet.address);
|
|
1741
1868
|
}
|
|
1742
1869
|
if (!sameTransferFleet(currentFleet, fleet, game, profile) ||
|
|
1743
1870
|
currentFleet.state.kind !== 'idle' ||
|
|
@@ -1838,6 +1965,93 @@ export async function planStartClaimStakeFleetTransfer(ctx, fleet, stake, input)
|
|
|
1838
1965
|
summary: description,
|
|
1839
1966
|
});
|
|
1840
1967
|
}
|
|
1968
|
+
/** Proves from fresh state why a queued Claim Stake transfer cannot move its
|
|
1969
|
+
* cargo: a source shortfall, an invalid queued cargo id, or a destination
|
|
1970
|
+
* overflow. `reason` is undefined when the transfer looks executable.
|
|
1971
|
+
*
|
|
1972
|
+
* Recovery judges the stored cargo exactly as it stands. The normal exit
|
|
1973
|
+
* (`accrues`) first accrues the stake's production, so there a stored
|
|
1974
|
+
* Claim Stake shortfall of a resource the stake produces, or a stake storage
|
|
1975
|
+
* overflow while it consumes a stored resource, is only `conditional`: the cargo may
|
|
1976
|
+
* still move after accrual. Fleet-side shortfalls and overflows, invalid
|
|
1977
|
+
* cargo ids, and stake shortfalls of resources it does not produce stay
|
|
1978
|
+
* definite. Neither mode enforces the stake's separate fuel storage. */
|
|
1979
|
+
async function transferBlocker(ctx, game, currentFleet, state, currentStake, action, accrues = false) {
|
|
1980
|
+
const rates = currentStake.production.netResources;
|
|
1981
|
+
const produces = (cargoId) => accrues &&
|
|
1982
|
+
rates.some((rate) => rate.cargoId === cargoId && rate.ratePerSecondRaw > 0n);
|
|
1983
|
+
let reason;
|
|
1984
|
+
let conditional;
|
|
1985
|
+
for (const request of state.load) {
|
|
1986
|
+
const available = cargoAmount(currentStake.production.cargoPod.amounts, request.cargoId);
|
|
1987
|
+
if (available < request.amount) {
|
|
1988
|
+
const shortfall = `Claim Stake source shortfall for cargo id ${String(request.cargoId)}`;
|
|
1989
|
+
if (produces(request.cargoId))
|
|
1990
|
+
conditional ??= shortfall;
|
|
1991
|
+
else {
|
|
1992
|
+
reason = shortfall;
|
|
1993
|
+
break;
|
|
1994
|
+
}
|
|
1995
|
+
}
|
|
1996
|
+
}
|
|
1997
|
+
if (reason === undefined) {
|
|
1998
|
+
for (const request of state.unload) {
|
|
1999
|
+
const available = fleetCargoHoldAmount(currentFleet, request.cargoId);
|
|
2000
|
+
if (available < request.amount) {
|
|
2001
|
+
reason = `Fleet source shortfall for cargo id ${String(request.cargoId)}`;
|
|
2002
|
+
break;
|
|
2003
|
+
}
|
|
2004
|
+
}
|
|
2005
|
+
}
|
|
2006
|
+
let gameAccount;
|
|
2007
|
+
let queuedDefinitions = new Map();
|
|
2008
|
+
if (reason === undefined) {
|
|
2009
|
+
const cargoIds = [
|
|
2010
|
+
...new Set([...state.load, ...state.unload].map(({ cargoId }) => cargoId)),
|
|
2011
|
+
];
|
|
2012
|
+
const freshGame = (await readFreshGameCargoDefinitions(ctx)) ??
|
|
2013
|
+
fail(`Game ${game} is missing. Refresh the configured Game and retry ${action}.`, game);
|
|
2014
|
+
gameAccount = freshGame.account;
|
|
2015
|
+
queuedDefinitions = new Map(freshGame.data.definitions.map((definition) => [
|
|
2016
|
+
definition.id,
|
|
2017
|
+
definition,
|
|
2018
|
+
]));
|
|
2019
|
+
const invalidCargoId = cargoIds.find((cargoId) => !queuedDefinitions.has(cargoId));
|
|
2020
|
+
if (invalidCargoId !== undefined) {
|
|
2021
|
+
reason = `invalid queued cargo id ${String(invalidCargoId)}`;
|
|
2022
|
+
}
|
|
2023
|
+
}
|
|
2024
|
+
if (reason === undefined) {
|
|
2025
|
+
// Every queued load, including Fuel and Ammunition, targets the cargo hold.
|
|
2026
|
+
const loadCargoStorage = state.load.reduce((total, { amount, cargoId }) => total +
|
|
2027
|
+
cargoStorageUnits(amount, queuedDefinitions.get(cargoId).storageCost), 0n);
|
|
2028
|
+
// Only an overflow the unloads certainly cause, after the loads free
|
|
2029
|
+
// their storage, proves the stake side non-executable.
|
|
2030
|
+
const unloadStorage = state.unload.reduce((total, { amount, cargoId }) => total +
|
|
2031
|
+
cargoStorageUnitsFloor(amount, queuedDefinitions.get(cargoId).storageCost), 0n);
|
|
2032
|
+
if (currentFleet.cargoHold.storageCost + loadCargoStorage >
|
|
2033
|
+
currentFleet.stats.cargo.cargoCapacity) {
|
|
2034
|
+
reason = 'Fleet cargo destination overflow';
|
|
2035
|
+
}
|
|
2036
|
+
else if (currentStake.production.cargoPod.storageCost -
|
|
2037
|
+
loadCargoStorage +
|
|
2038
|
+
unloadStorage >
|
|
2039
|
+
currentStake.production.resourceCapacityRaw) {
|
|
2040
|
+
const overflow = 'Claim Stake resource storage overflow';
|
|
2041
|
+
// Consuming a stored resource during accrual can free stake storage
|
|
2042
|
+
// before the exit moves cargo.
|
|
2043
|
+
if (accrues &&
|
|
2044
|
+
rates.some((rate) => rate.ratePerSecondRaw < 0n &&
|
|
2045
|
+
cargoAmount(currentStake.production.cargoPod.amounts, rate.cargoId) > 0n))
|
|
2046
|
+
conditional ??= overflow;
|
|
2047
|
+
else
|
|
2048
|
+
reason = overflow;
|
|
2049
|
+
}
|
|
2050
|
+
}
|
|
2051
|
+
return reason === undefined && conditional !== undefined
|
|
2052
|
+
? { conditional, gameAccount, reason }
|
|
2053
|
+
: { gameAccount, reason };
|
|
2054
|
+
}
|
|
1841
2055
|
/** Plans owner-authorized recovery of one provably non-executable Claim Stake transfer.
|
|
1842
2056
|
*
|
|
1843
2057
|
* Recovery is available only after the explicit transfer lock time and only
|
|
@@ -1912,60 +2126,7 @@ export async function planRecoverClaimStakeFleetTransfer(ctx, fleet, stake, inpu
|
|
|
1912
2126
|
if (!sameTransferStake(currentStake, stake, game, options.authorization.profile)) {
|
|
1913
2127
|
fail(`Claim Stake ${stake.address} changed or no longer matches its loaded owner, Game, Body, active state, resources, capacity, or System generation. Refresh it and retry Fleet transfer recovery.`, stake.address);
|
|
1914
2128
|
}
|
|
1915
|
-
|
|
1916
|
-
for (const request of currentFleet.state.load) {
|
|
1917
|
-
const available = cargoAmount(currentStake.production.cargoPod.amounts, request.cargoId);
|
|
1918
|
-
if (available < request.amount) {
|
|
1919
|
-
reason = `Claim Stake source shortfall for cargo id ${String(request.cargoId)}`;
|
|
1920
|
-
break;
|
|
1921
|
-
}
|
|
1922
|
-
}
|
|
1923
|
-
if (reason === undefined) {
|
|
1924
|
-
for (const request of currentFleet.state.unload) {
|
|
1925
|
-
const available = fleetCargoHoldAmount(currentFleet, request.cargoId);
|
|
1926
|
-
if (available < request.amount) {
|
|
1927
|
-
reason = `Fleet source shortfall for cargo id ${String(request.cargoId)}`;
|
|
1928
|
-
break;
|
|
1929
|
-
}
|
|
1930
|
-
}
|
|
1931
|
-
}
|
|
1932
|
-
let gameAccount;
|
|
1933
|
-
let queuedDefinitions = new Map();
|
|
1934
|
-
if (reason === undefined) {
|
|
1935
|
-
const cargoIds = [
|
|
1936
|
-
...new Set([...currentFleet.state.load, ...currentFleet.state.unload].map(({ cargoId }) => cargoId)),
|
|
1937
|
-
];
|
|
1938
|
-
const freshGame = (await readFreshGameCargoDefinitions(ctx)) ??
|
|
1939
|
-
fail(`Game ${game} is missing. Refresh the configured Game and retry Claim Stake transfer recovery.`, game);
|
|
1940
|
-
gameAccount = freshGame.account;
|
|
1941
|
-
queuedDefinitions = new Map(freshGame.data.definitions.map((definition) => [
|
|
1942
|
-
definition.id,
|
|
1943
|
-
definition,
|
|
1944
|
-
]));
|
|
1945
|
-
const invalidCargoId = cargoIds.find((cargoId) => !queuedDefinitions.has(cargoId));
|
|
1946
|
-
if (invalidCargoId !== undefined) {
|
|
1947
|
-
reason = `invalid queued cargo id ${String(invalidCargoId)}`;
|
|
1948
|
-
}
|
|
1949
|
-
}
|
|
1950
|
-
if (reason === undefined) {
|
|
1951
|
-
// Every queued load, including Fuel and Ammunition, targets the cargo hold.
|
|
1952
|
-
const loadCargoStorage = currentFleet.state.load.reduce((total, { amount, cargoId }) => total +
|
|
1953
|
-
cargoStorageUnits(amount, queuedDefinitions.get(cargoId).storageCost), 0n);
|
|
1954
|
-
// Only an overflow the unloads certainly cause, after the loads free
|
|
1955
|
-
// their storage, proves the stake side non-executable.
|
|
1956
|
-
const unloadStorage = currentFleet.state.unload.reduce((total, { amount, cargoId }) => total +
|
|
1957
|
-
cargoStorageUnitsFloor(amount, queuedDefinitions.get(cargoId).storageCost), 0n);
|
|
1958
|
-
if (currentFleet.cargoHold.storageCost + loadCargoStorage >
|
|
1959
|
-
currentFleet.stats.cargo.cargoCapacity) {
|
|
1960
|
-
reason = 'Fleet cargo destination overflow';
|
|
1961
|
-
}
|
|
1962
|
-
else if (currentStake.production.cargoPod.storageCost -
|
|
1963
|
-
loadCargoStorage +
|
|
1964
|
-
unloadStorage >
|
|
1965
|
-
currentStake.production.resourceCapacityRaw) {
|
|
1966
|
-
reason = 'Claim Stake resource storage overflow';
|
|
1967
|
-
}
|
|
1968
|
-
}
|
|
2129
|
+
const { gameAccount, reason } = await transferBlocker(ctx, game, currentFleet, currentFleet.state, currentStake, 'Claim Stake transfer recovery');
|
|
1969
2130
|
if (reason === undefined) {
|
|
1970
2131
|
fail(`Fleet ${fleet.name}'s Claim Stake transfer is currently executable. Use the permissionless normal exit path; recovery is only for a locally proven non-executable transfer.`, fleet.address);
|
|
1971
2132
|
}
|
|
@@ -1996,4 +2157,331 @@ export async function planRecoverClaimStakeFleetTransfer(ctx, fleet, stake, inpu
|
|
|
1996
2157
|
summary: description,
|
|
1997
2158
|
});
|
|
1998
2159
|
}
|
|
2160
|
+
/** Plans the permissionless normal exit of one elapsed Claim Stake Fleet transfer.
|
|
2161
|
+
*
|
|
2162
|
+
* The exit completes a transfer started with
|
|
2163
|
+
* {@link planStartClaimStakeFleetTransfer}: the game accrues the Claim Stake's
|
|
2164
|
+
* production, moves the queued loads and unloads, and returns the Fleet to
|
|
2165
|
+
* idle. Any signer may exit an elapsed transfer, so the Plan's only signer is
|
|
2166
|
+
* the `funder`, which pays any rent shortfall of the Fleet and Claim Stake and
|
|
2167
|
+
* receives any rent they free.
|
|
2168
|
+
*
|
|
2169
|
+
* The planner requires the explicit timestamp to have reached the transfer's
|
|
2170
|
+
* end, and the Plan carries a guard that execution checks against the chain
|
|
2171
|
+
* Clock and the Fleet's stored end before signing: before the end, the game
|
|
2172
|
+
* leaves the Fleet in its transfer while the funder still pays the fee. It
|
|
2173
|
+
* requires the Fleet's required crew, the same owner Profile for the Fleet
|
|
2174
|
+
* and the active Claim Stake, the canonical Planet, System, active Starbase
|
|
2175
|
+
* and owner Starbase Player, and Disabled rent, as the transfer start does.
|
|
2176
|
+
*
|
|
2177
|
+
* When fresh state shows the queued cargo cannot move (a Fleet-side shortfall
|
|
2178
|
+
* or overflow, an invalid queued cargo id, or a Claim Stake shortfall of a
|
|
2179
|
+
* resource the stake does not produce), the Plan still exits: the game then
|
|
2180
|
+
* returns the Fleet to idle without moving cargo, and the description says
|
|
2181
|
+
* so. The game accrues the stake's production before moving cargo, so a
|
|
2182
|
+
* stored shortfall of a resource the stake produces, or a stake storage
|
|
2183
|
+
* overflow while it consumes a stored resource, is described as depending on that
|
|
2184
|
+
* accrual. The game also limits Fuel to the stake's separate fuel storage,
|
|
2185
|
+
* which this Plan does not enforce; if the cargo no longer fits then, the exit
|
|
2186
|
+
* likewise moves nothing. Use {@link planRecoverClaimStakeFleetTransfer} only
|
|
2187
|
+
* when the owner wants to abandon a non-executable transfer instead.
|
|
2188
|
+
*
|
|
2189
|
+
* @example
|
|
2190
|
+
* ```ts
|
|
2191
|
+
* declare const ctx: SageContext;
|
|
2192
|
+
* declare const fleet: FleetSnapshot;
|
|
2193
|
+
* declare const stake: ClaimStakeSnapshot;
|
|
2194
|
+
* declare const funder: Address;
|
|
2195
|
+
* const plan = await planExitClaimStakeFleetTransfer(ctx, fleet, stake, {
|
|
2196
|
+
* atUnixSeconds: 1_700_000_100n,
|
|
2197
|
+
* funder,
|
|
2198
|
+
* });
|
|
2199
|
+
* console.log(plan.describe());
|
|
2200
|
+
* ```
|
|
2201
|
+
*/
|
|
2202
|
+
export async function planExitClaimStakeFleetTransfer(ctx, fleet, stake, input) {
|
|
2203
|
+
const options = validateExitFleetTransferOptions(input);
|
|
2204
|
+
const game = requireGameAddress(ctx);
|
|
2205
|
+
if (fleet.game !== game || stake.game !== game) {
|
|
2206
|
+
fail(`Fleet ${fleet.address} and Claim Stake ${stake.address} must both belong to configured Game ${game}. Refresh both snapshots through this context and retry the exit.`, fleet.game !== game ? fleet.address : stake.address);
|
|
2207
|
+
}
|
|
2208
|
+
if (fleet.state.kind !== 'claimStakeTransfer') {
|
|
2209
|
+
fail(`Fleet ${fleet.name} is ${fleet.state.kind}, not in a Claim Stake transfer. Refresh it and exit only a running Claim Stake transfer.`, fleet.address);
|
|
2210
|
+
}
|
|
2211
|
+
if (fleet.state.claimStake.address !== stake.address ||
|
|
2212
|
+
fleet.state.planet.address !== stake.body.address) {
|
|
2213
|
+
fail(`Fleet ${fleet.name}'s Claim Stake transfer does not reference Claim Stake ${stake.address} and its Body ${stake.body.address}. Supply the transfer's current Claim Stake snapshot and retry the exit.`, fleet.address);
|
|
2214
|
+
}
|
|
2215
|
+
if (options.atUnixSeconds < fleet.state.endAtUnixSeconds) {
|
|
2216
|
+
fail(`Fleet ${fleet.name}'s Claim Stake transfer has not ended at Unix timestamp ${String(options.atUnixSeconds)}; it ends at ${String(fleet.state.endAtUnixSeconds)}. Wait until it ends, provide a current timestamp, and retry the exit.`, fleet.address);
|
|
2217
|
+
}
|
|
2218
|
+
const profile = fleet.ownerProfile.address;
|
|
2219
|
+
if (stake.state.kind !== 'active') {
|
|
2220
|
+
fail(`Claim Stake ${stake.address} is ${stake.state.kind}, but Atlas Kit plans the normal exit only for an active Claim Stake. Restore the stake's rent or finish its design, refresh it, and retry the exit.`, stake.address);
|
|
2221
|
+
}
|
|
2222
|
+
const character = await requireOwnedStake(ctx.programs, stake, game, profile);
|
|
2223
|
+
const action = 'the Claim Stake transfer exit';
|
|
2224
|
+
const [{ bodyAccount, currentBody, currentStake, extraAccounts: [fleetCandidate], stakeAccount, }, rent,] = await Promise.all([
|
|
2225
|
+
readOwnedStake(ctx, stake, action, [fleet.address]),
|
|
2226
|
+
requireDisabledStakeRent(ctx, game, stake.address, action),
|
|
2227
|
+
]);
|
|
2228
|
+
const fleetAccount = requireAccount(fleetCandidate, fleet.address, `Fleet ${fleet.name} is missing. Refresh it and retry the Claim Stake transfer exit.`);
|
|
2229
|
+
const currentFleet = fleetAccountDefinition.decode(fleetAccount, ctx.programs);
|
|
2230
|
+
if (!sameTransferFleet(currentFleet, fleet, game, profile) ||
|
|
2231
|
+
currentFleet.state.kind !== 'claimStakeTransfer' ||
|
|
2232
|
+
currentFleet.state.claimStake !== stake.address ||
|
|
2233
|
+
currentFleet.state.planet !== stake.body.address ||
|
|
2234
|
+
currentFleet.state.endAtUnixSeconds !== fleet.state.endAtUnixSeconds ||
|
|
2235
|
+
!sameCargoAmounts(currentFleet.state.load, fleet.state.load) ||
|
|
2236
|
+
!sameCargoAmounts(currentFleet.state.unload, fleet.state.unload) ||
|
|
2237
|
+
(await deriveFleetAddress(ctx.programs, currentFleet)) !== fleet.address) {
|
|
2238
|
+
fail(`Fleet ${fleet.name} changed or no longer matches its loaded owner, Game, canonical address, Claim Stake transfer snapshot, cargo, or capacities. Refresh it and retry the exit.`, fleet.address);
|
|
2239
|
+
}
|
|
2240
|
+
if (currentFleet.crewCount < currentFleet.stats.misc.requiredCrew) {
|
|
2241
|
+
fail(`Fleet ${fleet.name} has ${String(currentFleet.crewCount)} crew but needs ${String(currentFleet.stats.misc.requiredCrew)}, and the game exits a Claim Stake transfer only for a Fleet with its required crew. Load crew, refresh it, and retry.`, fleet.address);
|
|
2242
|
+
}
|
|
2243
|
+
if (!sameTransferStake(currentStake, stake, game, profile)) {
|
|
2244
|
+
fail(`Claim Stake ${stake.address} changed or no longer matches its loaded owner, Game, Body, active state, resources, capacity, or System generation. Refresh it and retry the exit.`, stake.address);
|
|
2245
|
+
}
|
|
2246
|
+
const { system } = await requireStakePlanet(ctx.programs, currentBody, stake, game, action);
|
|
2247
|
+
const currencyCache = await claimStakeCurrencyCache(ctx.programs, game);
|
|
2248
|
+
const { currentSystem, extraAccounts: [currencyCandidate], player, playerAccount, systemAccount, } = await readStakeStarbase(ctx, stake, game, system, character, profile, action, [currencyCache]);
|
|
2249
|
+
const currencyGuard = await requireCurrencyCache(ctx.programs, currencyCandidate, currencyCache, game, action, 'Claim Stake Fleet transfer exit');
|
|
2250
|
+
const { conditional, gameAccount, reason } = await transferBlocker(ctx, game, currentFleet, currentFleet.state, currentStake, action, true);
|
|
2251
|
+
const xp = await resolveClaimStakeXp(ctx, game);
|
|
2252
|
+
const queued = [
|
|
2253
|
+
...describeCargoRequests('load', currentFleet.state.load.map(({ amount, cargoId }) => ({
|
|
2254
|
+
amount,
|
|
2255
|
+
cargoId,
|
|
2256
|
+
}))),
|
|
2257
|
+
...describeCargoRequests('unload', currentFleet.state.unload.map(({ amount, cargoId }) => ({
|
|
2258
|
+
amount,
|
|
2259
|
+
cargoId,
|
|
2260
|
+
}))),
|
|
2261
|
+
];
|
|
2262
|
+
const outcome = reason !== undefined
|
|
2263
|
+
? `Fresh state shows the queued cargo (${queued.join('; ')}) cannot move (${reason}), so the game is expected to return the Fleet to idle without moving cargo.`
|
|
2264
|
+
: conditional !== undefined
|
|
2265
|
+
? `The stored Claim Stake state shows a ${conditional}, but the game accrues the stake's production first, so the queued cargo (${queued.join('; ')}) moves only if that accrual resolves it; otherwise the Fleet returns to idle without moving cargo. This Plan cannot tell which; the exit returns the Fleet to idle either way.`
|
|
2266
|
+
: `The game accrues the Claim Stake's production, then moves the queued cargo (${queued.join('; ')}) and returns the Fleet to idle. It checks the stake's storage again after accruing production and limits Fuel to the stake's separate fuel storage, which this Plan does not enforce; if the cargo no longer fits, the Fleet returns to idle without moving cargo.`;
|
|
2267
|
+
const description = `Exit fleet ${fleet.name}'s elapsed transfer with Claim Stake ${stake.address}. ${outcome} Funder ${options.funder} signs, pays any rent shortfall of the Fleet and Claim Stake and receives any rent they free.`;
|
|
2268
|
+
return buildPlannerPlan(ctx.programs, {
|
|
2269
|
+
kind: 'claim-stakes.exit-fleet-transfer',
|
|
2270
|
+
preconditions: [
|
|
2271
|
+
xp.guard,
|
|
2272
|
+
...(await Promise.all([
|
|
2273
|
+
accountStatePrecondition(fleetAccount, `Fleet ${fleet.name} retains its owner, normalized crew, cargo and exact elapsed Claim Stake transfer.`),
|
|
2274
|
+
accountStatePrecondition(stakeAccount, `Claim Stake ${stake.address} retains its owner, active state, cargo, capacity, Body, and System generation.`),
|
|
2275
|
+
planetPrecondition(bodyAccount, system),
|
|
2276
|
+
systemPrecondition(systemAccount, currentSystem.name),
|
|
2277
|
+
playerPrecondition(playerAccount, player),
|
|
2278
|
+
...(gameAccount === undefined
|
|
2279
|
+
? []
|
|
2280
|
+
: [
|
|
2281
|
+
accountStatePrecondition(gameAccount, `Game ${game} retains the cargo definitions used to describe the exit.`),
|
|
2282
|
+
]),
|
|
2283
|
+
])),
|
|
2284
|
+
currencyGuard,
|
|
2285
|
+
...rent.guards,
|
|
2286
|
+
{
|
|
2287
|
+
kind: 'claim-stake-transfer-exit-window',
|
|
2288
|
+
address: fleet.address,
|
|
2289
|
+
endsAtUnixSeconds: currentFleet.state.endAtUnixSeconds,
|
|
2290
|
+
describes: `The chain Clock has reached Fleet ${fleet.name}'s transfer end ${String(currentFleet.state.endAtUnixSeconds)} when the exit executes; before then the game leaves the Fleet in its transfer.`,
|
|
2291
|
+
},
|
|
2292
|
+
],
|
|
2293
|
+
steps: [
|
|
2294
|
+
{
|
|
2295
|
+
describes: description,
|
|
2296
|
+
instruction: adaptExitClaimStakeFleetTransferInstruction(ctx.programs, {
|
|
2297
|
+
celestialBody: stake.body.address,
|
|
2298
|
+
claimStakeInstance: stake.address,
|
|
2299
|
+
currencyCache,
|
|
2300
|
+
fleet: fleet.address,
|
|
2301
|
+
funder: options.funder,
|
|
2302
|
+
game,
|
|
2303
|
+
profile,
|
|
2304
|
+
...rent.accounts,
|
|
2305
|
+
systemAndStarbasePlayerStarbasePlayer: player,
|
|
2306
|
+
systemAndStarbasePlayerSystem: system,
|
|
2307
|
+
}),
|
|
2308
|
+
signers: [options.funder],
|
|
2309
|
+
},
|
|
2310
|
+
],
|
|
2311
|
+
summary: description,
|
|
2312
|
+
});
|
|
2313
|
+
}
|
|
2314
|
+
/** The latest Unix second a JavaScript Date can represent. */
|
|
2315
|
+
const DATE_LIMIT_SECONDS = 8640000000000n;
|
|
2316
|
+
/** A Unix time as an ISO-8601 instant, or as Unix seconds beyond the range a
|
|
2317
|
+
* Date can represent, which a long rent balance can reach. */
|
|
2318
|
+
function instant(unixSeconds) {
|
|
2319
|
+
return unixSeconds > DATE_LIMIT_SECONDS || unixSeconds < -DATE_LIMIT_SECONDS
|
|
2320
|
+
? `Unix time ${String(unixSeconds)}`
|
|
2321
|
+
: new Date(Number(unixSeconds) * 1000).toISOString();
|
|
2322
|
+
}
|
|
2323
|
+
/** The legacy rent a Claim Stake pays per second, as a raw rate with 56
|
|
2324
|
+
* fractional bits: the Planet's base rate for the stake's tier at the
|
|
2325
|
+
* Starbase's current level, times the definition's rent multiplier. */
|
|
2326
|
+
function claimStakeRentRate(baseRaw, multiplierRaw) {
|
|
2327
|
+
// The base rate has 32 fractional bits and the multiplier 56.
|
|
2328
|
+
return (baseRaw * multiplierRaw) >> 32n;
|
|
2329
|
+
}
|
|
2330
|
+
/** Plans bringing one Claim Stake's production up to date.
|
|
2331
|
+
*
|
|
2332
|
+
* Production is permissionless: any wallet may tick any Claim Stake, so the
|
|
2333
|
+
* Plan's only signer is the `funder`, which pays any growth of the stake's
|
|
2334
|
+
* account. Rent the stake frees goes to its owner Profile. The game pays the
|
|
2335
|
+
* stake's rent up to now, then produces from its last tick to now: each
|
|
2336
|
+
* Building's processors turn their inputs into outputs at the stake's net
|
|
2337
|
+
* rates, a processor that runs short of an input pauses, and output stops at
|
|
2338
|
+
* the stake's storage, with Fuel limited to its separate fuel storage. The
|
|
2339
|
+
* tick also records paid operational Building work and claim Mining work for
|
|
2340
|
+
* a later {@link planSettleClaimStakeBuildingXp}.
|
|
2341
|
+
*
|
|
2342
|
+
* The planner refuses what the game would refuse: a stake in design, a
|
|
2343
|
+
* Deactivated stake past its eviction grace, a stake its Planet does not
|
|
2344
|
+
* register or has evicted, a Starbase Player from an earlier Starbase, and a
|
|
2345
|
+
* stake whose rent balance does not cover the time up to now, which the game
|
|
2346
|
+
* would deactivate instead. A Deactivated stake whose topped-up balance covers
|
|
2347
|
+
* the time up to now is reactivated, then produces. It also refuses a stake
|
|
2348
|
+
* still under construction or already up to date, which would produce
|
|
2349
|
+
* nothing. The description projects the elapsed time, the approximate amounts
|
|
2350
|
+
* at the stored net rates, storage, and the rent paid-through time; exact
|
|
2351
|
+
* amounts, processor pauses and whether the Planet allows harvesting remain
|
|
2352
|
+
* chain-authoritative.
|
|
2353
|
+
*
|
|
2354
|
+
* Requires Disabled rent and the current System generation. Bringing a large
|
|
2355
|
+
* stake up to date can take more than the default 200,000 compute units, so
|
|
2356
|
+
* simulate first and raise `computeUnitLimit` when assembling if needed.
|
|
2357
|
+
*
|
|
2358
|
+
* @example
|
|
2359
|
+
* ```ts
|
|
2360
|
+
* declare const ctx: SageContext;
|
|
2361
|
+
* declare const stake: ClaimStakeSnapshot;
|
|
2362
|
+
* declare const funder: Address;
|
|
2363
|
+
* const plan = await planSettleClaimStakeProduction(ctx, stake, { funder });
|
|
2364
|
+
* console.log(plan.describe());
|
|
2365
|
+
* ```
|
|
2366
|
+
*/
|
|
2367
|
+
export async function planSettleClaimStakeProduction(ctx, stake, input) {
|
|
2368
|
+
const options = validateSettleProductionOptions(input);
|
|
2369
|
+
const game = requireGameAddress(ctx);
|
|
2370
|
+
const profile = stake.ownerProfile.address;
|
|
2371
|
+
if (stake.state.kind === 'design') {
|
|
2372
|
+
fail(`Claim Stake ${stake.address} is in design, and the game produces only for a built stake. Finalize its building changes, refresh it, and retry the production tick.`, stake.address);
|
|
2373
|
+
}
|
|
2374
|
+
const character = await requireOwnedStake(ctx.programs, stake, game, profile);
|
|
2375
|
+
const currencyCache = await claimStakeCurrencyCache(ctx.programs, game);
|
|
2376
|
+
const action = 'the Claim Stake production tick';
|
|
2377
|
+
const [{ bodyAccount, currentBody, currentStake, extraAccounts: [clockCandidate], stakeAccount, }, rent, definition, xp,] = await Promise.all([
|
|
2378
|
+
readOwnedStake(ctx, stake, action, [CLOCK_ADDRESS]),
|
|
2379
|
+
requireDisabledStakeRent(ctx, game, stake.address, action),
|
|
2380
|
+
resolveClaimStakeDefinition(ctx, stake.claimStakeDefinitionId),
|
|
2381
|
+
resolveClaimStakeXp(ctx, game),
|
|
2382
|
+
]);
|
|
2383
|
+
if (!sameOwnedStake(currentStake, stake, game, profile) ||
|
|
2384
|
+
!sameStakeState(currentStake.state, stake.state)) {
|
|
2385
|
+
fail(`Claim Stake ${stake.address} changed or does not match its loaded ownership, Body, definitions, buildings, lifecycle state, or System generation. Refresh it and retry ${action}.`, stake.address);
|
|
2386
|
+
}
|
|
2387
|
+
const now = readClock(requireAccount(clockCandidate, CLOCK_ADDRESS, 'The Clock sysvar is missing. Refresh chain time and retry the production tick.'));
|
|
2388
|
+
const planet = await requireStakePlanet(ctx.programs, currentBody, stake, game, action);
|
|
2389
|
+
const { system } = planet;
|
|
2390
|
+
const { currentPlayer, currentSystem, extraAccounts: [cacheCandidate], player, playerAccount, starbase, systemAccount, } = await readStakeStarbase(ctx, stake, game, system, character, profile, action, [currencyCache]);
|
|
2391
|
+
requireStakeRegistered(planet.details.claimedPlots, stake, starbase.level, action);
|
|
2392
|
+
if (currentPlayer.sequenceId !== currentSystem.sequenceId)
|
|
2393
|
+
fail(`Starbase Player ${player} was registered at an earlier Starbase in Star System ${system}, which the game treats as destroyed. The owner must register at the current Starbase before ${action}.`, player);
|
|
2394
|
+
const cacheGuard = await requireCurrencyCache(ctx.programs, cacheCandidate, currencyCache, game, action, 'planSettleClaimStakeProduction');
|
|
2395
|
+
let reactivation = '';
|
|
2396
|
+
if (currentStake.state.kind === 'deactivated') {
|
|
2397
|
+
const graceEnds = currentStake.state.deactivatedAtUnixSeconds +
|
|
2398
|
+
definition.evictionGracePeriodSeconds;
|
|
2399
|
+
if (now > graceEnds)
|
|
2400
|
+
fail(`Claim Stake ${stake.address} was deactivated for unpaid rent and its eviction grace ended at ${instant(graceEnds)}, so the game no longer produces for it. It can only be evicted or respawned.`, stake.address);
|
|
2401
|
+
reactivation = ` The stake is Deactivated within its eviction grace, which ends at ${instant(graceEnds)}; the game reactivates it once its rent covers the time up to now, then produces.`;
|
|
2402
|
+
}
|
|
2403
|
+
const rate = claimStakeRentRate(planet.details.baseClaimStakeRentRate[LEVEL_INDEX[starbase.level]][TIER_INDEX[definition.tier]].raw, definition.rentMultiplier.raw);
|
|
2404
|
+
const paidThrough = rate === 0n
|
|
2405
|
+
? undefined
|
|
2406
|
+
: currentStake.lastRentAtUnixSeconds +
|
|
2407
|
+
(currentStake.rentBalanceRaw << 56n) / rate;
|
|
2408
|
+
if (paidThrough !== undefined && paidThrough < now)
|
|
2409
|
+
fail(`Claim Stake ${stake.address}'s rent balance pays only through about ${instant(paidThrough)}, before chain time ${instant(now)}, so the game would deactivate the stake instead of producing. Top up its rent, refresh, and retry.`, stake.address);
|
|
2410
|
+
const constructionEnds = currentStake.constructionProgressAtUnixSeconds +
|
|
2411
|
+
currentStake.constructionRemainingSeconds;
|
|
2412
|
+
if (currentStake.constructionRemainingSeconds > 0n && constructionEnds > now)
|
|
2413
|
+
fail(`Claim Stake ${stake.address} is under construction until about ${instant(constructionEnds)} and produces nothing until then. Wait for construction to finish and retry ${action}.`, stake.address);
|
|
2414
|
+
const { production } = currentStake;
|
|
2415
|
+
const elapsed = now - production.lastTickAtUnixSeconds;
|
|
2416
|
+
if (elapsed <= 0n)
|
|
2417
|
+
fail(`Claim Stake ${stake.address}'s production is already up to date at chain time ${instant(now)}. Wait and retry ${action}.`, stake.address);
|
|
2418
|
+
const flows = await Promise.all(production.netResources.map(async ({ cargoId, ratePerSecond }) => {
|
|
2419
|
+
const { name } = await resolveCargo(ctx, cargoId);
|
|
2420
|
+
const amount = Math.round(Math.abs(ratePerSecond) * Number(elapsed));
|
|
2421
|
+
const stored = cargoAmount(production.cargoPod.amounts, cargoId);
|
|
2422
|
+
// Seconds of consumption the stored input covers; Infinity for outputs.
|
|
2423
|
+
const covers = ratePerSecond < 0
|
|
2424
|
+
? Math.floor(Number(stored) / -ratePerSecond)
|
|
2425
|
+
: Number.POSITIVE_INFINITY;
|
|
2426
|
+
return { amount, covers, name, produced: ratePerSecond > 0, stored };
|
|
2427
|
+
}));
|
|
2428
|
+
const short = flows
|
|
2429
|
+
.filter((flow) => flow.covers < Number(elapsed))
|
|
2430
|
+
.map(({ covers, name, stored }) => stored === 0n
|
|
2431
|
+
? `the stake holds no ${name}`
|
|
2432
|
+
: covers === 0
|
|
2433
|
+
? `stored ${name} lasts less than one second`
|
|
2434
|
+
: `stored ${name} covers only about ${String(covers)} of those seconds`);
|
|
2435
|
+
const shortage = short.length === 0
|
|
2436
|
+
? ''
|
|
2437
|
+
: ` Warning: ${short.join('; ')}. Processors that need an exhausted input pause, which can stop the stake's output entirely, so expect far less than these amounts.`;
|
|
2438
|
+
const list = (produced) => flows
|
|
2439
|
+
.filter((flow) => flow.produced === produced && flow.amount > 0)
|
|
2440
|
+
.map(({ amount, name }) => `${String(amount)} ${name}`)
|
|
2441
|
+
.join(', ');
|
|
2442
|
+
const made = list(true);
|
|
2443
|
+
const used = list(false);
|
|
2444
|
+
const rates = made === '' && used === ''
|
|
2445
|
+
? 'Its stored net rates produce and consume nothing.'
|
|
2446
|
+
: `At its stored net rates that is about ${[
|
|
2447
|
+
...(made === '' ? [] : [`${made} produced`]),
|
|
2448
|
+
...(used === '' ? [] : [`${used} consumed`]),
|
|
2449
|
+
].join(' and ')}, before storage limits and processor pauses.${shortage}`;
|
|
2450
|
+
const rentPaid = paidThrough === undefined
|
|
2451
|
+
? 'The stake pays no rent at the Starbase’s current level.'
|
|
2452
|
+
: `Its rent balance pays through about ${instant(paidThrough)}.`;
|
|
2453
|
+
const description = `Bring Claim Stake ${stake.address}'s production up to date: ${String(elapsed)} seconds since its last tick at ${instant(production.lastTickAtUnixSeconds)}. ${rates} Storage holds ${String(production.cargoPod.storageCost)} of ${String(production.resourceCapacityRaw)} capacity units. ${rentPaid}${reactivation} Funder ${options.funder} signs and pays any growth of the stake's account; rent the stake frees goes to Profile ${profile}. Exact amounts, processor pauses and whether the Planet allows harvesting remain chain-authoritative.`;
|
|
2454
|
+
return buildPlannerPlan(ctx.programs, {
|
|
2455
|
+
kind: 'claim-stakes.settle-production',
|
|
2456
|
+
preconditions: [
|
|
2457
|
+
xp.guard,
|
|
2458
|
+
...(await Promise.all([
|
|
2459
|
+
accountStatePrecondition(stakeAccount, `Claim Stake ${stake.address} retains its owner, buildings, rent, production, lifecycle state, Body, and System generation.`),
|
|
2460
|
+
planetPrecondition(bodyAccount, system),
|
|
2461
|
+
systemPrecondition(systemAccount, currentSystem.name),
|
|
2462
|
+
playerPrecondition(playerAccount, player),
|
|
2463
|
+
])),
|
|
2464
|
+
cacheGuard,
|
|
2465
|
+
...rent.guards,
|
|
2466
|
+
],
|
|
2467
|
+
steps: [
|
|
2468
|
+
{
|
|
2469
|
+
describes: description,
|
|
2470
|
+
instruction: adaptClaimStakeResourceProductionInstruction(ctx.programs, {
|
|
2471
|
+
celestialBody: stake.body.address,
|
|
2472
|
+
claimStakeInstance: stake.address,
|
|
2473
|
+
currencyCache,
|
|
2474
|
+
funder: options.funder,
|
|
2475
|
+
game,
|
|
2476
|
+
profile,
|
|
2477
|
+
...rent.accounts,
|
|
2478
|
+
systemAndStarbasePlayerStarbasePlayer: player,
|
|
2479
|
+
systemAndStarbasePlayerSystem: system,
|
|
2480
|
+
}),
|
|
2481
|
+
signers: [options.funder],
|
|
2482
|
+
},
|
|
2483
|
+
],
|
|
2484
|
+
summary: description,
|
|
2485
|
+
});
|
|
2486
|
+
}
|
|
1999
2487
|
//# sourceMappingURL=index.js.map
|