@aephia/atlas-kit 0.6.0-next.16 → 0.6.0-next.161
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 +2 -1
- package/dist/cargo/actions/deposit.d.ts +5 -2
- package/dist/cargo/actions/deposit.d.ts.map +1 -1
- package/dist/cargo/actions/deposit.js +60 -129
- package/dist/cargo/actions/deposit.js.map +1 -1
- package/dist/cargo/actions/index.d.ts +12 -6
- package/dist/cargo/actions/index.d.ts.map +1 -1
- package/dist/cargo/actions/index.js +98 -94
- package/dist/cargo/actions/index.js.map +1 -1
- package/dist/cargo/actions/wallet-context.d.ts +52 -3
- package/dist/cargo/actions/wallet-context.d.ts.map +1 -1
- package/dist/cargo/actions/wallet-context.js +118 -7
- package/dist/cargo/actions/wallet-context.js.map +1 -1
- package/dist/cargo/actions/wallet-token.d.ts +1 -6
- package/dist/cargo/actions/wallet-token.d.ts.map +1 -1
- package/dist/cargo/actions/wallet-token.js +0 -45
- package/dist/cargo/actions/wallet-token.js.map +1 -1
- package/dist/cargo/actions/withdrawal.d.ts +1 -1
- package/dist/cargo/actions/withdrawal.d.ts.map +1 -1
- package/dist/cargo/actions/withdrawal.js +39 -168
- package/dist/cargo/actions/withdrawal.js.map +1 -1
- package/dist/cargo/index.d.ts.map +1 -1
- package/dist/cargo/index.js +2 -10
- package/dist/cargo/index.js.map +1 -1
- package/dist/claim-stakes/actions/index.d.ts +93 -14
- package/dist/claim-stakes/actions/index.d.ts.map +1 -1
- package/dist/claim-stakes/actions/index.js +713 -742
- package/dist/claim-stakes/actions/index.js.map +1 -1
- package/dist/claim-stakes/index.d.ts +21 -6
- package/dist/claim-stakes/index.d.ts.map +1 -1
- package/dist/claim-stakes/index.js +33 -19
- package/dist/claim-stakes/index.js.map +1 -1
- package/dist/client/context.d.ts.map +1 -1
- package/dist/client/context.js +1 -1
- package/dist/client/context.js.map +1 -1
- package/dist/client/contracts.d.ts +16 -6
- package/dist/client/contracts.d.ts.map +1 -1
- package/dist/client/deployments.d.ts +17 -0
- package/dist/client/deployments.d.ts.map +1 -1
- package/dist/client/deployments.js +17 -0
- package/dist/client/deployments.js.map +1 -1
- package/dist/client/errors.d.ts +2 -2
- package/dist/client/errors.d.ts.map +1 -1
- package/dist/client/errors.js.map +1 -1
- package/dist/client/index.d.ts +56 -0
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +56 -0
- package/dist/client/index.js.map +1 -1
- package/dist/client/rpc-subscription-provider.d.ts +35 -0
- package/dist/client/rpc-subscription-provider.d.ts.map +1 -0
- package/dist/client/rpc-subscription-provider.js +190 -0
- package/dist/client/rpc-subscription-provider.js.map +1 -0
- package/dist/combat/actions/index.d.ts +30 -12
- package/dist/combat/actions/index.d.ts.map +1 -1
- package/dist/combat/actions/index.js +360 -302
- package/dist/combat/actions/index.js.map +1 -1
- package/dist/combat/index.d.ts +25 -8
- package/dist/combat/index.d.ts.map +1 -1
- package/dist/combat/index.js +21 -18
- package/dist/combat/index.js.map +1 -1
- package/dist/crafting/actions/fee-rate.d.ts +47 -0
- package/dist/crafting/actions/fee-rate.d.ts.map +1 -0
- package/dist/crafting/actions/fee-rate.js +58 -0
- package/dist/crafting/actions/fee-rate.js.map +1 -0
- package/dist/crafting/actions/index.d.ts +29 -18
- package/dist/crafting/actions/index.d.ts.map +1 -1
- package/dist/crafting/actions/index.js +298 -352
- package/dist/crafting/actions/index.js.map +1 -1
- package/dist/crafting/estimate.d.ts +101 -0
- package/dist/crafting/estimate.d.ts.map +1 -0
- package/dist/crafting/estimate.js +108 -0
- package/dist/crafting/estimate.js.map +1 -0
- package/dist/crafting/index.d.ts +34 -3
- package/dist/crafting/index.d.ts.map +1 -1
- package/dist/crafting/index.js +50 -28
- package/dist/crafting/index.js.map +1 -1
- package/dist/factions/actions/index.d.ts +2 -1
- package/dist/factions/actions/index.d.ts.map +1 -1
- package/dist/factions/actions/index.js +6 -4
- package/dist/factions/actions/index.js.map +1 -1
- package/dist/factions/index.d.ts +19 -2
- package/dist/factions/index.d.ts.map +1 -1
- package/dist/factions/index.js +38 -26
- package/dist/factions/index.js.map +1 -1
- package/dist/factions/profile-faction.d.ts +20 -8
- package/dist/factions/profile-faction.d.ts.map +1 -1
- package/dist/factions/profile-faction.js +20 -8
- package/dist/factions/profile-faction.js.map +1 -1
- package/dist/fleets/actions/add-ship.d.ts +48 -0
- package/dist/fleets/actions/add-ship.d.ts.map +1 -0
- package/dist/fleets/actions/add-ship.js +136 -0
- package/dist/fleets/actions/add-ship.js.map +1 -0
- package/dist/fleets/actions/create-fleet.d.ts +36 -0
- package/dist/fleets/actions/create-fleet.d.ts.map +1 -0
- package/dist/fleets/actions/create-fleet.js +108 -0
- package/dist/fleets/actions/create-fleet.js.map +1 -0
- package/dist/fleets/actions/crew-transfer.d.ts +42 -0
- package/dist/fleets/actions/crew-transfer.d.ts.map +1 -0
- package/dist/fleets/actions/crew-transfer.js +95 -0
- package/dist/fleets/actions/crew-transfer.js.map +1 -0
- package/dist/fleets/actions/disband.d.ts +42 -0
- package/dist/fleets/actions/disband.d.ts.map +1 -0
- package/dist/fleets/actions/disband.js +107 -0
- package/dist/fleets/actions/disband.js.map +1 -0
- package/dist/fleets/actions/dock-bounds.d.ts +38 -0
- package/dist/fleets/actions/dock-bounds.d.ts.map +1 -0
- package/dist/fleets/actions/dock-bounds.js +46 -0
- package/dist/fleets/actions/dock-bounds.js.map +1 -0
- package/dist/fleets/actions/index.d.ts +89 -25
- package/dist/fleets/actions/index.d.ts.map +1 -1
- package/dist/fleets/actions/index.js +491 -353
- package/dist/fleets/actions/index.js.map +1 -1
- package/dist/fleets/actions/respawn.d.ts +38 -0
- package/dist/fleets/actions/respawn.d.ts.map +1 -0
- package/dist/fleets/actions/respawn.js +93 -0
- package/dist/fleets/actions/respawn.js.map +1 -0
- package/dist/fleets/actions/ship-import.d.ts +1 -1
- package/dist/fleets/actions/ship-import.d.ts.map +1 -1
- package/dist/fleets/actions/ship-import.js +61 -90
- package/dist/fleets/actions/ship-import.js.map +1 -1
- package/dist/fleets/actions/sync.d.ts +24 -0
- package/dist/fleets/actions/sync.d.ts.map +1 -0
- package/dist/fleets/actions/sync.js +55 -0
- package/dist/fleets/actions/sync.js.map +1 -0
- package/dist/fleets/composition-stats.d.ts +101 -0
- package/dist/fleets/composition-stats.d.ts.map +1 -0
- package/dist/fleets/composition-stats.js +354 -0
- package/dist/fleets/composition-stats.js.map +1 -0
- package/dist/fleets/cooldown.d.ts +47 -0
- package/dist/fleets/cooldown.d.ts.map +1 -0
- package/dist/fleets/cooldown.js +48 -0
- package/dist/fleets/cooldown.js.map +1 -0
- package/dist/fleets/coordinate-warp-estimate.d.ts +70 -0
- package/dist/fleets/coordinate-warp-estimate.d.ts.map +1 -0
- package/dist/fleets/coordinate-warp-estimate.js +46 -0
- package/dist/fleets/coordinate-warp-estimate.js.map +1 -0
- package/dist/fleets/index.d.ts +36 -0
- package/dist/fleets/index.d.ts.map +1 -1
- package/dist/fleets/index.js +55 -12
- package/dist/fleets/index.js.map +1 -1
- package/dist/fleets/movement-arithmetic.d.ts +21 -0
- package/dist/fleets/movement-arithmetic.d.ts.map +1 -0
- package/dist/fleets/movement-arithmetic.js +45 -0
- package/dist/fleets/movement-arithmetic.js.map +1 -0
- package/dist/fleets/subwarp-estimate.d.ts +72 -0
- package/dist/fleets/subwarp-estimate.d.ts.map +1 -0
- package/dist/fleets/subwarp-estimate.js +40 -0
- package/dist/fleets/subwarp-estimate.js.map +1 -0
- package/dist/fleets/travel-profile.d.ts +102 -0
- package/dist/fleets/travel-profile.d.ts.map +1 -0
- package/dist/fleets/travel-profile.js +120 -0
- package/dist/fleets/travel-profile.js.map +1 -0
- package/dist/fleets/warp-lane-estimate.d.ts +59 -0
- package/dist/fleets/warp-lane-estimate.d.ts.map +1 -0
- package/dist/fleets/warp-lane-estimate.js +36 -0
- package/dist/fleets/warp-lane-estimate.js.map +1 -0
- package/dist/fleets/warp-lane-policy.d.ts +74 -0
- package/dist/fleets/warp-lane-policy.d.ts.map +1 -0
- package/dist/fleets/warp-lane-policy.js +103 -0
- package/dist/fleets/warp-lane-policy.js.map +1 -0
- package/dist/fleets/warp-lane-toll.d.ts +55 -0
- package/dist/fleets/warp-lane-toll.d.ts.map +1 -0
- package/dist/fleets/warp-lane-toll.js +79 -0
- package/dist/fleets/warp-lane-toll.js.map +1 -0
- package/dist/identity/actions/create-profile.d.ts +1 -1
- package/dist/identity/actions/create-profile.d.ts.map +1 -1
- package/dist/identity/actions/create-profile.js +2 -2
- package/dist/identity/actions/create-profile.js.map +1 -1
- package/dist/identity/actions/index.d.ts +5 -4
- package/dist/identity/actions/index.d.ts.map +1 -1
- package/dist/identity/actions/index.js +52 -29
- package/dist/identity/actions/index.js.map +1 -1
- package/dist/identity/actions/research-unlock.d.ts +61 -0
- package/dist/identity/actions/research-unlock.d.ts.map +1 -0
- package/dist/identity/actions/research-unlock.js +166 -0
- package/dist/identity/actions/research-unlock.js.map +1 -0
- package/dist/identity/index.d.ts +5 -2
- package/dist/identity/index.d.ts.map +1 -1
- package/dist/identity/index.js +6 -12
- package/dist/identity/index.js.map +1 -1
- package/dist/identity/research-state.d.ts +60 -0
- package/dist/identity/research-state.d.ts.map +1 -0
- package/dist/identity/research-state.js +68 -0
- package/dist/identity/research-state.js.map +1 -0
- package/dist/index.d.ts +26 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +24 -7
- package/dist/index.js.map +1 -1
- package/dist/internal/c4/account-decoding.d.ts +49 -0
- package/dist/internal/c4/account-decoding.d.ts.map +1 -0
- package/dist/internal/c4/account-decoding.js +74 -0
- package/dist/internal/c4/account-decoding.js.map +1 -0
- package/dist/internal/c4/cargo-bytes-config.d.ts +7 -0
- package/dist/internal/c4/cargo-bytes-config.d.ts.map +1 -0
- package/dist/internal/c4/cargo-bytes-config.js +19 -0
- package/dist/internal/c4/cargo-bytes-config.js.map +1 -0
- package/dist/internal/c4/cargo-instructions.d.ts +24 -0
- package/dist/internal/c4/cargo-instructions.d.ts.map +1 -0
- package/dist/internal/c4/cargo-instructions.js +30 -0
- package/dist/internal/c4/cargo-instructions.js.map +1 -0
- package/dist/internal/c4/cargo-pod.d.ts +15 -0
- package/dist/internal/c4/cargo-pod.d.ts.map +1 -0
- package/dist/internal/c4/cargo-pod.js +13 -0
- package/dist/internal/c4/cargo-pod.js.map +1 -0
- package/dist/internal/c4/character-modifier.d.ts +1 -1
- package/dist/internal/c4/character-modifier.d.ts.map +1 -1
- package/dist/internal/c4/character-registration.d.ts +2 -0
- package/dist/internal/c4/character-registration.d.ts.map +1 -1
- package/dist/internal/c4/character-registration.js +2 -0
- package/dist/internal/c4/character-registration.js.map +1 -1
- package/dist/internal/c4/character.d.ts +157 -0
- package/dist/internal/c4/character.d.ts.map +1 -0
- package/dist/internal/c4/character.js +64 -0
- package/dist/internal/c4/character.js.map +1 -0
- package/dist/internal/c4/claim-stake-building-definitions.d.ts.map +1 -1
- package/dist/internal/c4/claim-stake-building-definitions.js +2 -1
- package/dist/internal/c4/claim-stake-building-definitions.js.map +1 -1
- package/dist/internal/c4/claim-stake-configuration.d.ts.map +1 -1
- package/dist/internal/c4/claim-stake-configuration.js +5 -36
- package/dist/internal/c4/claim-stake-configuration.js.map +1 -1
- package/dist/internal/c4/claim-stake-definitions.d.ts +4 -4
- package/dist/internal/c4/claim-stake-definitions.d.ts.map +1 -1
- package/dist/internal/c4/claim-stake-definitions.js +2 -1
- package/dist/internal/c4/claim-stake-definitions.js.map +1 -1
- package/dist/internal/c4/claim-stake-plots.d.ts +17 -0
- package/dist/internal/c4/claim-stake-plots.d.ts.map +1 -0
- package/dist/internal/c4/claim-stake-plots.js +29 -0
- package/dist/internal/c4/claim-stake-plots.js.map +1 -0
- package/dist/internal/c4/claim-stake-storage.d.ts +45 -0
- package/dist/internal/c4/claim-stake-storage.d.ts.map +1 -0
- package/dist/internal/c4/claim-stake-storage.js +207 -0
- package/dist/internal/c4/claim-stake-storage.js.map +1 -0
- package/dist/internal/c4/claim-stake.d.ts +13 -33
- package/dist/internal/c4/claim-stake.d.ts.map +1 -1
- package/dist/internal/c4/claim-stake.js +49 -94
- package/dist/internal/c4/claim-stake.js.map +1 -1
- package/dist/internal/c4/combat-storage.d.ts +20 -0
- package/dist/internal/c4/combat-storage.d.ts.map +1 -0
- package/dist/internal/c4/combat-storage.js +43 -0
- package/dist/internal/c4/combat-storage.js.map +1 -0
- package/dist/internal/c4/combat.d.ts +1 -82
- package/dist/internal/c4/combat.d.ts.map +1 -1
- package/dist/internal/c4/combat.js +16 -213
- package/dist/internal/c4/combat.js.map +1 -1
- package/dist/internal/c4/crafting-process-codec.d.ts +13 -0
- package/dist/internal/c4/crafting-process-codec.d.ts.map +1 -0
- package/dist/internal/c4/crafting-process-codec.js +34 -0
- package/dist/internal/c4/crafting-process-codec.js.map +1 -0
- package/dist/internal/c4/crafting-storage.d.ts +20 -0
- package/dist/internal/c4/crafting-storage.d.ts.map +1 -0
- package/dist/internal/c4/crafting-storage.js +54 -0
- package/dist/internal/c4/crafting-storage.js.map +1 -0
- package/dist/internal/c4/crafting.d.ts +33 -33
- package/dist/internal/c4/crafting.d.ts.map +1 -1
- package/dist/internal/c4/crafting.js +76 -127
- package/dist/internal/c4/crafting.js.map +1 -1
- package/dist/internal/c4/currency-cache.d.ts +6 -0
- package/dist/internal/c4/currency-cache.d.ts.map +1 -0
- package/dist/internal/c4/currency-cache.js +27 -0
- package/dist/internal/c4/currency-cache.js.map +1 -0
- package/dist/internal/c4/discriminators.d.ts +92 -0
- package/dist/internal/c4/discriminators.d.ts.map +1 -0
- package/dist/internal/c4/discriminators.js +188 -0
- package/dist/internal/c4/discriminators.js.map +1 -0
- package/dist/internal/c4/docking-funding.d.ts +4 -0
- package/dist/internal/c4/docking-funding.d.ts.map +1 -0
- package/dist/internal/c4/docking-funding.js +11 -0
- package/dist/internal/c4/docking-funding.js.map +1 -0
- package/dist/internal/c4/faction-epoch-meter.d.ts +10 -0
- package/dist/internal/c4/faction-epoch-meter.d.ts.map +1 -0
- package/dist/internal/c4/faction-epoch-meter.js +26 -0
- package/dist/internal/c4/faction-epoch-meter.js.map +1 -0
- package/dist/internal/c4/faction-treasury.d.ts +23 -0
- package/dist/internal/c4/faction-treasury.d.ts.map +1 -0
- package/dist/internal/c4/faction-treasury.js +41 -0
- package/dist/internal/c4/faction-treasury.js.map +1 -0
- package/dist/internal/c4/faction.d.ts +21 -0
- package/dist/internal/c4/faction.d.ts.map +1 -0
- package/dist/internal/c4/faction.js +23 -0
- package/dist/internal/c4/faction.js.map +1 -0
- package/dist/internal/c4/factions.d.ts +40 -60
- package/dist/internal/c4/factions.d.ts.map +1 -1
- package/dist/internal/c4/factions.js +106 -225
- package/dist/internal/c4/factions.js.map +1 -1
- package/dist/internal/c4/fleet-arrival.d.ts +28 -0
- package/dist/internal/c4/fleet-arrival.d.ts.map +1 -0
- package/dist/internal/c4/fleet-arrival.js +42 -0
- package/dist/internal/c4/fleet-arrival.js.map +1 -0
- package/dist/internal/c4/fleet-creation.d.ts +7 -0
- package/dist/internal/c4/fleet-creation.d.ts.map +1 -0
- package/dist/internal/c4/fleet-creation.js +171 -0
- package/dist/internal/c4/fleet-creation.js.map +1 -0
- package/dist/internal/c4/fleet-crew-binding.d.ts +9 -0
- package/dist/internal/c4/fleet-crew-binding.d.ts.map +1 -1
- package/dist/internal/c4/fleet-crew-binding.js +31 -44
- package/dist/internal/c4/fleet-crew-binding.js.map +1 -1
- package/dist/internal/c4/fleet-disband-layout.d.ts +7 -0
- package/dist/internal/c4/fleet-disband-layout.d.ts.map +1 -0
- package/dist/internal/c4/fleet-disband-layout.js +7 -0
- package/dist/internal/c4/fleet-disband-layout.js.map +1 -0
- package/dist/internal/c4/fleet-disband.d.ts +27 -0
- package/dist/internal/c4/fleet-disband.d.ts.map +1 -0
- package/dist/internal/c4/fleet-disband.js +63 -0
- package/dist/internal/c4/fleet-disband.js.map +1 -0
- package/dist/internal/c4/fleet-points.d.ts +3 -0
- package/dist/internal/c4/fleet-points.d.ts.map +1 -0
- package/dist/internal/c4/fleet-points.js +8 -0
- package/dist/internal/c4/fleet-points.js.map +1 -0
- package/dist/internal/c4/fleet-respawn.d.ts +17 -0
- package/dist/internal/c4/fleet-respawn.d.ts.map +1 -0
- package/dist/internal/c4/fleet-respawn.js +62 -0
- package/dist/internal/c4/fleet-respawn.js.map +1 -0
- package/dist/internal/c4/fleet-ship-assembly.d.ts +26 -0
- package/dist/internal/c4/fleet-ship-assembly.d.ts.map +1 -0
- package/dist/internal/c4/fleet-ship-assembly.js +96 -0
- package/dist/internal/c4/fleet-ship-assembly.js.map +1 -0
- package/dist/internal/c4/fleet-storage.d.ts +44 -0
- package/dist/internal/c4/fleet-storage.d.ts.map +1 -0
- package/dist/internal/c4/fleet-storage.js +108 -0
- package/dist/internal/c4/fleet-storage.js.map +1 -0
- package/dist/internal/c4/fleet-sync.d.ts +5 -0
- package/dist/internal/c4/fleet-sync.d.ts.map +1 -0
- package/dist/internal/c4/fleet-sync.js +15 -0
- package/dist/internal/c4/fleet-sync.js.map +1 -0
- package/dist/internal/c4/fleet.d.ts +65 -24
- package/dist/internal/c4/fleet.d.ts.map +1 -1
- package/dist/internal/c4/fleet.js +50 -91
- package/dist/internal/c4/fleet.js.map +1 -1
- package/dist/internal/c4/game-definition-layout.d.ts +2 -0
- package/dist/internal/c4/game-definition-layout.d.ts.map +1 -1
- package/dist/internal/c4/game-definition-layout.js +4 -0
- package/dist/internal/c4/game-definition-layout.js.map +1 -1
- package/dist/internal/c4/game.d.ts +122 -32
- package/dist/internal/c4/game.d.ts.map +1 -1
- package/dist/internal/c4/game.js +229 -130
- package/dist/internal/c4/game.js.map +1 -1
- package/dist/internal/c4/identity.d.ts +3 -152
- package/dist/internal/c4/identity.d.ts.map +1 -1
- package/dist/internal/c4/identity.js +19 -126
- package/dist/internal/c4/identity.js.map +1 -1
- package/dist/internal/c4/local-market-order.d.ts +29 -0
- package/dist/internal/c4/local-market-order.d.ts.map +1 -0
- package/dist/internal/c4/local-market-order.js +46 -0
- package/dist/internal/c4/local-market-order.js.map +1 -0
- package/dist/internal/c4/loot-layout.js +1 -1
- package/dist/internal/c4/loot-layout.js.map +1 -1
- package/dist/internal/c4/loot.d.ts +89 -0
- package/dist/internal/c4/loot.d.ts.map +1 -0
- package/dist/internal/c4/loot.js +109 -0
- package/dist/internal/c4/loot.js.map +1 -0
- package/dist/internal/c4/loyalty.d.ts +2 -28
- package/dist/internal/c4/loyalty.d.ts.map +1 -1
- package/dist/internal/c4/loyalty.js +36 -161
- package/dist/internal/c4/loyalty.js.map +1 -1
- package/dist/internal/c4/market-storage.d.ts +25 -0
- package/dist/internal/c4/market-storage.d.ts.map +1 -0
- package/dist/internal/c4/market-storage.js +53 -0
- package/dist/internal/c4/market-storage.js.map +1 -0
- package/dist/internal/c4/market.d.ts +5 -38
- package/dist/internal/c4/market.d.ts.map +1 -1
- package/dist/internal/c4/market.js +26 -120
- package/dist/internal/c4/market.js.map +1 -1
- package/dist/internal/c4/mining-instructions.d.ts +2 -0
- package/dist/internal/c4/mining-instructions.d.ts.map +1 -0
- package/dist/internal/c4/mining-instructions.js +3 -0
- package/dist/internal/c4/mining-instructions.js.map +1 -0
- package/dist/internal/c4/open-signal.d.ts +8 -0
- package/dist/internal/c4/open-signal.d.ts.map +1 -0
- package/dist/internal/c4/open-signal.js +37 -0
- package/dist/internal/c4/open-signal.js.map +1 -0
- package/dist/internal/c4/pda.d.ts +49 -1
- package/dist/internal/c4/pda.d.ts.map +1 -1
- package/dist/internal/c4/pda.js +122 -17
- package/dist/internal/c4/pda.js.map +1 -1
- package/dist/internal/c4/profile-faction.d.ts +2 -1
- package/dist/internal/c4/profile-faction.d.ts.map +1 -1
- package/dist/internal/c4/profile-faction.js +36 -72
- package/dist/internal/c4/profile-faction.js.map +1 -1
- package/dist/internal/c4/profile-permissions.d.ts +1 -1
- package/dist/internal/c4/profile-permissions.d.ts.map +1 -1
- package/dist/internal/c4/profile-permissions.js +17 -1
- package/dist/internal/c4/profile-permissions.js.map +1 -1
- package/dist/internal/c4/region-geometry.d.ts +8 -0
- package/dist/internal/c4/region-geometry.d.ts.map +1 -0
- package/dist/internal/c4/region-geometry.js +43 -0
- package/dist/internal/c4/region-geometry.js.map +1 -0
- package/dist/internal/c4/rewards.d.ts +1 -61
- package/dist/internal/c4/rewards.d.ts.map +1 -1
- package/dist/internal/c4/rewards.js +23 -203
- package/dist/internal/c4/rewards.js.map +1 -1
- package/dist/internal/c4/runtime-bindings.d.ts +4 -0
- package/dist/internal/c4/runtime-bindings.d.ts.map +1 -0
- package/dist/internal/c4/runtime-bindings.js +4 -0
- package/dist/internal/c4/runtime-bindings.js.map +1 -0
- package/dist/internal/c4/scan-detection-codecs.d.ts +3 -0
- package/dist/internal/c4/scan-detection-codecs.d.ts.map +1 -0
- package/dist/internal/c4/scan-detection-codecs.js +3 -0
- package/dist/internal/c4/scan-detection-codecs.js.map +1 -0
- package/dist/internal/c4/scan-lifecycle.d.ts +324 -0
- package/dist/internal/c4/scan-lifecycle.d.ts.map +1 -0
- package/dist/internal/c4/scan-lifecycle.js +249 -0
- package/dist/internal/c4/scan-lifecycle.js.map +1 -0
- package/dist/internal/c4/scan-storage.d.ts +7 -0
- package/dist/internal/c4/scan-storage.d.ts.map +1 -0
- package/dist/internal/c4/scan-storage.js +10 -0
- package/dist/internal/c4/scan-storage.js.map +1 -0
- package/dist/internal/c4/scanning.d.ts +4 -41
- package/dist/internal/c4/scanning.d.ts.map +1 -1
- package/dist/internal/c4/scanning.js +27 -108
- package/dist/internal/c4/scanning.js.map +1 -1
- package/dist/internal/c4/ship-import.d.ts +4 -0
- package/dist/internal/c4/ship-import.d.ts.map +1 -0
- package/dist/internal/c4/ship-import.js +13 -0
- package/dist/internal/c4/ship-import.js.map +1 -0
- package/dist/internal/c4/ship-stats.d.ts.map +1 -1
- package/dist/internal/c4/ship-stats.js +46 -44
- package/dist/internal/c4/ship-stats.js.map +1 -1
- package/dist/internal/c4/starbase.d.ts +0 -32
- package/dist/internal/c4/starbase.d.ts.map +1 -1
- package/dist/internal/c4/starbase.js +26 -136
- package/dist/internal/c4/starbase.js.map +1 -1
- package/dist/internal/c4/stimulant.d.ts +26 -0
- package/dist/internal/c4/stimulant.d.ts.map +1 -0
- package/dist/internal/c4/stimulant.js +36 -0
- package/dist/internal/c4/stimulant.js.map +1 -0
- package/dist/internal/c4/wallet-cargo-cache.js +2 -1
- package/dist/internal/c4/wallet-cargo-cache.js.map +1 -1
- package/dist/internal/c4/world.d.ts +40 -7
- package/dist/internal/c4/world.d.ts.map +1 -1
- package/dist/internal/c4/world.js +87 -129
- package/dist/internal/c4/world.js.map +1 -1
- package/dist/internal/cargo.d.ts +2 -0
- package/dist/internal/cargo.d.ts.map +1 -1
- package/dist/internal/cargo.js +8 -0
- package/dist/internal/cargo.js.map +1 -1
- package/dist/internal/fleet-route.d.ts +12 -0
- package/dist/internal/fleet-route.d.ts.map +1 -0
- package/dist/internal/fleet-route.js +11 -0
- package/dist/internal/fleet-route.js.map +1 -0
- package/dist/internal/fleet.d.ts +3 -2
- package/dist/internal/fleet.d.ts.map +1 -1
- package/dist/internal/fleet.js +3 -5
- package/dist/internal/fleet.js.map +1 -1
- package/dist/internal/loyalty-atlas-bank-state.d.ts +17 -0
- package/dist/internal/loyalty-atlas-bank-state.d.ts.map +1 -0
- package/dist/internal/loyalty-atlas-bank-state.js +11 -0
- package/dist/internal/loyalty-atlas-bank-state.js.map +1 -0
- package/dist/internal/planning/account-state.d.ts +6 -0
- package/dist/internal/planning/account-state.d.ts.map +1 -1
- package/dist/internal/planning/account-state.js +13 -0
- package/dist/internal/planning/account-state.js.map +1 -1
- package/dist/internal/planning/action-runtime.d.ts +38 -0
- package/dist/internal/planning/action-runtime.d.ts.map +1 -0
- package/dist/internal/planning/action-runtime.js +63 -0
- package/dist/internal/planning/action-runtime.js.map +1 -0
- package/dist/internal/planning/arrival-guards.d.ts +19 -0
- package/dist/internal/planning/arrival-guards.d.ts.map +1 -0
- package/dist/internal/planning/arrival-guards.js +172 -0
- package/dist/internal/planning/arrival-guards.js.map +1 -0
- package/dist/internal/planning/authorization-adapter.d.ts +53 -39
- package/dist/internal/planning/authorization-adapter.d.ts.map +1 -1
- package/dist/internal/planning/authorization-adapter.js +204 -83
- package/dist/internal/planning/authorization-adapter.js.map +1 -1
- package/dist/internal/planning/cargo-storage-actions.d.ts +8 -0
- package/dist/internal/planning/cargo-storage-actions.d.ts.map +1 -0
- package/dist/internal/planning/cargo-storage-actions.js +97 -0
- package/dist/internal/planning/cargo-storage-actions.js.map +1 -0
- package/dist/internal/planning/character-access.d.ts +28 -0
- package/dist/internal/planning/character-access.d.ts.map +1 -0
- package/dist/internal/planning/character-access.js +41 -0
- package/dist/internal/planning/character-access.js.map +1 -0
- package/dist/internal/planning/character-registration-guard.d.ts +4 -0
- package/dist/internal/planning/character-registration-guard.d.ts.map +1 -0
- package/dist/internal/planning/character-registration-guard.js +59 -0
- package/dist/internal/planning/character-registration-guard.js.map +1 -0
- package/dist/internal/planning/character-registration.d.ts +23 -0
- package/dist/internal/planning/character-registration.d.ts.map +1 -0
- package/dist/internal/planning/character-registration.js +87 -0
- package/dist/internal/planning/character-registration.js.map +1 -0
- package/dist/internal/planning/claim-stake-storage-actions.d.ts +12 -0
- package/dist/internal/planning/claim-stake-storage-actions.d.ts.map +1 -0
- package/dist/internal/planning/claim-stake-storage-actions.js +63 -0
- package/dist/internal/planning/claim-stake-storage-actions.js.map +1 -0
- package/dist/internal/planning/combat-storage-actions.d.ts +9 -0
- package/dist/internal/planning/combat-storage-actions.d.ts.map +1 -0
- package/dist/internal/planning/combat-storage-actions.js +55 -0
- package/dist/internal/planning/combat-storage-actions.js.map +1 -0
- package/dist/internal/planning/crafting-storage-actions.d.ts +7 -0
- package/dist/internal/planning/crafting-storage-actions.d.ts.map +1 -0
- package/dist/internal/planning/crafting-storage-actions.js +64 -0
- package/dist/internal/planning/crafting-storage-actions.js.map +1 -0
- package/dist/internal/planning/currency-cache-guard.d.ts +6 -0
- package/dist/internal/planning/currency-cache-guard.d.ts.map +1 -0
- package/dist/internal/planning/currency-cache-guard.js +77 -0
- package/dist/internal/planning/currency-cache-guard.js.map +1 -0
- package/dist/internal/planning/democracy-history.d.ts +50 -0
- package/dist/internal/planning/democracy-history.d.ts.map +1 -0
- package/dist/internal/planning/democracy-history.js +189 -0
- package/dist/internal/planning/democracy-history.js.map +1 -0
- package/dist/internal/planning/direct-options.d.ts +17 -0
- package/dist/internal/planning/direct-options.d.ts.map +1 -0
- package/dist/internal/planning/direct-options.js +43 -0
- package/dist/internal/planning/direct-options.js.map +1 -0
- package/dist/internal/planning/disband-storage-actions.d.ts +9 -0
- package/dist/internal/planning/disband-storage-actions.d.ts.map +1 -0
- package/dist/internal/planning/disband-storage-actions.js +24 -0
- package/dist/internal/planning/disband-storage-actions.js.map +1 -0
- package/dist/internal/planning/faction-enrollment.d.ts +0 -4
- package/dist/internal/planning/faction-enrollment.d.ts.map +1 -1
- package/dist/internal/planning/faction-enrollment.js +1 -31
- package/dist/internal/planning/faction-enrollment.js.map +1 -1
- package/dist/internal/planning/faction-trade-guards.d.ts +30 -0
- package/dist/internal/planning/faction-trade-guards.d.ts.map +1 -0
- package/dist/internal/planning/faction-trade-guards.js +15 -0
- package/dist/internal/planning/faction-trade-guards.js.map +1 -0
- package/dist/internal/planning/faction-trade-state.d.ts +16 -0
- package/dist/internal/planning/faction-trade-state.d.ts.map +1 -0
- package/dist/internal/planning/faction-trade-state.js +43 -0
- package/dist/internal/planning/faction-trade-state.js.map +1 -0
- package/dist/internal/planning/fleet-arrival.d.ts +40 -0
- package/dist/internal/planning/fleet-arrival.d.ts.map +1 -0
- package/dist/internal/planning/fleet-arrival.js +107 -0
- package/dist/internal/planning/fleet-arrival.js.map +1 -0
- package/dist/internal/planning/fleet-attack-xp.d.ts +20 -0
- package/dist/internal/planning/fleet-attack-xp.d.ts.map +1 -0
- package/dist/internal/planning/fleet-attack-xp.js +104 -0
- package/dist/internal/planning/fleet-attack-xp.js.map +1 -0
- package/dist/internal/planning/fleet-creation.d.ts +30 -0
- package/dist/internal/planning/fleet-creation.d.ts.map +1 -0
- package/dist/internal/planning/fleet-creation.js +89 -0
- package/dist/internal/planning/fleet-creation.js.map +1 -0
- package/dist/internal/planning/fleet-crew-guard.d.ts +28 -0
- package/dist/internal/planning/fleet-crew-guard.d.ts.map +1 -0
- package/dist/internal/planning/fleet-crew-guard.js +48 -0
- package/dist/internal/planning/fleet-crew-guard.js.map +1 -0
- package/dist/internal/planning/fleet-crew-transfer.d.ts +7 -0
- package/dist/internal/planning/fleet-crew-transfer.d.ts.map +1 -0
- package/dist/internal/planning/fleet-crew-transfer.js +129 -0
- package/dist/internal/planning/fleet-crew-transfer.js.map +1 -0
- package/dist/internal/planning/fleet-disband-guard.d.ts +12 -0
- package/dist/internal/planning/fleet-disband-guard.d.ts.map +1 -0
- package/dist/internal/planning/fleet-disband-guard.js +54 -0
- package/dist/internal/planning/fleet-disband-guard.js.map +1 -0
- package/dist/internal/planning/fleet-disband.d.ts +36 -0
- package/dist/internal/planning/fleet-disband.d.ts.map +1 -0
- package/dist/internal/planning/fleet-disband.js +82 -0
- package/dist/internal/planning/fleet-disband.js.map +1 -0
- package/dist/internal/planning/fleet-dock-funding-guard.d.ts +42 -0
- package/dist/internal/planning/fleet-dock-funding-guard.d.ts.map +1 -0
- package/dist/internal/planning/fleet-dock-funding-guard.js +216 -0
- package/dist/internal/planning/fleet-dock-funding-guard.js.map +1 -0
- package/dist/internal/planning/fleet-dock-funding.d.ts +9 -0
- package/dist/internal/planning/fleet-dock-funding.d.ts.map +1 -0
- package/dist/internal/planning/fleet-dock-funding.js +164 -0
- package/dist/internal/planning/fleet-dock-funding.js.map +1 -0
- package/dist/internal/planning/fleet-docking-guard.d.ts +4 -0
- package/dist/internal/planning/fleet-docking-guard.d.ts.map +1 -0
- package/dist/internal/planning/fleet-docking-guard.js +44 -0
- package/dist/internal/planning/fleet-docking-guard.js.map +1 -0
- package/dist/internal/planning/fleet-docking.d.ts +25 -0
- package/dist/internal/planning/fleet-docking.d.ts.map +1 -0
- package/dist/internal/planning/fleet-docking.js +106 -0
- package/dist/internal/planning/fleet-docking.js.map +1 -0
- package/dist/internal/planning/fleet-rental.d.ts +5 -0
- package/dist/internal/planning/fleet-rental.d.ts.map +1 -0
- package/dist/internal/planning/fleet-rental.js +9 -0
- package/dist/internal/planning/fleet-rental.js.map +1 -0
- package/dist/internal/planning/fleet-respawn.d.ts +28 -0
- package/dist/internal/planning/fleet-respawn.d.ts.map +1 -0
- package/dist/internal/planning/fleet-respawn.js +164 -0
- package/dist/internal/planning/fleet-respawn.js.map +1 -0
- package/dist/internal/planning/fleet-ship-assembly.d.ts +38 -0
- package/dist/internal/planning/fleet-ship-assembly.d.ts.map +1 -0
- package/dist/internal/planning/fleet-ship-assembly.js +167 -0
- package/dist/internal/planning/fleet-ship-assembly.js.map +1 -0
- package/dist/internal/planning/fleet-state.d.ts +25 -0
- package/dist/internal/planning/fleet-state.d.ts.map +1 -0
- package/dist/internal/planning/fleet-state.js +28 -0
- package/dist/internal/planning/fleet-state.js.map +1 -0
- package/dist/internal/planning/governance-fees.d.ts +64 -0
- package/dist/internal/planning/governance-fees.d.ts.map +1 -0
- package/dist/internal/planning/governance-fees.js +231 -0
- package/dist/internal/planning/governance-fees.js.map +1 -0
- package/dist/internal/planning/local-market-order-funding.d.ts +8 -0
- package/dist/internal/planning/local-market-order-funding.d.ts.map +1 -0
- package/dist/internal/planning/local-market-order-funding.js +128 -0
- package/dist/internal/planning/local-market-order-funding.js.map +1 -0
- package/dist/internal/planning/local-market-order.d.ts +40 -0
- package/dist/internal/planning/local-market-order.d.ts.map +1 -0
- package/dist/internal/planning/local-market-order.js +139 -0
- package/dist/internal/planning/local-market-order.js.map +1 -0
- package/dist/internal/planning/market-storage-actions.d.ts +7 -0
- package/dist/internal/planning/market-storage-actions.d.ts.map +1 -0
- package/dist/internal/planning/market-storage-actions.js +71 -0
- package/dist/internal/planning/market-storage-actions.js.map +1 -0
- package/dist/internal/planning/mining-stop.d.ts +14 -0
- package/dist/internal/planning/mining-stop.d.ts.map +1 -0
- package/dist/internal/planning/mining-stop.js +42 -0
- package/dist/internal/planning/mining-stop.js.map +1 -0
- package/dist/internal/planning/mining-storage-actions.d.ts +11 -0
- package/dist/internal/planning/mining-storage-actions.d.ts.map +1 -0
- package/dist/internal/planning/mining-storage-actions.js +57 -0
- package/dist/internal/planning/mining-storage-actions.js.map +1 -0
- package/dist/internal/planning/movement-storage-actions.d.ts +7 -0
- package/dist/internal/planning/movement-storage-actions.d.ts.map +1 -0
- package/dist/internal/planning/movement-storage-actions.js +38 -0
- package/dist/internal/planning/movement-storage-actions.js.map +1 -0
- package/dist/internal/planning/movement-xp-guard.d.ts +4 -0
- package/dist/internal/planning/movement-xp-guard.d.ts.map +1 -0
- package/dist/internal/planning/movement-xp-guard.js +104 -0
- package/dist/internal/planning/movement-xp-guard.js.map +1 -0
- package/dist/internal/planning/open-signal-guard.d.ts +3 -0
- package/dist/internal/planning/open-signal-guard.d.ts.map +1 -0
- package/dist/internal/planning/open-signal-guard.js +32 -0
- package/dist/internal/planning/open-signal-guard.js.map +1 -0
- package/dist/internal/planning/open-signal.d.ts +31 -0
- package/dist/internal/planning/open-signal.d.ts.map +1 -0
- package/dist/internal/planning/open-signal.js +94 -0
- package/dist/internal/planning/open-signal.js.map +1 -0
- package/dist/internal/planning/original-token.d.ts +40 -0
- package/dist/internal/planning/original-token.d.ts.map +1 -0
- package/dist/internal/planning/original-token.js +112 -0
- package/dist/internal/planning/original-token.js.map +1 -0
- package/dist/internal/planning/own-starbase-facts.d.ts +37 -0
- package/dist/internal/planning/own-starbase-facts.d.ts.map +1 -0
- package/dist/internal/planning/own-starbase-facts.js +52 -0
- package/dist/internal/planning/own-starbase-facts.js.map +1 -0
- package/dist/internal/planning/plan-fields.d.ts +60 -0
- package/dist/internal/planning/plan-fields.d.ts.map +1 -0
- package/dist/internal/planning/plan-fields.js +159 -0
- package/dist/internal/planning/plan-fields.js.map +1 -0
- package/dist/internal/planning/plan-guards.d.ts +4 -0
- package/dist/internal/planning/plan-guards.d.ts.map +1 -0
- package/dist/internal/planning/plan-guards.js +184 -0
- package/dist/internal/planning/plan-guards.js.map +1 -0
- package/dist/internal/planning/profile-key.d.ts +13 -0
- package/dist/internal/planning/profile-key.d.ts.map +1 -0
- package/dist/internal/planning/profile-key.js +20 -0
- package/dist/internal/planning/profile-key.js.map +1 -0
- package/dist/internal/planning/profile-storage-funding-guard.d.ts +29 -0
- package/dist/internal/planning/profile-storage-funding-guard.d.ts.map +1 -0
- package/dist/internal/planning/profile-storage-funding-guard.js +115 -0
- package/dist/internal/planning/profile-storage-funding-guard.js.map +1 -0
- package/dist/internal/planning/profile-storage-funding.d.ts +46 -0
- package/dist/internal/planning/profile-storage-funding.d.ts.map +1 -0
- package/dist/internal/planning/profile-storage-funding.js +58 -0
- package/dist/internal/planning/profile-storage-funding.js.map +1 -0
- package/dist/internal/planning/recipe-state.d.ts +9 -0
- package/dist/internal/planning/recipe-state.d.ts.map +1 -0
- package/dist/internal/planning/recipe-state.js +23 -0
- package/dist/internal/planning/recipe-state.js.map +1 -0
- package/dist/internal/planning/region-access.d.ts +30 -0
- package/dist/internal/planning/region-access.d.ts.map +1 -0
- package/dist/internal/planning/region-access.js +94 -0
- package/dist/internal/planning/region-access.js.map +1 -0
- package/dist/internal/planning/rent-catalog.d.ts +37 -0
- package/dist/internal/planning/rent-catalog.d.ts.map +1 -0
- package/dist/internal/planning/rent-catalog.js +165 -0
- package/dist/internal/planning/rent-catalog.js.map +1 -0
- package/dist/internal/planning/rent.d.ts +19 -0
- package/dist/internal/planning/rent.d.ts.map +1 -0
- package/dist/internal/planning/rent.js +35 -0
- package/dist/internal/planning/rent.js.map +1 -0
- package/dist/internal/planning/research-unlock.d.ts +69 -0
- package/dist/internal/planning/research-unlock.d.ts.map +1 -0
- package/dist/internal/planning/research-unlock.js +287 -0
- package/dist/internal/planning/research-unlock.js.map +1 -0
- package/dist/internal/planning/respawn-guards.d.ts +3 -0
- package/dist/internal/planning/respawn-guards.d.ts.map +1 -0
- package/dist/internal/planning/respawn-guards.js +42 -0
- package/dist/internal/planning/respawn-guards.js.map +1 -0
- package/dist/internal/planning/runtime-guards.d.ts +41 -0
- package/dist/internal/planning/runtime-guards.d.ts.map +1 -0
- package/dist/internal/planning/runtime-guards.js +658 -0
- package/dist/internal/planning/runtime-guards.js.map +1 -0
- package/dist/internal/planning/scan-completion-guard.d.ts +43 -0
- package/dist/internal/planning/scan-completion-guard.d.ts.map +1 -0
- package/dist/internal/planning/scan-completion-guard.js +95 -0
- package/dist/internal/planning/scan-completion-guard.js.map +1 -0
- package/dist/internal/planning/scan-completion.d.ts +20 -0
- package/dist/internal/planning/scan-completion.d.ts.map +1 -0
- package/dist/internal/planning/scan-completion.js +198 -0
- package/dist/internal/planning/scan-completion.js.map +1 -0
- package/dist/internal/planning/scan-detect-guard.d.ts +34 -0
- package/dist/internal/planning/scan-detect-guard.d.ts.map +1 -0
- package/dist/internal/planning/scan-detect-guard.js +77 -0
- package/dist/internal/planning/scan-detect-guard.js.map +1 -0
- package/dist/internal/planning/scan-detect.d.ts +24 -0
- package/dist/internal/planning/scan-detect.d.ts.map +1 -0
- package/dist/internal/planning/scan-detect.js +246 -0
- package/dist/internal/planning/scan-detect.js.map +1 -0
- package/dist/internal/planning/scan-idle-scope.d.ts +5 -0
- package/dist/internal/planning/scan-idle-scope.d.ts.map +1 -0
- package/dist/internal/planning/scan-idle-scope.js +5 -0
- package/dist/internal/planning/scan-idle-scope.js.map +1 -0
- package/dist/internal/planning/scan-input.d.ts +9 -0
- package/dist/internal/planning/scan-input.d.ts.map +1 -0
- package/dist/internal/planning/scan-input.js +58 -0
- package/dist/internal/planning/scan-input.js.map +1 -0
- package/dist/internal/planning/scan-storage-actions.d.ts +9 -0
- package/dist/internal/planning/scan-storage-actions.d.ts.map +1 -0
- package/dist/internal/planning/scan-storage-actions.js +27 -0
- package/dist/internal/planning/scan-storage-actions.js.map +1 -0
- package/dist/internal/planning/ship-import-funding.d.ts +22 -0
- package/dist/internal/planning/ship-import-funding.d.ts.map +1 -0
- package/dist/internal/planning/ship-import-funding.js +53 -0
- package/dist/internal/planning/ship-import-funding.js.map +1 -0
- package/dist/internal/planning/ship-token.d.ts +1 -6
- package/dist/internal/planning/ship-token.d.ts.map +1 -1
- package/dist/internal/planning/ship-token.js +0 -37
- package/dist/internal/planning/ship-token.js.map +1 -1
- package/dist/internal/planning/starbase-player-owner.d.ts +21 -0
- package/dist/internal/planning/starbase-player-owner.d.ts.map +1 -0
- package/dist/internal/planning/starbase-player-owner.js +17 -0
- package/dist/internal/planning/starbase-player-owner.js.map +1 -0
- package/dist/internal/planning/starbase-system-guard.d.ts +6 -0
- package/dist/internal/planning/starbase-system-guard.d.ts.map +1 -0
- package/dist/internal/planning/starbase-system-guard.js +94 -0
- package/dist/internal/planning/starbase-system-guard.js.map +1 -0
- package/dist/internal/planning/starbase-system.d.ts +15 -0
- package/dist/internal/planning/starbase-system.d.ts.map +1 -0
- package/dist/internal/planning/starbase-system.js +25 -0
- package/dist/internal/planning/starbase-system.js.map +1 -0
- package/dist/internal/planning/storage-action-readers.d.ts +10 -0
- package/dist/internal/planning/storage-action-readers.d.ts.map +1 -0
- package/dist/internal/planning/storage-action-readers.js +58 -0
- package/dist/internal/planning/storage-action-readers.js.map +1 -0
- package/dist/internal/planning/storage-actions.d.ts +89 -0
- package/dist/internal/planning/storage-actions.d.ts.map +1 -0
- package/dist/internal/planning/storage-actions.js +183 -0
- package/dist/internal/planning/storage-actions.js.map +1 -0
- package/dist/internal/planning/token-mint.d.ts.map +1 -1
- package/dist/internal/planning/token-mint.js +2 -1
- package/dist/internal/planning/token-mint.js.map +1 -1
- package/dist/internal/planning/trade-faction-market.d.ts +20 -0
- package/dist/internal/planning/trade-faction-market.d.ts.map +1 -0
- package/dist/internal/planning/trade-faction-market.js +56 -0
- package/dist/internal/planning/trade-faction-market.js.map +1 -0
- package/dist/internal/planning/wallet-starbase.d.ts +34 -0
- package/dist/internal/planning/wallet-starbase.d.ts.map +1 -0
- package/dist/internal/planning/wallet-starbase.js +39 -0
- package/dist/internal/planning/wallet-starbase.js.map +1 -0
- package/dist/internal/planning/xp-runtime.d.ts +36 -0
- package/dist/internal/planning/xp-runtime.d.ts.map +1 -0
- package/dist/internal/planning/xp-runtime.js +122 -0
- package/dist/internal/planning/xp-runtime.js.map +1 -0
- package/dist/internal/read-meta.d.ts +12 -0
- package/dist/internal/read-meta.d.ts.map +1 -1
- package/dist/internal/read-meta.js +10 -0
- package/dist/internal/read-meta.js.map +1 -1
- package/dist/internal/system-program.d.ts +4 -0
- package/dist/internal/system-program.d.ts.map +1 -0
- package/dist/internal/system-program.js +3 -0
- package/dist/internal/system-program.js.map +1 -0
- package/dist/loyalty/actions/index.d.ts +1 -1
- package/dist/loyalty/actions/index.d.ts.map +1 -1
- package/dist/loyalty/actions/index.js +16 -46
- package/dist/loyalty/actions/index.js.map +1 -1
- package/dist/loyalty/index.d.ts +4 -0
- package/dist/loyalty/index.d.ts.map +1 -1
- package/dist/loyalty/index.js +21 -33
- package/dist/loyalty/index.js.map +1 -1
- package/dist/markets/actions/index.d.ts +62 -4
- package/dist/markets/actions/index.d.ts.map +1 -1
- package/dist/markets/actions/index.js +261 -187
- package/dist/markets/actions/index.js.map +1 -1
- package/dist/markets/actions/trade-faction-market.d.ts +45 -0
- package/dist/markets/actions/trade-faction-market.d.ts.map +1 -0
- package/dist/markets/actions/trade-faction-market.js +311 -0
- package/dist/markets/actions/trade-faction-market.js.map +1 -0
- package/dist/markets/index.d.ts +38 -7
- package/dist/markets/index.d.ts.map +1 -1
- package/dist/markets/index.js +59 -20
- package/dist/markets/index.js.map +1 -1
- package/dist/mining/actions/index.d.ts +19 -15
- package/dist/mining/actions/index.d.ts.map +1 -1
- package/dist/mining/actions/index.js +147 -69
- package/dist/mining/actions/index.js.map +1 -1
- package/dist/mining/estimate-input.d.ts +103 -0
- package/dist/mining/estimate-input.d.ts.map +1 -0
- package/dist/mining/estimate-input.js +86 -0
- package/dist/mining/estimate-input.js.map +1 -0
- package/dist/mining/estimate.d.ts +114 -0
- package/dist/mining/estimate.d.ts.map +1 -0
- package/dist/mining/estimate.js +127 -0
- package/dist/mining/estimate.js.map +1 -0
- package/dist/mining/index.d.ts +10 -2
- package/dist/mining/index.d.ts.map +1 -1
- package/dist/mining/index.js +11 -13
- package/dist/mining/index.js.map +1 -1
- package/dist/mining/profile.d.ts +82 -0
- package/dist/mining/profile.d.ts.map +1 -0
- package/dist/mining/profile.js +109 -0
- package/dist/mining/profile.js.map +1 -0
- package/dist/planning/assembly.d.ts +6 -1
- package/dist/planning/assembly.d.ts.map +1 -1
- package/dist/planning/assembly.js +12 -8
- package/dist/planning/assembly.js.map +1 -1
- package/dist/planning/execution.d.ts +19 -3
- package/dist/planning/execution.d.ts.map +1 -1
- package/dist/planning/execution.js +623 -72
- package/dist/planning/execution.js.map +1 -1
- package/dist/planning/index.d.ts +252 -165
- package/dist/planning/index.d.ts.map +1 -1
- package/dist/planning/index.js +31 -388
- package/dist/planning/index.js.map +1 -1
- package/dist/planning/plan-construction.d.ts +25 -0
- package/dist/planning/plan-construction.d.ts.map +1 -0
- package/dist/planning/plan-construction.js +143 -0
- package/dist/planning/plan-construction.js.map +1 -0
- package/dist/planning/plan-sequence-checkpoint.d.ts +9 -0
- package/dist/planning/plan-sequence-checkpoint.d.ts.map +1 -1
- package/dist/planning/plan-sequence-checkpoint.js +16 -7
- package/dist/planning/plan-sequence-checkpoint.js.map +1 -1
- package/dist/planning/plan-sequence-execution.d.ts +5 -0
- package/dist/planning/plan-sequence-execution.d.ts.map +1 -1
- package/dist/planning/plan-sequence-execution.js +74 -40
- package/dist/planning/plan-sequence-execution.js.map +1 -1
- package/dist/planning/plan-sequence.d.ts +2 -1
- package/dist/planning/plan-sequence.d.ts.map +1 -1
- package/dist/planning/plan-sequence.js +8 -1
- package/dist/planning/plan-sequence.js.map +1 -1
- package/dist/planning/plan-validation.d.ts +17 -0
- package/dist/planning/plan-validation.d.ts.map +1 -0
- package/dist/planning/plan-validation.js +143 -0
- package/dist/planning/plan-validation.js.map +1 -0
- package/dist/planning/simulation.d.ts +25 -1
- package/dist/planning/simulation.d.ts.map +1 -1
- package/dist/planning/simulation.js +111 -11
- package/dist/planning/simulation.js.map +1 -1
- package/dist/registry/cargo.d.ts +7 -12
- package/dist/registry/cargo.d.ts.map +1 -1
- package/dist/registry/cargo.js +19 -20
- package/dist/registry/cargo.js.map +1 -1
- package/dist/registry/docking.d.ts +10 -0
- package/dist/registry/docking.d.ts.map +1 -0
- package/dist/registry/docking.js +12 -0
- package/dist/registry/docking.js.map +1 -0
- package/dist/registry/index.d.ts +35 -4
- package/dist/registry/index.d.ts.map +1 -1
- package/dist/registry/index.js +226 -227
- package/dist/registry/index.js.map +1 -1
- package/dist/registry/onboarding.d.ts +10 -2
- package/dist/registry/onboarding.d.ts.map +1 -1
- package/dist/registry/onboarding.js +22 -7
- package/dist/registry/onboarding.js.map +1 -1
- package/dist/registry/scanning.d.ts +7 -0
- package/dist/registry/scanning.d.ts.map +1 -0
- package/dist/registry/scanning.js +13 -0
- package/dist/registry/scanning.js.map +1 -0
- package/dist/registry/ship-stats-snapshot.d.ts.map +1 -1
- package/dist/registry/ship-stats-snapshot.js +38 -24
- package/dist/registry/ship-stats-snapshot.js.map +1 -1
- package/dist/registry/ships.d.ts +22 -2
- package/dist/registry/ships.d.ts.map +1 -1
- package/dist/registry/ships.js +31 -4
- package/dist/registry/ships.js.map +1 -1
- package/dist/registry/xp-runtime.d.ts +4 -0
- package/dist/registry/xp-runtime.d.ts.map +1 -0
- package/dist/registry/xp-runtime.js +14 -0
- package/dist/registry/xp-runtime.js.map +1 -0
- package/dist/rewards/index.d.ts +11 -5
- package/dist/rewards/index.d.ts.map +1 -1
- package/dist/rewards/index.js +10 -21
- package/dist/rewards/index.js.map +1 -1
- package/dist/scanning/actions/index.d.ts +116 -0
- package/dist/scanning/actions/index.d.ts.map +1 -0
- package/dist/scanning/actions/index.js +215 -0
- package/dist/scanning/actions/index.js.map +1 -0
- package/dist/scanning/index.d.ts +10 -12
- package/dist/scanning/index.d.ts.map +1 -1
- package/dist/scanning/index.js +19 -23
- package/dist/scanning/index.js.map +1 -1
- package/dist/scanning/lifecycle.d.ts +77 -0
- package/dist/scanning/lifecycle.d.ts.map +1 -0
- package/dist/scanning/lifecycle.js +93 -0
- package/dist/scanning/lifecycle.js.map +1 -0
- package/dist/scanning/odds.d.ts +115 -0
- package/dist/scanning/odds.d.ts.map +1 -0
- package/dist/scanning/odds.js +294 -0
- package/dist/scanning/odds.js.map +1 -0
- package/dist/scanning/signals.d.ts +126 -0
- package/dist/scanning/signals.d.ts.map +1 -0
- package/dist/scanning/signals.js +173 -0
- package/dist/scanning/signals.js.map +1 -0
- package/dist/starbases/actions/index.d.ts +6 -4
- package/dist/starbases/actions/index.d.ts.map +1 -1
- package/dist/starbases/actions/index.js +34 -67
- package/dist/starbases/actions/index.js.map +1 -1
- package/dist/starbases/index.d.ts.map +1 -1
- package/dist/starbases/index.js +3 -11
- package/dist/starbases/index.js.map +1 -1
- package/dist/world/index.d.ts +108 -5
- package/dist/world/index.d.ts.map +1 -1
- package/dist/world/index.js +110 -15
- package/dist/world/index.js.map +1 -1
- package/dist/world/planet-claim-stake-plots.d.ts +139 -0
- package/dist/world/planet-claim-stake-plots.d.ts.map +1 -0
- package/dist/world/planet-claim-stake-plots.js +117 -0
- package/dist/world/planet-claim-stake-plots.js.map +1 -0
- package/dist/world/starbase-status.d.ts +176 -0
- package/dist/world/starbase-status.d.ts.map +1 -0
- package/dist/world/starbase-status.js +153 -0
- package/dist/world/starbase-status.js.map +1 -0
- package/package.json +6 -2
|
@@ -1,20 +1,32 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { fleetAttackInstructionKey, validateFleetAttackActors, } from '../../internal/planning/fleet-attack-xp.js';
|
|
2
|
+
import { resolveXpRuntime } from '../../internal/planning/xp-runtime.js';
|
|
3
|
+
import { hashRegionAccess, regionsContainingSystem, } from '../../internal/planning/region-access.js';
|
|
4
|
+
import { isAddress } from '@solana/kit';
|
|
5
|
+
import { requireDisabledLevelRent } from '../../internal/planning/rent-catalog.js';
|
|
6
|
+
import { resolveActionRuntime } from '../../internal/planning/action-runtime.js';
|
|
2
7
|
import { InvalidActionInputError, SageSdkError } from '../../client/errors.js';
|
|
3
8
|
import { readContextRawAccounts } from '../../client/reconciliation.js';
|
|
4
|
-
import {
|
|
5
|
-
import { lootAccountDefinition, } from '../../internal/c4/
|
|
9
|
+
import { getRetrieveLootInstructionDataEncoder } from '../../internal/c4/runtime-bindings.js';
|
|
10
|
+
import { lootAccountDefinition, } from '../../internal/c4/loot.js';
|
|
6
11
|
import { deriveFleetAddress, fleetAccountDefinition, } from '../../internal/c4/fleet.js';
|
|
7
|
-
import { deriveFleetCrewBindingAddress, fleetCrewBindingAccountDefinition, } from '../../internal/c4/fleet-crew-binding.js';
|
|
12
|
+
import { deriveFleetCrewBindingAddress, fleetCrewBindingAccountDefinition, matchesFleetCrewBindingIdentity, } from '../../internal/c4/fleet-crew-binding.js';
|
|
8
13
|
import { deriveFactionAccountAddress, deriveFactionEconomicsConfigAddress, deriveFactionOwnershipAddress, deriveFactionRelationTrackerAddress, deriveFactionTreasuryAddress, deriveKingSystemTrackerAddress, deriveRegionTrackerAddress, factionAccountDefinition, factionEconomicsConfigAccountDefinition, factionOwnershipAccountDefinition, factionRelationTrackerAccountDefinition, factionTreasuryAccountDefinition, kingSystemTrackerAccountDefinition, regionTrackerAccountDefinition, } from '../../internal/c4/factions.js';
|
|
9
|
-
import {
|
|
14
|
+
import { factionValue } from '../../internal/c4/faction.js';
|
|
15
|
+
import { characterAccountDefinition, findCharacterPda, } from '../../internal/c4/character.js';
|
|
10
16
|
import { deriveLoyaltyContributionAddress, deriveLoyaltyEpochAddress, loyaltyContributionAccountDefinition, loyaltyEpochAccountDefinition, } from '../../internal/c4/loyalty.js';
|
|
11
17
|
import { atlasRewardConfigAccountDefinition, atlasRewardRegistryAccountDefinition, deriveAtlasRewardConfigAddress, deriveAtlasRewardRegistryAddress, } from '../../internal/c4/rewards.js';
|
|
12
18
|
import { deriveStarSystemAddress, starSystemAccountDefinition, } from '../../internal/c4/world.js';
|
|
13
19
|
import { requireGameAddress } from '../../internal/game-context.js';
|
|
14
|
-
import { adaptApplyCombatStimulantInstruction, adaptAttackFleetInstruction, adaptAttackStarbaseInstruction, adaptRetrieveLootInstruction,
|
|
15
|
-
import {
|
|
20
|
+
import { adaptApplyCombatStimulantInstruction, adaptAttackFleetInstruction, adaptAttackStarbaseInstruction, adaptRetrieveLootInstruction, readPlanAuthorization, } from '../../internal/planning/authorization-adapter.js';
|
|
21
|
+
import { buildPlannerPlan } from '../../planning/plan-construction.js';
|
|
16
22
|
import { readGameCombatConfiguration } from '../../registry/combat.js';
|
|
23
|
+
import { CLOCK_ADDRESS, readClock, } from '../../internal/planning/faction-enrollment.js';
|
|
17
24
|
import { resolveCargo, } from '../../registry/index.js';
|
|
25
|
+
import { accountAbsentPrecondition, accountStatePrecondition, } from '../../internal/planning/account-state.js';
|
|
26
|
+
import { stimulantStatId } from '../../internal/c4/stimulant.js';
|
|
27
|
+
import { readCombatStorageAction } from '../../internal/planning/combat-storage-actions.js';
|
|
28
|
+
import { RENT_ADDRESS } from '../../internal/planning/rent.js';
|
|
29
|
+
import { planStorageFunding } from '../../internal/planning/storage-actions.js';
|
|
18
30
|
function invalid(field, value, acceptedRange, remedy) {
|
|
19
31
|
throw new InvalidActionInputError(field, value, acceptedRange, remedy);
|
|
20
32
|
}
|
|
@@ -35,19 +47,13 @@ function assertKeys(value, field, required, optional = []) {
|
|
|
35
47
|
function validateOptions(value) {
|
|
36
48
|
const options = readRecord(value, 'options');
|
|
37
49
|
assertKeys(options, 'options', ['authorization']);
|
|
38
|
-
const
|
|
39
|
-
assertKeys(authorizationRecord, 'authorization', ['profile', 'authority', 'keyIndex'], ['certificate']);
|
|
40
|
-
const authorization = authorizationRecord;
|
|
41
|
-
validatePlanAuthorization(authorization);
|
|
50
|
+
const authorization = readPlanAuthorization(options.authorization);
|
|
42
51
|
return { authorization };
|
|
43
52
|
}
|
|
44
53
|
function validateAttackOptions(value) {
|
|
45
54
|
const options = readRecord(value, 'options');
|
|
46
55
|
assertKeys(options, 'options', ['authorization', 'loot']);
|
|
47
|
-
const
|
|
48
|
-
assertKeys(authorizationRecord, 'authorization', ['profile', 'authority', 'keyIndex'], ['certificate']);
|
|
49
|
-
const authorization = authorizationRecord;
|
|
50
|
-
validatePlanAuthorization(authorization);
|
|
56
|
+
const authorization = readPlanAuthorization(options.authorization);
|
|
51
57
|
if (typeof options.loot !== 'string' || !isAddress(options.loot)) {
|
|
52
58
|
invalid('options.loot', options.loot, 'one valid new Loot account address', 'Generate a new address-only Loot signer and provide its public address before retrying.');
|
|
53
59
|
}
|
|
@@ -66,10 +72,7 @@ function validateAttackStance(value) {
|
|
|
66
72
|
function validateRetrieveOptions(value) {
|
|
67
73
|
const options = readRecord(value, 'options');
|
|
68
74
|
assertKeys(options, 'options', ['authorization', 'atUnixSeconds']);
|
|
69
|
-
const
|
|
70
|
-
assertKeys(authorizationRecord, 'authorization', ['profile', 'authority', 'keyIndex'], ['certificate']);
|
|
71
|
-
const authorization = authorizationRecord;
|
|
72
|
-
validatePlanAuthorization(authorization);
|
|
75
|
+
const authorization = readPlanAuthorization(options.authorization);
|
|
73
76
|
if (typeof options.atUnixSeconds !== 'bigint' || options.atUnixSeconds < 0n) {
|
|
74
77
|
invalid('options.atUnixSeconds', options.atUnixSeconds, 'a non-negative bigint Unix timestamp', 'Provide the explicit current Unix timestamp used to evaluate Loot exclusivity before retrying.');
|
|
75
78
|
}
|
|
@@ -119,13 +122,21 @@ function validateLootSelection(value, loot, fleet, retrievingProfile, atUnixSeco
|
|
|
119
122
|
if (item === undefined) {
|
|
120
123
|
invalid(`${field}.itemIndex`, itemIndex, `an available Loot item index below ${String(loot.items.length)}`, 'Refresh the Loot snapshot and select an existing item before retrying.');
|
|
121
124
|
}
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
+
// The retriever is the Fleet's controlling Profile. Reward cargo stays
|
|
126
|
+
// locked to the destroying Profile until it expires and is swept; ordinary
|
|
127
|
+
// cargo is exclusive to the destroying Profile only until the unlock time.
|
|
128
|
+
const destroyer = item.destroyer?.address;
|
|
129
|
+
if (item.rewardReclaimAtUnixSeconds > 0n) {
|
|
130
|
+
if (destroyer !== retrievingProfile) {
|
|
131
|
+
fail(`Loot item ${String(itemIndex)} is reward cargo locked to ${destroyer === undefined ? 'no destroying Profile' : `destroying Profile ${destroyer}`}, not Profile ${retrievingProfile}. Reward cargo never opens to other Profiles; it is swept after ${String(item.rewardReclaimAtUnixSeconds)} Unix seconds. Choose another item or use the destroying Profile's Fleet before retrying.`, loot.address);
|
|
132
|
+
}
|
|
133
|
+
if (atUnixSeconds > item.rewardReclaimAtUnixSeconds) {
|
|
134
|
+
fail(`Loot item ${String(itemIndex)} reward cargo expired at ${String(item.rewardReclaimAtUnixSeconds)} Unix seconds and is swept to the reward treasury, not retrievable at ${String(atUnixSeconds)}. Choose another item or refresh the Loot before retrying.`, loot.address);
|
|
135
|
+
}
|
|
125
136
|
}
|
|
126
|
-
if (
|
|
127
|
-
|
|
128
|
-
fail(`Loot item ${String(itemIndex)}
|
|
137
|
+
else if (atUnixSeconds < item.exclusivityUnlockAtUnixSeconds &&
|
|
138
|
+
destroyer !== retrievingProfile) {
|
|
139
|
+
fail(`Loot item ${String(itemIndex)} is exclusive to ${destroyer === undefined ? 'no Profile (a Starbase kill)' : `destroying Profile ${destroyer}`} until ${String(item.exclusivityUnlockAtUnixSeconds)} Unix seconds, not Profile ${retrievingProfile}. Use the destroying Profile's Fleet or wait for the exclusivity window to pass before retrying.`, loot.address);
|
|
129
140
|
}
|
|
130
141
|
const cargoRequests = denseArray(target.cargo, `${field}.cargo`);
|
|
131
142
|
if (cargoRequests.length === 0 || cargoRequests.length > 65_536) {
|
|
@@ -162,9 +173,7 @@ function validateLootSelection(value, loot, fleet, retrievingProfile, atUnixSeco
|
|
|
162
173
|
}
|
|
163
174
|
generated.push([itemIndex, encoded]);
|
|
164
175
|
}
|
|
165
|
-
const instructionDataLength =
|
|
166
|
-
.getRetrieveLootInstructionDataEncoder()
|
|
167
|
-
.encode({
|
|
176
|
+
const instructionDataLength = getRetrieveLootInstructionDataEncoder().encode({
|
|
168
177
|
keyIndex: 0,
|
|
169
178
|
want: generated.map(([itemIndex, cargo]) => [
|
|
170
179
|
itemIndex,
|
|
@@ -184,7 +193,7 @@ function requireAccount(account, address, message) {
|
|
|
184
193
|
}
|
|
185
194
|
function stimulantFingerprint(stimulant) {
|
|
186
195
|
const effects = stimulant.effects
|
|
187
|
-
.map(({ charges, deltaBps,
|
|
196
|
+
.map(({ charges, deltaBps, stackRule, stat }) => `${String(charges)}:${String(deltaBps)}:${stackRule}:${stat}`)
|
|
188
197
|
.join(',');
|
|
189
198
|
return [
|
|
190
199
|
stimulant.cargo.id,
|
|
@@ -209,35 +218,14 @@ function rawCargoFingerprint(fleet) {
|
|
|
209
218
|
.join(',');
|
|
210
219
|
return [fleet.cargoHold.seqId, fleet.cargoHold.storageCost, items].join('|');
|
|
211
220
|
}
|
|
212
|
-
async function hashAccountState(account) {
|
|
213
|
-
const owner = getAddressEncoder().encode(account.owner);
|
|
214
|
-
const canonical = new Uint8Array(owner.length + account.data.length);
|
|
215
|
-
canonical.set(owner);
|
|
216
|
-
canonical.set(account.data, owner.length);
|
|
217
|
-
const digest = new Uint8Array(await globalThis.crypto.subtle.digest('SHA-256', canonical));
|
|
218
|
-
return [...digest].map((byte) => byte.toString(16).padStart(2, '0')).join('');
|
|
219
|
-
}
|
|
220
|
-
async function precondition(account, describes) {
|
|
221
|
-
return Object.freeze({
|
|
222
|
-
address: account.address,
|
|
223
|
-
dataHash: await hashAccountState(account),
|
|
224
|
-
describes,
|
|
225
|
-
kind: 'account-state',
|
|
226
|
-
});
|
|
227
|
-
}
|
|
228
|
-
function absentPrecondition(address, describes) {
|
|
229
|
-
return Object.freeze({
|
|
230
|
-
address,
|
|
231
|
-
describes,
|
|
232
|
-
kind: 'account-absent',
|
|
233
|
-
});
|
|
234
|
-
}
|
|
235
221
|
/** Plans application of one configured combat stimulant without predicting its effects.
|
|
236
222
|
*
|
|
237
223
|
* The planner validates Fleet ownership and Game membership, current catalog
|
|
238
|
-
* membership, known cargo balance, crewed
|
|
239
|
-
* whole-account Fleet state.
|
|
240
|
-
*
|
|
224
|
+
* membership, known cargo balance, a crewed Fleet that is neither destroyed
|
|
225
|
+
* nor respawning, and fresh whole-account Fleet state. Only stimulants whose
|
|
226
|
+
* effects use the `refresh` stack rule are planned, as the game applies no
|
|
227
|
+
* other rule yet. Permission, charge application, and combat arithmetic remain
|
|
228
|
+
* chain-authoritative.
|
|
241
229
|
*
|
|
242
230
|
* @example
|
|
243
231
|
* ```ts
|
|
@@ -263,8 +251,13 @@ export async function planFleetApplyCombatStimulant(ctx, fleet, stimulant, input
|
|
|
263
251
|
if (fleet.game !== game) {
|
|
264
252
|
fail(`Fleet ${fleet.address} belongs to Game ${fleet.game}, not configured Game ${game}. Refresh the Fleet through this context and retry.`, fleet.address);
|
|
265
253
|
}
|
|
266
|
-
if (fleet.state.kind === 'destroyed') {
|
|
267
|
-
fail(`Fleet ${fleet.name} (${fleet.address}) is
|
|
254
|
+
if (fleet.state.kind === 'destroyed' || fleet.state.kind === 'respawn') {
|
|
255
|
+
fail(`Fleet ${fleet.name} (${fleet.address}) is ${fleet.state.kind} and cannot apply a combat stimulant. Wait until it is back at a Starbase, refresh it, and retry.`, fleet.address);
|
|
256
|
+
}
|
|
257
|
+
// The game applies only refresh-rule effects and refuses the others.
|
|
258
|
+
const unsupported = stimulant.effects.find(({ stackRule }) => stackRule !== 'refresh');
|
|
259
|
+
if (unsupported !== undefined) {
|
|
260
|
+
fail(`Stimulant ${stimulant.cargo.name} has a ${unsupported.stackRule} effect on ${unsupported.stat}; the game applies only refresh effects. Choose another stimulant.`, fleet.address);
|
|
268
261
|
}
|
|
269
262
|
const combat = await readGameCombatConfiguration(ctx);
|
|
270
263
|
const definitions = await Promise.all(combat.data.stimulantDefinitions.definitions.map(async (definition) => ({
|
|
@@ -310,41 +303,32 @@ export async function planFleetApplyCombatStimulant(ctx, fleet, stimulant, input
|
|
|
310
303
|
if (current.crewCount <= 0) {
|
|
311
304
|
fail(`Fleet ${fleet.name} (${fleet.address}) has no crew and cannot apply a combat stimulant. Crew the Fleet, refresh it through this context, and retry.`, fleet.address);
|
|
312
305
|
}
|
|
313
|
-
const
|
|
314
|
-
|
|
306
|
+
const instruction = adaptApplyCombatStimulantInstruction({
|
|
307
|
+
authorization: options.authorization,
|
|
308
|
+
fleet: fleet.address,
|
|
309
|
+
game,
|
|
310
|
+
stimCargoId: catalogued.cargo.id,
|
|
311
|
+
});
|
|
312
|
+
// A stimulant for a stat without an entry grows the Fleet; the program funds
|
|
313
|
+
// that from the Profile vault with the signing key.
|
|
314
|
+
const storage = await planFleetStorage(ctx, instruction, [account.address], options.authorization.profile, 'combat stimulant', catalogued.effects.map(({ stat }) => stimulantStatId(stat)));
|
|
315
|
+
const description = `Apply one ${catalogued.cargo.name} combat stimulant from Fleet ${fleet.name} (${fleet.address}); permission, stacking, charge application, and combat outcomes remain chain-authoritative. ${storage.disclosure}`;
|
|
316
|
+
return buildPlannerPlan({
|
|
315
317
|
kind: 'combat.apply-stimulant',
|
|
316
318
|
preconditions: [
|
|
317
|
-
await
|
|
319
|
+
await accountStatePrecondition(account, `Fleet ${fleet.name} retains its configured Game, owning Profile, supported crewed state, and known ${catalogued.cargo.name} cargo balance.`),
|
|
320
|
+
storage.guard,
|
|
318
321
|
],
|
|
319
322
|
steps: [
|
|
320
323
|
{
|
|
321
324
|
describes: description,
|
|
322
|
-
instruction
|
|
323
|
-
authorization: options.authorization,
|
|
324
|
-
fleet: fleet.address,
|
|
325
|
-
game,
|
|
326
|
-
stimCargoId: catalogued.cargo.id,
|
|
327
|
-
}),
|
|
325
|
+
instruction,
|
|
328
326
|
signers: [options.authorization.authority],
|
|
329
327
|
},
|
|
330
328
|
],
|
|
331
329
|
summary: description,
|
|
332
330
|
});
|
|
333
331
|
}
|
|
334
|
-
function factionId(fleet) {
|
|
335
|
-
if (fleet.npcFactionId > 0)
|
|
336
|
-
return fleet.npcFactionId;
|
|
337
|
-
switch (fleet.faction) {
|
|
338
|
-
case 'mud':
|
|
339
|
-
return 1;
|
|
340
|
-
case 'oni':
|
|
341
|
-
return 2;
|
|
342
|
-
case 'ustur':
|
|
343
|
-
return 3;
|
|
344
|
-
case 'unaligned':
|
|
345
|
-
return 0;
|
|
346
|
-
}
|
|
347
|
-
}
|
|
348
332
|
function shipFingerprint(fleet) {
|
|
349
333
|
return fleet.ships
|
|
350
334
|
.map(({ id, quantity }) => `${String(id)}:${String(quantity)}`)
|
|
@@ -400,18 +384,36 @@ async function validateCurrentAttackFleet(fleet, account) {
|
|
|
400
384
|
}
|
|
401
385
|
return currentAccount;
|
|
402
386
|
}
|
|
387
|
+
/** The program attacks only with an attacker that is Idle or subwarping at
|
|
388
|
+
* chain time (a finished warp counts as Idle), carries its required crew, and
|
|
389
|
+
* has usable AP: stored AP refills right after an attack, but stays unusable
|
|
390
|
+
* until the reload completes. */
|
|
391
|
+
function validateAttackerReadiness(fleet, account, clock) {
|
|
392
|
+
const now = readClock(requireAccount(clock, CLOCK_ADDRESS, 'The Clock sysvar is missing. Refresh chain time and retry the attack.'));
|
|
393
|
+
const current = fleetAccountDefinition.decode(account);
|
|
394
|
+
const label = `Attacking Fleet ${fleet.name} (${fleet.address})`;
|
|
395
|
+
const { state } = current;
|
|
396
|
+
if (state.kind !== 'idle' &&
|
|
397
|
+
state.kind !== 'subwarp' &&
|
|
398
|
+
!(state.kind === 'warp' && now >= state.arrivesAtUnixSeconds))
|
|
399
|
+
fail(`${label} is ${state.kind === 'warp' ? 'still warping' : state.kind}; only an Idle or subwarping Fleet can attack. Wait or move it into space, refresh the Fleet, and retry.`, fleet.address);
|
|
400
|
+
if (current.crewCount < current.stats.misc.requiredCrew)
|
|
401
|
+
fail(`${label} has ${String(current.crewCount)} crew but needs ${String(current.stats.misc.requiredCrew)} to attack. Load crew, refresh the Fleet, and retry.`, fleet.address);
|
|
402
|
+
// Zero stored AP is refused earlier, and the fresh account matches the snapshot.
|
|
403
|
+
if (now < current.apReloadExpiresAt)
|
|
404
|
+
fail(`${label} has no usable ability power at chain time ${String(now)}: stored AP ${String(current.ap)} with reload completing at ${String(current.apReloadExpiresAt)}. Wait for the reload, refresh the Fleet, and retry.`, fleet.address);
|
|
405
|
+
}
|
|
403
406
|
async function optionalCrewBinding(ctx, fleet) {
|
|
404
407
|
const address = await deriveFleetCrewBindingAddress(fleet.address);
|
|
405
408
|
const [envelope] = await ctx.data.readMany(fleetCrewBindingAccountDefinition, [address]);
|
|
406
409
|
if (envelope !== undefined &&
|
|
407
|
-
(envelope.data.
|
|
408
|
-
envelope.data.ownerProfile !== fleet.ownerProfile.address)) {
|
|
410
|
+
!matchesFleetCrewBindingIdentity(envelope.data, fleet.address, fleet.ownerProfile.address)) {
|
|
409
411
|
fail(`FleetCrewBinding ${address} does not belong to Fleet ${fleet.address} and Profile ${fleet.ownerProfile.address}. Refresh the Fleet crew relationship and retry.`, address);
|
|
410
412
|
}
|
|
411
413
|
return envelope?.address;
|
|
412
414
|
}
|
|
413
415
|
async function resolveRewardAccounts(ctx, fleet, registry, config, epochIndex) {
|
|
414
|
-
const resolvedFaction =
|
|
416
|
+
const resolvedFaction = fleet.npcFactionId > 0 ? fleet.npcFactionId : factionValue(fleet.faction);
|
|
415
417
|
if (resolvedFaction === 0)
|
|
416
418
|
return { config, registry };
|
|
417
419
|
const [epochAddress, contributionAddress] = await Promise.all([
|
|
@@ -446,35 +448,86 @@ async function resolveRewardAccounts(ctx, fleet, registry, config, epochIndex) {
|
|
|
446
448
|
registry,
|
|
447
449
|
};
|
|
448
450
|
}
|
|
449
|
-
|
|
451
|
+
/** Reads and requires an NPC Fleet's canonical FactionOwnership and, when
|
|
452
|
+
* `withFaction`, its Faction account; a player Fleet has neither. */
|
|
453
|
+
async function resolveNpcAccounts(ctx, fleet, withFaction) {
|
|
450
454
|
if (fleet.npcFactionId === 0)
|
|
451
455
|
return {};
|
|
452
|
-
const
|
|
453
|
-
|
|
456
|
+
const addresses = await Promise.all([
|
|
457
|
+
deriveFactionOwnershipAddress(fleet.game, 'fleet', fleet.address),
|
|
458
|
+
...(withFaction
|
|
459
|
+
? [deriveFactionAccountAddress(fleet.game, fleet.npcFactionId)]
|
|
460
|
+
: []),
|
|
461
|
+
]);
|
|
462
|
+
const [ownership, faction] = await readContextRawAccounts(ctx, addresses);
|
|
463
|
+
const ownershipData = ownership && factionOwnershipAccountDefinition.decode(ownership);
|
|
454
464
|
if (ownership === undefined ||
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
fail(`NPC Fleet ${fleet.address} has no matching canonical FactionOwnership for faction ${String(fleet.npcFactionId)}. Refresh the Fleet and faction ownership relationship before retrying.`,
|
|
460
|
-
}
|
|
461
|
-
if (!
|
|
462
|
-
return { ownership
|
|
463
|
-
const
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
fail(`Faction ${
|
|
468
|
-
}
|
|
469
|
-
return {
|
|
465
|
+
ownershipData?.game !== fleet.game ||
|
|
466
|
+
ownershipData.asset.kind !== 'fleet' ||
|
|
467
|
+
ownershipData.asset.fleet !== fleet.address ||
|
|
468
|
+
ownershipData.controllingFactionId !== fleet.npcFactionId) {
|
|
469
|
+
fail(`NPC Fleet ${fleet.address} has no matching canonical FactionOwnership for faction ${String(fleet.npcFactionId)}. Refresh the Fleet and faction ownership relationship before retrying.`, addresses[0]);
|
|
470
|
+
}
|
|
471
|
+
if (!withFaction)
|
|
472
|
+
return { ownership };
|
|
473
|
+
const factionData = faction && factionAccountDefinition.decode(faction);
|
|
474
|
+
if (faction === undefined ||
|
|
475
|
+
factionData?.game !== fleet.game ||
|
|
476
|
+
factionData.factionId !== fleet.npcFactionId) {
|
|
477
|
+
fail(`Faction ${addresses[1]} is missing or does not match NPC Fleet ${fleet.address}'s Game and faction id. Refresh the faction registry relationship before retrying.`, addresses[1]);
|
|
478
|
+
}
|
|
479
|
+
return { faction, ownership };
|
|
470
480
|
}
|
|
471
481
|
function generatedStance(stance) {
|
|
472
482
|
return {
|
|
473
483
|
ammoUsage: stance.ammoUsage === 'none' ? 0 : stance.ammoUsage === 'light' ? 1 : 2,
|
|
474
484
|
};
|
|
475
485
|
}
|
|
486
|
+
/** Requires a live Fleet snapshot of the configured Game with known AP, crew
|
|
487
|
+
* and ship composition; an attacking Fleet also needs AP available. */
|
|
488
|
+
function validateAttackFleet(fleet, role, game) {
|
|
489
|
+
const label = `The ${role} Fleet ${fleet.name} (${fleet.address})`;
|
|
490
|
+
if (fleet.game !== game) {
|
|
491
|
+
fail(`${label} belongs to Game ${fleet.game}, not configured Game ${game}. Refresh the Fleet through this context and retry.`, fleet.address);
|
|
492
|
+
}
|
|
493
|
+
if (fleet.state.kind === 'destroyed') {
|
|
494
|
+
fail(`${label} is destroyed and cannot participate in this attack. Refresh the Fleet after respawn and retry.`, fleet.address);
|
|
495
|
+
}
|
|
496
|
+
if (!Number.isSafeInteger(fleet.ap) ||
|
|
497
|
+
fleet.ap < 0 ||
|
|
498
|
+
!Number.isSafeInteger(fleet.crewCount) ||
|
|
499
|
+
fleet.crewCount <= 0) {
|
|
500
|
+
fail(`${label} has unknown or invalid AP or crew state. Refresh the Fleet through this context and retry.`, fleet.address);
|
|
501
|
+
}
|
|
502
|
+
if (fleet.ships.length === 0 ||
|
|
503
|
+
fleet.ships.some(({ quantity }) => quantity <= 0n)) {
|
|
504
|
+
fail(`${label} has no valid known ship composition. Refresh Fleet composition and retry.`, fleet.address);
|
|
505
|
+
}
|
|
506
|
+
if (role === 'attacking' && fleet.ap === 0) {
|
|
507
|
+
fail(`${label} has no known AP available. Wait for AP reload, refresh the Fleet, and retry.`, fleet.address);
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
/** Validates the inputs every attack shares: the stance, an attacking Fleet
|
|
511
|
+
* owned by the authorization Profile that can attack, and a new Loot address
|
|
512
|
+
* distinct from the authorization signers. */
|
|
513
|
+
function validateAttack(ctx, attacker, inputStance, inputOptions) {
|
|
514
|
+
const options = validateAttackOptions(inputOptions);
|
|
515
|
+
const stance = validateAttackStance(inputStance);
|
|
516
|
+
const game = requireGameAddress(ctx);
|
|
517
|
+
if (attacker.ownerProfile.address !== options.authorization.profile) {
|
|
518
|
+
fail(`Attacking Fleet ${attacker.address} does not belong to authorization Profile ${options.authorization.profile}. Choose an owned Fleet and retry.`, attacker.address);
|
|
519
|
+
}
|
|
520
|
+
if (options.loot === options.authorization.authority ||
|
|
521
|
+
options.loot === options.authorization.profile) {
|
|
522
|
+
fail(`The new Loot address ${options.loot} must be distinct from the authorization authority and Profile. Generate a separate Loot signer address and retry.`, options.loot);
|
|
523
|
+
}
|
|
524
|
+
validateAttackFleet(attacker, 'attacking', game);
|
|
525
|
+
return { game, options, stance };
|
|
526
|
+
}
|
|
476
527
|
/** Plans one singleton Fleet-on-Fleet attack without predicting its outcome.
|
|
477
528
|
*
|
|
529
|
+
* At chain time the attacker must be Idle or subwarping (a finished warp
|
|
530
|
+
* counts as Idle), carry its required crew, and have finished reloading AP.
|
|
478
531
|
* Range, randomness, recent slot hashes, final combat arithmetic, and chain
|
|
479
532
|
* races remain authoritative. This Plan cannot be combined with another
|
|
480
533
|
* gameplay instruction because the generated program contract requires a
|
|
@@ -497,47 +550,16 @@ function generatedStance(stance) {
|
|
|
497
550
|
* ```
|
|
498
551
|
*/
|
|
499
552
|
export async function planFleetAttackFleet(ctx, attacker, defender, inputStance, inputOptions) {
|
|
500
|
-
const options =
|
|
501
|
-
const stance = validateAttackStance(inputStance);
|
|
502
|
-
const game = requireGameAddress(ctx);
|
|
553
|
+
const { game, options, stance } = validateAttack(ctx, attacker, inputStance, inputOptions);
|
|
503
554
|
if (attacker.address === defender.address) {
|
|
504
555
|
fail(`Fleet ${attacker.address} cannot attack itself. Choose a distinct defending Fleet and retry.`, attacker.address);
|
|
505
556
|
}
|
|
506
|
-
|
|
507
|
-
fail(`Attacking Fleet ${attacker.address} does not belong to authorization Profile ${options.authorization.profile}. Choose an owned Fleet and retry.`, attacker.address);
|
|
508
|
-
}
|
|
509
|
-
if (options.loot === options.authorization.authority ||
|
|
510
|
-
options.loot === options.authorization.profile) {
|
|
511
|
-
fail(`The new Loot address ${options.loot} must be distinct from the authorization authority and Profile. Generate a separate Loot signer address and retry.`, options.loot);
|
|
512
|
-
}
|
|
513
|
-
for (const [role, fleet] of [
|
|
514
|
-
['attacking', attacker],
|
|
515
|
-
['defending', defender],
|
|
516
|
-
]) {
|
|
517
|
-
if (fleet.game !== game) {
|
|
518
|
-
fail(`The ${role} Fleet ${fleet.address} belongs to Game ${fleet.game}, not configured Game ${game}. Refresh both Fleets through this context and retry.`, fleet.address);
|
|
519
|
-
}
|
|
520
|
-
if (fleet.state.kind === 'destroyed') {
|
|
521
|
-
fail(`The ${role} Fleet ${fleet.name} (${fleet.address}) is destroyed and cannot participate in this attack. Refresh the Fleet after respawn and retry.`, fleet.address);
|
|
522
|
-
}
|
|
523
|
-
if (!Number.isSafeInteger(fleet.ap) ||
|
|
524
|
-
fleet.ap < 0 ||
|
|
525
|
-
!Number.isSafeInteger(fleet.crewCount) ||
|
|
526
|
-
fleet.crewCount <= 0) {
|
|
527
|
-
fail(`The ${role} Fleet ${fleet.name} (${fleet.address}) has unknown or invalid AP or crew state. Refresh the Fleet through this context and retry.`, fleet.address);
|
|
528
|
-
}
|
|
529
|
-
if (fleet.ships.length === 0 ||
|
|
530
|
-
fleet.ships.some(({ quantity }) => quantity <= 0n)) {
|
|
531
|
-
fail(`The ${role} Fleet ${fleet.name} (${fleet.address}) has no valid known ship composition. Refresh Fleet composition and retry.`, fleet.address);
|
|
532
|
-
}
|
|
533
|
-
}
|
|
534
|
-
if (attacker.ap === 0) {
|
|
535
|
-
fail(`Attacking Fleet ${attacker.name} (${attacker.address}) has no known AP available. Wait for AP reload, refresh the Fleet, and retry.`, attacker.address);
|
|
536
|
-
}
|
|
557
|
+
validateAttackFleet(defender, 'defending', game);
|
|
537
558
|
const currentAccounts = await readContextRawAccounts(ctx, [
|
|
538
559
|
attacker.address,
|
|
539
560
|
defender.address,
|
|
540
561
|
options.loot,
|
|
562
|
+
CLOCK_ADDRESS,
|
|
541
563
|
]);
|
|
542
564
|
if (currentAccounts[2] !== undefined) {
|
|
543
565
|
fail(`Loot account ${options.loot} already exists. Generate a new unused Loot signer address and retry.`, options.loot);
|
|
@@ -546,6 +568,7 @@ export async function planFleetAttackFleet(ctx, attacker, defender, inputStance,
|
|
|
546
568
|
validateCurrentAttackFleet(attacker, currentAccounts[0]),
|
|
547
569
|
validateCurrentAttackFleet(defender, currentAccounts[1]),
|
|
548
570
|
]);
|
|
571
|
+
validateAttackerReadiness(attacker, attackerAccount, currentAccounts[3]);
|
|
549
572
|
const registryAddress = await deriveAtlasRewardRegistryAddress(game);
|
|
550
573
|
const registry = await ctx.data.read(atlasRewardRegistryAccountDefinition, registryAddress);
|
|
551
574
|
if (registry.data.game !== game) {
|
|
@@ -565,58 +588,93 @@ export async function planFleetAttackFleet(ctx, attacker, defender, inputStance,
|
|
|
565
588
|
deriveRegionTrackerAddress(game),
|
|
566
589
|
deriveFactionRelationTrackerAddress(game),
|
|
567
590
|
]);
|
|
591
|
+
const actorIntent = {
|
|
592
|
+
address: attacker.address,
|
|
593
|
+
defender: defender.address,
|
|
594
|
+
game,
|
|
595
|
+
profile: attacker.ownerProfile.address,
|
|
596
|
+
defenderProfile: defender.ownerProfile.address,
|
|
597
|
+
};
|
|
598
|
+
await validateFleetAttackActors(ctx, actorIntent);
|
|
599
|
+
const versions = new Map();
|
|
600
|
+
const attackerXp = await resolveXpRuntime(ctx, { game, character, profile: attacker.ownerProfile.address }, versions);
|
|
601
|
+
const defenderXp = character === defenderCharacter
|
|
602
|
+
? attackerXp
|
|
603
|
+
: await resolveXpRuntime(ctx, {
|
|
604
|
+
game,
|
|
605
|
+
character: defenderCharacter,
|
|
606
|
+
profile: defender.ownerProfile.address,
|
|
607
|
+
}, versions);
|
|
608
|
+
const xpGuards = [...new Set([attackerXp, defenderXp])].map((xp) => ({
|
|
609
|
+
kind: 'xp-runtime',
|
|
610
|
+
address: game,
|
|
611
|
+
intent: xp.intent,
|
|
612
|
+
accounts: xp.accounts,
|
|
613
|
+
describes: 'Both operator XP budgets remain canonical and reconciled; earned XP and bank balances may change.',
|
|
614
|
+
}));
|
|
615
|
+
const instruction = adaptAttackFleetInstruction({
|
|
616
|
+
...(attackerNpc.faction === undefined
|
|
617
|
+
? {}
|
|
618
|
+
: { attackerFactionAccount: attackerNpc.faction.address }),
|
|
619
|
+
...(attackerNpc.ownership === undefined
|
|
620
|
+
? {}
|
|
621
|
+
: { attackerFleetOwnership: attackerNpc.ownership.address }),
|
|
622
|
+
attackerRewardsConfig: attackerRewards.config,
|
|
623
|
+
...(attackerRewards.contribution === undefined
|
|
624
|
+
? {}
|
|
625
|
+
: { attackerRewardsContribution: attackerRewards.contribution }),
|
|
626
|
+
...(attackerRewards.epoch === undefined
|
|
627
|
+
? {}
|
|
628
|
+
: { attackerRewardsEpoch: attackerRewards.epoch }),
|
|
629
|
+
attackerRewardsRegistry: attackerRewards.registry,
|
|
630
|
+
...(defender.state.kind === 'mining'
|
|
631
|
+
? { asteroid: defender.state.asteroid.address }
|
|
632
|
+
: {}),
|
|
633
|
+
authorization: options.authorization,
|
|
634
|
+
attackerXpBudget: attackerXp.accounts.xpBudget,
|
|
635
|
+
defenderXpBudget: defenderXp.accounts.xpBudget,
|
|
636
|
+
xpBudgetConfig: attackerXp.accounts.xpBudgetConfig,
|
|
637
|
+
character,
|
|
638
|
+
...(crewBinding === undefined ? {} : { crewBinding }),
|
|
639
|
+
defenderCharacter,
|
|
640
|
+
...(defenderNpc.ownership === undefined
|
|
641
|
+
? {}
|
|
642
|
+
: { defenderFleetOwnership: defenderNpc.ownership.address }),
|
|
643
|
+
defenderRewardsConfig: defenderRewards.config,
|
|
644
|
+
...(defenderRewards.contribution === undefined
|
|
645
|
+
? {}
|
|
646
|
+
: { defenderRewardsContribution: defenderRewards.contribution }),
|
|
647
|
+
...(defenderRewards.epoch === undefined
|
|
648
|
+
? {}
|
|
649
|
+
: { defenderRewardsEpoch: defenderRewards.epoch }),
|
|
650
|
+
defenderRewardsRegistry: defenderRewards.registry,
|
|
651
|
+
defendingFleet: defender.address,
|
|
652
|
+
factionRelationTracker,
|
|
653
|
+
fleet: attacker.address,
|
|
654
|
+
game,
|
|
655
|
+
loot: options.loot,
|
|
656
|
+
recentSlothashes: 'SysvarS1otHashes111111111111111111111111111',
|
|
657
|
+
regionTracker,
|
|
658
|
+
stance: generatedStance(stance),
|
|
659
|
+
});
|
|
568
660
|
const description = `Attack Fleet ${defender.name} (${defender.address}) with Fleet ${attacker.name} (${attacker.address}) using ${stance.ammoUsage} ammunition; range, randomness, rewards, Loot, damage, and final combat arithmetic remain chain-authoritative.`;
|
|
569
|
-
return
|
|
661
|
+
return buildPlannerPlan({
|
|
570
662
|
kind: 'combat.attack-fleet',
|
|
571
663
|
preconditions: [
|
|
572
|
-
|
|
573
|
-
|
|
664
|
+
{
|
|
665
|
+
kind: 'fleet-attack',
|
|
666
|
+
...actorIntent,
|
|
667
|
+
instructionKey: fleetAttackInstructionKey(instruction),
|
|
668
|
+
describes: 'The exact attack instruction and both canonical operators remain bound.',
|
|
669
|
+
},
|
|
670
|
+
...xpGuards,
|
|
671
|
+
await accountStatePrecondition(attackerAccount, `Attacking Fleet ${attacker.name} retains its owner, Game, live state, crew, AP, faction, and ship composition.`),
|
|
672
|
+
await accountStatePrecondition(defenderAccount, `Defending Fleet ${defender.name} retains its owner, Game, live state, crew, faction, and ship composition.`),
|
|
574
673
|
],
|
|
575
674
|
steps: [
|
|
576
675
|
{
|
|
577
676
|
describes: description,
|
|
578
|
-
instruction
|
|
579
|
-
...(attackerNpc.factionAccount === undefined
|
|
580
|
-
? {}
|
|
581
|
-
: { attackerFactionAccount: attackerNpc.factionAccount }),
|
|
582
|
-
...(attackerNpc.ownership === undefined
|
|
583
|
-
? {}
|
|
584
|
-
: { attackerFleetOwnership: attackerNpc.ownership }),
|
|
585
|
-
attackerRewardsConfig: attackerRewards.config,
|
|
586
|
-
...(attackerRewards.contribution === undefined
|
|
587
|
-
? {}
|
|
588
|
-
: { attackerRewardsContribution: attackerRewards.contribution }),
|
|
589
|
-
...(attackerRewards.epoch === undefined
|
|
590
|
-
? {}
|
|
591
|
-
: { attackerRewardsEpoch: attackerRewards.epoch }),
|
|
592
|
-
attackerRewardsRegistry: attackerRewards.registry,
|
|
593
|
-
...(defender.state.kind === 'mining'
|
|
594
|
-
? { asteroid: defender.state.asteroid.address }
|
|
595
|
-
: {}),
|
|
596
|
-
authorization: options.authorization,
|
|
597
|
-
character,
|
|
598
|
-
...(crewBinding === undefined ? {} : { crewBinding }),
|
|
599
|
-
defenderCharacter,
|
|
600
|
-
...(defenderNpc.ownership === undefined
|
|
601
|
-
? {}
|
|
602
|
-
: { defenderFleetOwnership: defenderNpc.ownership }),
|
|
603
|
-
defenderRewardsConfig: defenderRewards.config,
|
|
604
|
-
...(defenderRewards.contribution === undefined
|
|
605
|
-
? {}
|
|
606
|
-
: { defenderRewardsContribution: defenderRewards.contribution }),
|
|
607
|
-
...(defenderRewards.epoch === undefined
|
|
608
|
-
? {}
|
|
609
|
-
: { defenderRewardsEpoch: defenderRewards.epoch }),
|
|
610
|
-
defenderRewardsRegistry: defenderRewards.registry,
|
|
611
|
-
defendingFleet: defender.address,
|
|
612
|
-
factionRelationTracker,
|
|
613
|
-
fleet: attacker.address,
|
|
614
|
-
game,
|
|
615
|
-
loot: options.loot,
|
|
616
|
-
recentSlothashes: 'SysvarS1otHashes111111111111111111111111111',
|
|
617
|
-
regionTracker,
|
|
618
|
-
stance: generatedStance(stance),
|
|
619
|
-
}),
|
|
677
|
+
instruction,
|
|
620
678
|
semantics: [{ kind: 'exclusive', scope: 'transaction' }],
|
|
621
679
|
signers: [options.authorization.authority, options.loot],
|
|
622
680
|
},
|
|
@@ -639,26 +697,26 @@ function systemFingerprint(system) {
|
|
|
639
697
|
version: system.version,
|
|
640
698
|
}, (_key, value) => typeof value === 'bigint' ? value.toString() : value);
|
|
641
699
|
}
|
|
642
|
-
function starbaseFactionId(owner) {
|
|
643
|
-
switch (owner) {
|
|
644
|
-
case 'mud':
|
|
645
|
-
return 1;
|
|
646
|
-
case 'oni':
|
|
647
|
-
return 2;
|
|
648
|
-
case 'ustur':
|
|
649
|
-
return 3;
|
|
650
|
-
case 'unaligned':
|
|
651
|
-
return null;
|
|
652
|
-
}
|
|
653
|
-
}
|
|
654
700
|
/** Plans one singleton Fleet-on-Starbase attack without predicting its outcome.
|
|
655
701
|
*
|
|
702
|
+
* At chain time the attacker must be Idle or subwarping (a finished warp
|
|
703
|
+
* counts as Idle), carry its required crew, and have finished reloading AP.
|
|
656
704
|
* The planner validates the owned attacking Fleet, canonical target System and
|
|
657
705
|
* nested shared Starbase, configured faction ownership mode, reward
|
|
658
706
|
* configuration, and the optional dynamic-NPC capture economy. Range,
|
|
659
707
|
* capture-cost debit outcome, randomness, damage, rewards, and final
|
|
660
708
|
* admissibility remain chain-authoritative.
|
|
661
709
|
*
|
|
710
|
+
* Requires Disabled rent: the Game's rent catalog and the target System's
|
|
711
|
+
* Starbase-level rent history must not exist, and both stay guarded absent until
|
|
712
|
+
* signing.
|
|
713
|
+
*
|
|
714
|
+
* From the RegionTracker, the attack reads only the target System's Region, so
|
|
715
|
+
* the Plan guards only that Region's owner, safety status and risk zone and a
|
|
716
|
+
* Starbase capture or upgrade in another Region leaves it valid. If the
|
|
717
|
+
* System's stored Region disagrees with the Region map, the whole tracker stays
|
|
718
|
+
* guarded.
|
|
719
|
+
*
|
|
662
720
|
* @example
|
|
663
721
|
* ```ts
|
|
664
722
|
* declare const ctx: SageContext;
|
|
@@ -676,32 +734,7 @@ function starbaseFactionId(owner) {
|
|
|
676
734
|
* ```
|
|
677
735
|
*/
|
|
678
736
|
export async function planFleetAttackStarbase(ctx, attacker, target, inputStance, inputOptions) {
|
|
679
|
-
const options =
|
|
680
|
-
const stance = validateAttackStance(inputStance);
|
|
681
|
-
const game = requireGameAddress(ctx);
|
|
682
|
-
if (attacker.ownerProfile.address !== options.authorization.profile) {
|
|
683
|
-
fail(`Attacking Fleet ${attacker.address} does not belong to authorization Profile ${options.authorization.profile}. Choose an owned Fleet and retry.`, attacker.address);
|
|
684
|
-
}
|
|
685
|
-
if (options.loot === options.authorization.authority ||
|
|
686
|
-
options.loot === options.authorization.profile) {
|
|
687
|
-
fail(`The new Loot address ${options.loot} must be distinct from the authorization authority and Profile. Generate a separate Loot signer address and retry.`, options.loot);
|
|
688
|
-
}
|
|
689
|
-
if (attacker.game !== game) {
|
|
690
|
-
fail(`Attacking Fleet ${attacker.address} belongs to Game ${attacker.game}, not configured Game ${game}. Refresh the Fleet through this context and retry.`, attacker.address);
|
|
691
|
-
}
|
|
692
|
-
if (attacker.state.kind === 'destroyed') {
|
|
693
|
-
fail(`Attacking Fleet ${attacker.name} (${attacker.address}) is destroyed and cannot attack a Starbase. Refresh the Fleet after respawn and retry.`, attacker.address);
|
|
694
|
-
}
|
|
695
|
-
if (!Number.isSafeInteger(attacker.ap) ||
|
|
696
|
-
attacker.ap <= 0 ||
|
|
697
|
-
!Number.isSafeInteger(attacker.crewCount) ||
|
|
698
|
-
attacker.crewCount <= 0) {
|
|
699
|
-
fail(`Attacking Fleet ${attacker.name} (${attacker.address}) has no known positive AP or valid crew state. Wait for AP reload, refresh the Fleet, and retry.`, attacker.address);
|
|
700
|
-
}
|
|
701
|
-
if (attacker.ships.length === 0 ||
|
|
702
|
-
attacker.ships.some(({ quantity }) => quantity <= 0n)) {
|
|
703
|
-
fail(`Attacking Fleet ${attacker.name} (${attacker.address}) has no valid known ship composition. Refresh Fleet composition and retry.`, attacker.address);
|
|
704
|
-
}
|
|
737
|
+
const { game, options, stance } = validateAttack(ctx, attacker, inputStance, inputOptions);
|
|
705
738
|
if (target.game !== game) {
|
|
706
739
|
fail(`Target Star System ${target.address} belongs to Game ${target.game}, not configured Game ${game}. Refresh the target through this context and retry.`, target.address);
|
|
707
740
|
}
|
|
@@ -720,9 +753,10 @@ export async function planFleetAttackStarbase(ctx, attacker, target, inputStance
|
|
|
720
753
|
deriveRegionTrackerAddress(game),
|
|
721
754
|
deriveFleetCrewBindingAddress(attacker.address),
|
|
722
755
|
]);
|
|
723
|
-
const [probeRelationsAccount, probeRegistryAccount] = await
|
|
724
|
-
relationTrackerAddress,
|
|
725
|
-
|
|
756
|
+
const [[probeRelationsAccount, probeRegistryAccount], attackerNpc, rent] = await Promise.all([
|
|
757
|
+
readContextRawAccounts(ctx, [relationTrackerAddress, registryAddress]),
|
|
758
|
+
resolveNpcAccounts(ctx, attacker, true),
|
|
759
|
+
requireDisabledLevelRent(ctx, game, target, 'the Starbase attack'),
|
|
726
760
|
]);
|
|
727
761
|
const probeRelations = factionRelationTrackerAccountDefinition.decode(requireAccount(probeRelationsAccount, relationTrackerAddress, `FactionRelationTracker ${relationTrackerAddress} is missing. Refresh faction relationships and retry.`));
|
|
728
762
|
const probeRegistry = atlasRewardRegistryAccountDefinition.decode(requireAccount(probeRegistryAccount, registryAddress, `AtlasRewardRegistry ${registryAddress} is missing. Refresh reward configuration and retry.`));
|
|
@@ -733,12 +767,6 @@ export async function planFleetAttackStarbase(ctx, attacker, target, inputStance
|
|
|
733
767
|
fail(`AtlasRewardRegistry ${registryAddress} belongs to another Game. Refresh the configured reward registry and retry.`, registryAddress);
|
|
734
768
|
}
|
|
735
769
|
const rewardConfigAddress = await deriveAtlasRewardConfigAddress(game, probeRegistry.activeConfigVersion);
|
|
736
|
-
const attackerOwnership = attacker.npcFactionId === 0
|
|
737
|
-
? undefined
|
|
738
|
-
: await deriveFactionOwnershipAddress(game, 'fleet', attacker.address);
|
|
739
|
-
const attackerFaction = attacker.npcFactionId === 0
|
|
740
|
-
? undefined
|
|
741
|
-
: await deriveFactionAccountAddress(game, attacker.npcFactionId);
|
|
742
770
|
const requiresNpcEconomy = attacker.npcFactionId > 0 &&
|
|
743
771
|
probeRelations.dynamicCaptureEnabled &&
|
|
744
772
|
probeRelations.nemesisActive;
|
|
@@ -762,10 +790,9 @@ export async function planFleetAttackStarbase(ctx, attacker, target, inputStance
|
|
|
762
790
|
character,
|
|
763
791
|
regionTracker,
|
|
764
792
|
crewBindingAddress,
|
|
765
|
-
...(attackerOwnership === undefined ? [] : [attackerOwnership]),
|
|
766
|
-
...(attackerFaction === undefined ? [] : [attackerFaction]),
|
|
767
793
|
...(factionEconomicsConfig === undefined ? [] : [factionEconomicsConfig]),
|
|
768
794
|
...(captorTreasury === undefined ? [] : [captorTreasury]),
|
|
795
|
+
CLOCK_ADDRESS,
|
|
769
796
|
];
|
|
770
797
|
const dependencyAccounts = await readContextRawAccounts(ctx, dependencyAddresses);
|
|
771
798
|
const current = new Map(dependencyAddresses.map((address, index) => [
|
|
@@ -776,6 +803,7 @@ export async function planFleetAttackStarbase(ctx, attacker, target, inputStance
|
|
|
776
803
|
fail(`Loot account ${options.loot} already exists. Generate a new unused Loot signer address and retry.`, options.loot);
|
|
777
804
|
}
|
|
778
805
|
const attackerAccount = await validateCurrentAttackFleet(attacker, current.get(attacker.address));
|
|
806
|
+
validateAttackerReadiness(attacker, attackerAccount, current.get(CLOCK_ADDRESS));
|
|
779
807
|
const systemAccount = requireAccount(current.get(target.address), target.address, `Target Star System ${target.name} (${target.address}) is missing. Refresh world state and retry the attack.`);
|
|
780
808
|
const currentSystem = starSystemAccountDefinition.decode(systemAccount);
|
|
781
809
|
if ((await deriveStarSystemAddress(currentSystem.game, currentSystem.systemId)) !== target.address ||
|
|
@@ -799,7 +827,8 @@ export async function planFleetAttackStarbase(ctx, attacker, target, inputStance
|
|
|
799
827
|
if (ownership === undefined && relations.dynamicCaptureEnabled) {
|
|
800
828
|
fail(`Target Starbase ${target.address} requires canonical FactionOwnership while dynamic capture is enabled. Refresh Starbase ownership and retry.`, ownershipAddress);
|
|
801
829
|
}
|
|
802
|
-
|
|
830
|
+
// KingSystemTracker records an unaligned owner as null.
|
|
831
|
+
const legacyOwner = factionValue(target.starbase.owner) || null;
|
|
803
832
|
if (ownership !== undefined &&
|
|
804
833
|
(ownership.game !== game ||
|
|
805
834
|
ownership.asset.kind !== 'starbase' ||
|
|
@@ -840,36 +869,28 @@ export async function planFleetAttackStarbase(ctx, attacker, target, inputStance
|
|
|
840
869
|
if (regionTrackerData.game !== game) {
|
|
841
870
|
fail(`RegionTracker ${regionTracker} does not match configured Game ${game}. Refresh world region data and retry.`, regionTracker);
|
|
842
871
|
}
|
|
872
|
+
// The attack reads the target's stored Region. When the Region map agrees,
|
|
873
|
+
// guard only that Region's access data; otherwise keep the whole tracker.
|
|
874
|
+
const regionAccess = (await regionsContainingSystem(regionTrackerAccount, systemAccount, game))
|
|
875
|
+
.map(({ id }) => id)
|
|
876
|
+
.join() === String(currentSystem.regionId ?? '')
|
|
877
|
+
? {
|
|
878
|
+
kind: 'region-access',
|
|
879
|
+
address: regionTracker,
|
|
880
|
+
game,
|
|
881
|
+
system: target.address,
|
|
882
|
+
accessHash: await hashRegionAccess(regionTrackerAccount, systemAccount, game),
|
|
883
|
+
describes: `The Region holding target Star System ${target.name} keeps its owner, safety status and risk zone; other Regions may change.`,
|
|
884
|
+
}
|
|
885
|
+
: undefined;
|
|
843
886
|
const crewBindingAccount = current.get(crewBindingAddress);
|
|
844
887
|
const crewBinding = crewBindingAccount === undefined ? undefined : crewBindingAddress;
|
|
845
888
|
if (crewBindingAccount !== undefined) {
|
|
846
889
|
const data = fleetCrewBindingAccountDefinition.decode(crewBindingAccount);
|
|
847
|
-
if (data.
|
|
848
|
-
data.ownerProfile !== attacker.ownerProfile.address) {
|
|
890
|
+
if (!matchesFleetCrewBindingIdentity(data, attacker.address, attacker.ownerProfile.address)) {
|
|
849
891
|
fail(`FleetCrewBinding ${crewBindingAddress} does not belong to Fleet ${attacker.address} and Profile ${attacker.ownerProfile.address}. Refresh the Fleet crew relationship and retry.`, crewBindingAddress);
|
|
850
892
|
}
|
|
851
893
|
}
|
|
852
|
-
const attackerNpc = {};
|
|
853
|
-
let attackerOwnershipAccount;
|
|
854
|
-
let attackerFactionAccount;
|
|
855
|
-
if (attackerOwnership !== undefined && attackerFaction !== undefined) {
|
|
856
|
-
attackerOwnershipAccount = requireAccount(current.get(attackerOwnership), attackerOwnership, `NPC Fleet ${attacker.address} has no canonical FactionOwnership. Refresh the Fleet faction relationship and retry.`);
|
|
857
|
-
const npcOwnership = factionOwnershipAccountDefinition.decode(attackerOwnershipAccount);
|
|
858
|
-
if (npcOwnership.game !== game ||
|
|
859
|
-
npcOwnership.asset.kind !== 'fleet' ||
|
|
860
|
-
npcOwnership.asset.fleet !== attacker.address ||
|
|
861
|
-
npcOwnership.controllingFactionId !== attacker.npcFactionId) {
|
|
862
|
-
fail(`NPC Fleet ${attacker.address} has no matching canonical FactionOwnership for faction ${String(attacker.npcFactionId)}. Refresh the Fleet and faction ownership relationship before retrying.`, attackerOwnership);
|
|
863
|
-
}
|
|
864
|
-
attackerFactionAccount = requireAccount(current.get(attackerFaction), attackerFaction, `Faction ${attackerFaction} is missing for NPC Fleet ${attacker.address}. Refresh the faction registry relationship and retry.`);
|
|
865
|
-
const npcFaction = factionAccountDefinition.decode(attackerFactionAccount);
|
|
866
|
-
if (npcFaction.game !== game ||
|
|
867
|
-
npcFaction.factionId !== attacker.npcFactionId) {
|
|
868
|
-
fail(`Faction ${attackerFaction} does not match NPC Fleet ${attacker.address}'s Game and faction id. Refresh the faction registry relationship before retrying.`, attackerFaction);
|
|
869
|
-
}
|
|
870
|
-
attackerNpc.ownership = attackerOwnership;
|
|
871
|
-
attackerNpc.factionAccount = attackerFaction;
|
|
872
|
-
}
|
|
873
894
|
let economicsAccount;
|
|
874
895
|
let treasuryAccount;
|
|
875
896
|
if (factionEconomicsConfig !== undefined && captorTreasury !== undefined) {
|
|
@@ -916,33 +937,29 @@ export async function planFleetAttackStarbase(ctx, attacker, target, inputStance
|
|
|
916
937
|
'King-system target membership and ownership remain unchanged.',
|
|
917
938
|
],
|
|
918
939
|
[characterAccount, 'The attacking Profile Character remains canonical.'],
|
|
919
|
-
|
|
920
|
-
regionTrackerAccount,
|
|
921
|
-
'The configured Game RegionTracker remains canonical.',
|
|
922
|
-
],
|
|
923
|
-
...(crewBindingAccount === undefined
|
|
940
|
+
...(regionAccess
|
|
924
941
|
? []
|
|
925
942
|
: [
|
|
926
943
|
[
|
|
927
|
-
|
|
928
|
-
'
|
|
944
|
+
regionTrackerAccount,
|
|
945
|
+
`Target Star System ${target.name}'s stored Region differs from the Region map at its coordinate, so the whole configured Game RegionTracker remains guarded.`,
|
|
929
946
|
],
|
|
930
947
|
]),
|
|
931
|
-
...(
|
|
948
|
+
...(crewBindingAccount === undefined
|
|
932
949
|
? []
|
|
933
950
|
: [
|
|
934
951
|
[
|
|
935
|
-
|
|
936
|
-
'
|
|
952
|
+
crewBindingAccount,
|
|
953
|
+
'The optional Fleet crew binding remains unchanged.',
|
|
937
954
|
],
|
|
938
955
|
]),
|
|
939
|
-
...(
|
|
956
|
+
...(attackerNpc.ownership === undefined
|
|
957
|
+
? []
|
|
958
|
+
: [[attackerNpc.ownership, 'NPC Fleet ownership remains unchanged.']]),
|
|
959
|
+
...(attackerNpc.faction === undefined
|
|
940
960
|
? []
|
|
941
961
|
: [
|
|
942
|
-
[
|
|
943
|
-
attackerFactionAccount,
|
|
944
|
-
'The NPC faction account remains unchanged.',
|
|
945
|
-
],
|
|
962
|
+
[attackerNpc.faction, 'The NPC faction account remains unchanged.'],
|
|
946
963
|
]),
|
|
947
964
|
...(economicsAccount === undefined
|
|
948
965
|
? []
|
|
@@ -960,29 +977,43 @@ export async function planFleetAttackStarbase(ctx, attacker, target, inputStance
|
|
|
960
977
|
'The dynamic-capture treasury remains unchanged.',
|
|
961
978
|
],
|
|
962
979
|
]),
|
|
963
|
-
].map(([account, describes]) =>
|
|
980
|
+
].map(([account, describes]) => accountStatePrecondition(account, describes)));
|
|
964
981
|
const absencePreconditions = [
|
|
965
|
-
|
|
982
|
+
accountAbsentPrecondition(options.loot, `Loot account ${options.loot} remains absent until execution.`),
|
|
966
983
|
...(crewBindingAccount === undefined
|
|
967
984
|
? [
|
|
968
|
-
|
|
985
|
+
accountAbsentPrecondition(crewBindingAddress, 'Optional Fleet crew binding remains absent.'),
|
|
969
986
|
]
|
|
970
987
|
: []),
|
|
971
988
|
];
|
|
989
|
+
const runtime = await resolveActionRuntime(ctx, {
|
|
990
|
+
mode: 'starbase-attack',
|
|
991
|
+
game,
|
|
992
|
+
system: target.address,
|
|
993
|
+
starbaseSeqId: starSystemAccountDefinition.decode(systemAccount).sequenceId,
|
|
994
|
+
character,
|
|
995
|
+
});
|
|
972
996
|
const description = `Attack with Fleet ${attacker.name} (${attacker.address}) against the shared Starbase at ${target.name} (${target.address}) using ${stance.ammoUsage} ammunition; range, capture-cost debit outcome, randomness, rewards, Loot, damage, and final admissibility remain chain-authoritative.`;
|
|
973
|
-
return
|
|
997
|
+
return buildPlannerPlan({
|
|
974
998
|
kind: 'combat.attack-starbase',
|
|
975
|
-
preconditions: [
|
|
999
|
+
preconditions: [
|
|
1000
|
+
...statePreconditions,
|
|
1001
|
+
...(regionAccess ? [regionAccess] : []),
|
|
1002
|
+
...absencePreconditions,
|
|
1003
|
+
...rent.guards,
|
|
1004
|
+
...runtime.guards,
|
|
1005
|
+
],
|
|
976
1006
|
steps: [
|
|
977
1007
|
{
|
|
978
|
-
describes: description
|
|
1008
|
+
describes: `${description} ${runtime.description}`,
|
|
979
1009
|
instruction: adaptAttackStarbaseInstruction({
|
|
980
|
-
...
|
|
1010
|
+
...runtime.accounts,
|
|
1011
|
+
...(attackerNpc.faction === undefined
|
|
981
1012
|
? {}
|
|
982
|
-
: { attackerFactionAccount: attackerNpc.
|
|
1013
|
+
: { attackerFactionAccount: attackerNpc.faction.address }),
|
|
983
1014
|
...(attackerNpc.ownership === undefined
|
|
984
1015
|
? {}
|
|
985
|
-
: { attackerFleetOwnership: attackerNpc.ownership }),
|
|
1016
|
+
: { attackerFleetOwnership: attackerNpc.ownership.address }),
|
|
986
1017
|
authorization: options.authorization,
|
|
987
1018
|
...(captorTreasury === undefined ? {} : { captorTreasury }),
|
|
988
1019
|
character,
|
|
@@ -1000,6 +1031,7 @@ export async function planFleetAttackStarbase(ctx, attacker, target, inputStance
|
|
|
1000
1031
|
loot: options.loot,
|
|
1001
1032
|
recentSlothashes: 'SysvarS1otHashes111111111111111111111111111',
|
|
1002
1033
|
regionTracker,
|
|
1034
|
+
...rent.accounts,
|
|
1003
1035
|
rewardConfig: rewardConfigAddress,
|
|
1004
1036
|
rewardRegistry: registryAddress,
|
|
1005
1037
|
stance: generatedStance(stance),
|
|
@@ -1009,7 +1041,7 @@ export async function planFleetAttackStarbase(ctx, attacker, target, inputStance
|
|
|
1009
1041
|
signers: [options.authorization.authority, options.loot],
|
|
1010
1042
|
},
|
|
1011
1043
|
],
|
|
1012
|
-
summary: description
|
|
1044
|
+
summary: `${description} ${runtime.description}`,
|
|
1013
1045
|
});
|
|
1014
1046
|
}
|
|
1015
1047
|
function lootSnapshotFingerprint(loot) {
|
|
@@ -1021,11 +1053,11 @@ function lootSnapshotFingerprint(loot) {
|
|
|
1021
1053
|
loot.coordinates.x,
|
|
1022
1054
|
loot.coordinates.y,
|
|
1023
1055
|
...loot.items.map((item) => [
|
|
1024
|
-
item.destroyer
|
|
1056
|
+
item.destroyer?.address ?? '',
|
|
1025
1057
|
item.exclusivityUnlockAtUnixSeconds,
|
|
1026
1058
|
item.rewardReclaimAtUnixSeconds,
|
|
1027
1059
|
item.inventory.sequenceId,
|
|
1028
|
-
item.inventory.
|
|
1060
|
+
item.inventory.usedStorageUnitsRaw,
|
|
1029
1061
|
...item.inventory.items
|
|
1030
1062
|
.map(({ cargo, quantityRaw }) => `${String(cargo.id)}:${String(quantityRaw)}`)
|
|
1031
1063
|
.sort(),
|
|
@@ -1041,11 +1073,11 @@ function rawLootFingerprint(address, loot) {
|
|
|
1041
1073
|
loot.coordinates.x,
|
|
1042
1074
|
loot.coordinates.y,
|
|
1043
1075
|
...loot.items.map((item) => [
|
|
1044
|
-
item.destroyer,
|
|
1076
|
+
item.destroyer ?? '',
|
|
1045
1077
|
item.exclusivityUnlockAtUnixSeconds,
|
|
1046
1078
|
item.rewardReclaimAtUnixSeconds,
|
|
1047
1079
|
item.inventory.sequenceId,
|
|
1048
|
-
item.inventory.
|
|
1080
|
+
item.inventory.usedStorageUnitsRaw,
|
|
1049
1081
|
...item.inventory.amounts
|
|
1050
1082
|
.map(({ amount, cargoId }) => `${String(cargoId)}:${String(amount)}`)
|
|
1051
1083
|
.sort(),
|
|
@@ -1054,10 +1086,12 @@ function rawLootFingerprint(address, loot) {
|
|
|
1054
1086
|
}
|
|
1055
1087
|
/** Plans one transaction-exclusive retrieval from a loaded Loot snapshot.
|
|
1056
1088
|
*
|
|
1057
|
-
* The planner validates the owned idle Fleet,
|
|
1058
|
-
*
|
|
1059
|
-
*
|
|
1060
|
-
*
|
|
1089
|
+
* The planner validates the owned idle Fleet, its normalized crew and usable
|
|
1090
|
+
* ability power at `atUnixSeconds`, Loot identity, destroyer exclusivity and
|
|
1091
|
+
* reward locks against the authorization Profile, and every requested known
|
|
1092
|
+
* quantity. Retrieval spends the Fleet's whole ability power pool. Range,
|
|
1093
|
+
* recent-slot inputs, destination capacity, intervening races, and final
|
|
1094
|
+
* acquired quantities remain chain-authoritative.
|
|
1061
1095
|
*
|
|
1062
1096
|
* @example
|
|
1063
1097
|
* ```ts
|
|
@@ -1105,6 +1139,13 @@ export async function planFleetRetrieveLoot(ctx, fleet, loot, inputWant, inputOp
|
|
|
1105
1139
|
currentFleet.crewCount !== fleet.crewCount) {
|
|
1106
1140
|
fail(`Fleet ${fleet.name} (${fleet.address}) changed or no longer matches its canonical Game, owner, label, idle state, or crew. Refresh the Fleet and retry.`, fleet.address);
|
|
1107
1141
|
}
|
|
1142
|
+
if (currentFleet.crewCount < currentFleet.stats.misc.requiredCrew) {
|
|
1143
|
+
fail(`Fleet ${fleet.name} (${fleet.address}) has ${String(currentFleet.crewCount)} crew but needs ${String(currentFleet.stats.misc.requiredCrew)} to retrieve Loot. Load crew, refresh the Fleet, and retry.`, fleet.address);
|
|
1144
|
+
}
|
|
1145
|
+
if (currentFleet.ap <= 0 ||
|
|
1146
|
+
options.atUnixSeconds < currentFleet.apReloadExpiresAt) {
|
|
1147
|
+
fail(`Fleet ${fleet.name} (${fleet.address}) has no usable ability power at ${String(options.atUnixSeconds)} Unix seconds: stored AP ${String(currentFleet.ap)} with reload completing at ${String(currentFleet.apReloadExpiresAt)}. Retrieving Loot spends the whole AP pool; wait for the reload, refresh the Fleet, and retry.`, fleet.address);
|
|
1148
|
+
}
|
|
1108
1149
|
const lootAccount = requireAccount(lootAccountValue, loot.address, `Loot ${loot.address} is no longer available. Refresh Loot discovery and choose an available account before retrying.`);
|
|
1109
1150
|
const currentLoot = lootAccountDefinition.decode(lootAccount);
|
|
1110
1151
|
if (rawLootFingerprint(lootAccount.address, currentLoot) !==
|
|
@@ -1114,28 +1155,33 @@ export async function planFleetRetrieveLoot(ctx, fleet, loot, inputWant, inputOp
|
|
|
1114
1155
|
const lootCreator = loot.profile.address === options.authorization.profile
|
|
1115
1156
|
? undefined
|
|
1116
1157
|
: loot.profile.address;
|
|
1117
|
-
const
|
|
1118
|
-
|
|
1158
|
+
const instruction = adaptRetrieveLootInstruction({
|
|
1159
|
+
authorization: options.authorization,
|
|
1160
|
+
fleet: fleet.address,
|
|
1161
|
+
game,
|
|
1162
|
+
loot: loot.address,
|
|
1163
|
+
...(lootCreator === undefined ? {} : { lootCreator }),
|
|
1164
|
+
recentSlothashes: 'SysvarS1otHashes111111111111111111111111111',
|
|
1165
|
+
want: selection.generated.map(([itemIndex, cargo]) => [
|
|
1166
|
+
itemIndex,
|
|
1167
|
+
cargo.map(([cargoId, quantity]) => [cargoId, quantity]),
|
|
1168
|
+
]),
|
|
1169
|
+
});
|
|
1170
|
+
// Retrieved cargo can open hold lines, which the program funds from the
|
|
1171
|
+
// Profile vault before the emptied Loot refunds its rent.
|
|
1172
|
+
const storage = await planFleetStorage(ctx, instruction, [fleetAccount.address], options.authorization.profile, 'Loot retrieval');
|
|
1173
|
+
const description = `Request ${selection.summary} from Loot ${loot.address} with Fleet ${fleet.name} (${fleet.address}); this spends the Fleet's whole ability power pool. Range, recent-slot randomness, cargo capacity, availability races, and final transfer quantities remain chain-authoritative. ${storage.disclosure}`;
|
|
1174
|
+
return buildPlannerPlan({
|
|
1119
1175
|
kind: 'combat.retrieve-loot',
|
|
1120
1176
|
preconditions: [
|
|
1121
|
-
await
|
|
1122
|
-
await
|
|
1177
|
+
await accountStatePrecondition(fleetAccount, `Fleet ${fleet.name} retains its configured Game, owning Profile, idle state, and normalized crew.`),
|
|
1178
|
+
await accountStatePrecondition(lootAccount, `Loot ${loot.address} retains its identity, creator, destroyer exclusivity, and requested known quantities.`),
|
|
1179
|
+
storage.guard,
|
|
1123
1180
|
],
|
|
1124
1181
|
steps: [
|
|
1125
1182
|
{
|
|
1126
1183
|
describes: description,
|
|
1127
|
-
instruction
|
|
1128
|
-
authorization: options.authorization,
|
|
1129
|
-
fleet: fleet.address,
|
|
1130
|
-
game,
|
|
1131
|
-
loot: loot.address,
|
|
1132
|
-
...(lootCreator === undefined ? {} : { lootCreator }),
|
|
1133
|
-
recentSlothashes: 'SysvarS1otHashes111111111111111111111111111',
|
|
1134
|
-
want: selection.generated.map(([itemIndex, cargo]) => [
|
|
1135
|
-
itemIndex,
|
|
1136
|
-
cargo.map(([cargoId, quantity]) => [cargoId, quantity]),
|
|
1137
|
-
]),
|
|
1138
|
-
}),
|
|
1184
|
+
instruction,
|
|
1139
1185
|
semantics: [{ kind: 'exclusive', scope: 'transaction' }],
|
|
1140
1186
|
signers: [options.authorization.authority],
|
|
1141
1187
|
},
|
|
@@ -1143,4 +1189,16 @@ export async function planFleetRetrieveLoot(ctx, fleet, loot, inputWant, inputOp
|
|
|
1143
1189
|
summary: description,
|
|
1144
1190
|
});
|
|
1145
1191
|
}
|
|
1192
|
+
/** Reads the Profile, Rent and the action's other storage accounts, and plans
|
|
1193
|
+
* its Profile storage funding. */
|
|
1194
|
+
async function planFleetStorage(ctx, instruction, addresses, profile, label, stimulantStats) {
|
|
1195
|
+
const all = [...addresses, profile, RENT_ADDRESS];
|
|
1196
|
+
const rows = await readContextRawAccounts(ctx, all);
|
|
1197
|
+
const accounts = new Map(all.map((address, index) => [address, rows[index]]));
|
|
1198
|
+
return planStorageFunding({
|
|
1199
|
+
action: readCombatStorageAction(instruction, accounts, stimulantStats),
|
|
1200
|
+
accounts,
|
|
1201
|
+
label,
|
|
1202
|
+
});
|
|
1203
|
+
}
|
|
1146
1204
|
//# sourceMappingURL=index.js.map
|