@aephia/atlas-kit 0.6.0-next.14 → 0.6.0-next.140
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 +3 -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 +97 -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 +69 -14
- package/dist/claim-stakes/actions/index.d.ts.map +1 -1
- package/dist/claim-stakes/actions/index.js +613 -697
- 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/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 +35 -0
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +35 -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 +24 -12
- package/dist/combat/actions/index.d.ts.map +1 -1
- package/dist/combat/actions/index.js +286 -280
- 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/index.d.ts +28 -18
- package/dist/crafting/actions/index.d.ts.map +1 -1
- package/dist/crafting/actions/index.js +297 -352
- package/dist/crafting/actions/index.js.map +1 -1
- package/dist/crafting/index.d.ts +33 -3
- package/dist/crafting/index.d.ts.map +1 -1
- package/dist/crafting/index.js +49 -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 +6 -1
- package/dist/factions/index.d.ts.map +1 -1
- package/dist/factions/index.js +16 -18
- 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 +46 -0
- package/dist/fleets/actions/add-ship.d.ts.map +1 -0
- package/dist/fleets/actions/add-ship.js +131 -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/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 +81 -25
- package/dist/fleets/actions/index.d.ts.map +1 -1
- package/dist/fleets/actions/index.js +483 -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/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 +35 -0
- package/dist/fleets/index.d.ts.map +1 -1
- package/dist/fleets/index.js +54 -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.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.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 +30 -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 +89 -0
- package/dist/internal/c4/discriminators.d.ts.map +1 -0
- package/dist/internal/c4/discriminators.js +182 -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 +15 -57
- package/dist/internal/c4/factions.d.ts.map +1 -1
- package/dist/internal/c4/factions.js +80 -223
- 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-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 +27 -0
- package/dist/internal/c4/fleet-ship-assembly.d.ts.map +1 -0
- package/dist/internal/c4/fleet-ship-assembly.js +94 -0
- package/dist/internal/c4/fleet-ship-assembly.js.map +1 -0
- package/dist/internal/c4/fleet-storage.d.ts +42 -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.d.ts +59 -22
- package/dist/internal/c4/fleet.d.ts.map +1 -1
- package/dist/internal/c4/fleet.js +50 -87
- 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 +117 -32
- package/dist/internal/c4/game.d.ts.map +1 -1
- package/dist/internal/c4/game.js +227 -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 +2 -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 +43 -0
- package/dist/internal/c4/pda.d.ts.map +1 -1
- package/dist/internal/c4/pda.js +83 -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 +4 -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 +306 -0
- package/dist/internal/c4/scan-lifecycle.d.ts.map +1 -0
- package/dist/internal/c4/scan-lifecycle.js +235 -0
- package/dist/internal/c4/scan-lifecycle.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 +24 -0
- package/dist/internal/c4/stimulant.d.ts.map +1 -0
- package/dist/internal/c4/stimulant.js +32 -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 +37 -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 +1 -0
- package/dist/internal/fleet.d.ts.map +1 -1
- package/dist/internal/fleet.js +3 -1
- 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 +55 -37
- package/dist/internal/planning/authorization-adapter.d.ts.map +1 -1
- package/dist/internal/planning/authorization-adapter.js +231 -81
- 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-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/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 +4 -0
- package/dist/internal/planning/currency-cache-guard.d.ts.map +1 -0
- package/dist/internal/planning/currency-cache-guard.js +34 -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/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-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 +209 -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-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 +36 -0
- package/dist/internal/planning/fleet-ship-assembly.d.ts.map +1 -0
- package/dist/internal/planning/fleet-ship-assembly.js +158 -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-character.d.ts +7 -0
- package/dist/internal/planning/movement-character.d.ts.map +1 -0
- package/dist/internal/planning/movement-character.js +41 -0
- package/dist/internal/planning/movement-character.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 +177 -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 +28 -0
- package/dist/internal/planning/profile-storage-funding-guard.d.ts.map +1 -0
- package/dist/internal/planning/profile-storage-funding-guard.js +73 -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/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/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 +36 -0
- package/dist/internal/planning/storage-action-readers.js.map +1 -0
- package/dist/internal/planning/storage-actions.d.ts +85 -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 +87 -0
- package/dist/mining/actions/index.d.ts.map +1 -0
- package/dist/mining/actions/index.js +369 -0
- package/dist/mining/actions/index.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 +9 -2
- package/dist/mining/index.d.ts.map +1 -1
- package/dist/mining/index.js +10 -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 +603 -72
- package/dist/planning/execution.js.map +1 -1
- package/dist/planning/index.d.ts +226 -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 +139 -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 +4 -0
- package/dist/registry/index.d.ts.map +1 -1
- package/dist/registry/index.js +190 -224
- 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 +191 -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 +121 -0
- package/dist/scanning/signals.d.ts.map +1 -0
- package/dist/scanning/signals.js +171 -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 +10 -2
|
@@ -1,13 +1,47 @@
|
|
|
1
|
+
import { validateCurrencyCache } from '../internal/c4/currency-cache.js';
|
|
2
|
+
import { revalidateDockFunding } from '../internal/planning/fleet-dock-funding.js';
|
|
3
|
+
import { decodeDockingSequences } from '../registry/docking.js';
|
|
4
|
+
import { revalidateMarketOrder, marketOrderFundingAddresses, } from '../internal/planning/local-market-order-funding.js';
|
|
5
|
+
import { resolveFleetCrewTransfer } from '../internal/planning/fleet-crew-transfer.js';
|
|
6
|
+
import { revalidateScanCompletion } from '../internal/planning/scan-completion.js';
|
|
7
|
+
import { openSignalAddresses, validateOpenSignal, } from '../internal/planning/open-signal.js';
|
|
8
|
+
import { revalidateDetect } from '../internal/planning/scan-detect.js';
|
|
9
|
+
import { resolveFleetRespawn } from '../internal/planning/fleet-respawn.js';
|
|
10
|
+
import { validateFleetAttackActors } from '../internal/planning/fleet-attack-xp.js';
|
|
11
|
+
import { RENT_ADDRESS, readRent } from '../internal/planning/rent.js';
|
|
12
|
+
import { getBase64Decoder, } from '@solana/kit';
|
|
13
|
+
import { hashMovementCharacter } from '../internal/planning/movement-character.js';
|
|
14
|
+
import { validateFleetDockingPolicy } from '../internal/planning/fleet-docking.js';
|
|
15
|
+
import { validateStarbaseSystem } from '../internal/planning/starbase-system.js';
|
|
16
|
+
import { revalidateCharacterRegistration, isEmptySystemAccount, } from '../internal/planning/character-registration.js';
|
|
17
|
+
import { validateFleetArrivalIntent } from '../internal/planning/fleet-arrival.js';
|
|
18
|
+
import { isRuntimeGuard, revalidateRuntimeGuards, } from '../internal/planning/runtime-guards.js';
|
|
19
|
+
import { isFactionTradeGuard } from '../internal/planning/faction-trade-guards.js';
|
|
20
|
+
import { resolveShipImportFunding, validateShipImportFunding, } from '../internal/planning/ship-import-funding.js';
|
|
21
|
+
import { matchesFleetMiningState } from '../internal/planning/mining-stop.js';
|
|
22
|
+
import { requireGameAddress } from '../internal/game-context.js';
|
|
23
|
+
import { matchesFactionTradeState } from '../internal/planning/faction-trade-state.js';
|
|
24
|
+
import { resolveFleetShipAssembly, validateFleetShipAssembly, } from '../internal/planning/fleet-ship-assembly.js';
|
|
25
|
+
import { resolveFleetCreation, validateFleetCreation, } from '../internal/planning/fleet-creation.js';
|
|
1
26
|
import { validateTokenMint } from '../internal/planning/token-mint.js';
|
|
2
|
-
import {
|
|
27
|
+
import { resolveResearchUnlock, validateResearchUnlock, } from '../internal/planning/research-unlock.js';
|
|
28
|
+
import { storageSteps, validateStorageFunding, } from '../internal/planning/storage-actions.js';
|
|
29
|
+
import { readStorageAction, storageActionAccounts, } from '../internal/planning/storage-action-readers.js';
|
|
30
|
+
import { decodeGameCargoConfigurationRows } from '../internal/c4/game.js';
|
|
31
|
+
import { CLOCK_ADDRESS } from '../internal/planning/faction-enrollment.js';
|
|
32
|
+
import { decodeGameResearchUnlockRules } from '../internal/c4/game.js';
|
|
33
|
+
import { hashGameShipConfigurations, decodeGameShipAssemblyCatalog, } from '../registry/ships.js';
|
|
3
34
|
import { validateGameForCharacterRegistration } from '../registry/onboarding.js';
|
|
4
35
|
import { hashAccountState } from '../internal/planning/account-state.js';
|
|
5
|
-
import {
|
|
36
|
+
import { hashGameCargoConfigurationGuards } from '../registry/cargo.js';
|
|
6
37
|
import { validateWalletCargoCache } from '../internal/c4/wallet-cargo-cache.js';
|
|
7
|
-
import {
|
|
38
|
+
import { deriveCargoDefinitionsCacheAddress } from '../internal/c4/pda.js';
|
|
39
|
+
import { getBase58Decoder, getBase64EncodedWireTransaction, getSignatureFromTransaction, isAddress, isTransactionModifyingSigner, isTransactionPartialSigner, isTransactionSendingSigner, signAndSendTransactionWithSigners, signTransactionWithSigners, } from '@solana/kit';
|
|
8
40
|
import { InvalidActionInputError, SageSdkError } from '../client/errors.js';
|
|
9
41
|
import { invalidateContextAddresses, readContextRawAccounts, } from '../client/reconciliation.js';
|
|
10
|
-
import {
|
|
42
|
+
import { assembleValidatedPlanWithContext, requireWriteRpc, validateAssemblyPolicy, validatePlanAssemblyPolicy, validatePlan, } from './assembly.js';
|
|
43
|
+
import { hashRecipeConfiguration, validateRecipeUsage, } from '../internal/planning/recipe-state.js';
|
|
44
|
+
import { originalTokenBalance } from '../internal/planning/original-token.js';
|
|
11
45
|
const DEFAULT_TIMEOUT_MS = 60_000;
|
|
12
46
|
const DEFAULT_POLL_INTERVAL_MS = 500;
|
|
13
47
|
const MAX_HOST_TIMER_MS = 2_147_483_647;
|
|
@@ -29,20 +63,26 @@ class SignerMismatchError extends InvalidActionInputError {
|
|
|
29
63
|
this.unexpected = unexpected;
|
|
30
64
|
}
|
|
31
65
|
}
|
|
32
|
-
class
|
|
33
|
-
constructor() {
|
|
34
|
-
super('MISSING_WRITE_TRANSPORT', 'This SAGE context has no writeRpc transport, so it cannot execute a Plan. Pass the optional writeRpc transport when creating the context, then retry.');
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
class ActionPreconditionFailedError extends SageSdkError {
|
|
66
|
+
export class ActionPreconditionFailedError extends SageSdkError {
|
|
38
67
|
describes;
|
|
39
68
|
observedSlot;
|
|
40
|
-
constructor(precondition, observedSlot) {
|
|
41
|
-
super('ACTION_PRECONDITION_FAILED', `The account state required by this Plan changed at ${
|
|
69
|
+
constructor(precondition, observedSlot, cause, address = precondition.address) {
|
|
70
|
+
super('ACTION_PRECONDITION_FAILED', `The account state required by this Plan changed at ${address}: ${cause ?? precondition.describes} Refresh the affected game state and create a new Plan before retrying.`, { address });
|
|
42
71
|
this.describes = precondition.describes;
|
|
43
72
|
this.observedSlot = observedSlot;
|
|
44
73
|
}
|
|
45
74
|
}
|
|
75
|
+
/** The cause a wrapped guard failure may carry: only a validator's own
|
|
76
|
+
* precondition cause and remedy for the guarded address. Adapter, provider and
|
|
77
|
+
* unknown failures yield `undefined`, so the wrapper falls back to the guard's
|
|
78
|
+
* generic description and never concatenates inner exception text. */
|
|
79
|
+
function guardCause(precondition, error) {
|
|
80
|
+
return error instanceof SageSdkError &&
|
|
81
|
+
error.code === 'ACTION_PRECONDITION_FAILED' &&
|
|
82
|
+
(error.address === undefined || error.address === precondition.address)
|
|
83
|
+
? error.message
|
|
84
|
+
: undefined;
|
|
85
|
+
}
|
|
46
86
|
class TransactionExpiredError extends SageSdkError {
|
|
47
87
|
signature;
|
|
48
88
|
lastValidBlockHeight;
|
|
@@ -268,41 +308,258 @@ function assertPlanTransactionMessage(expected, actual) {
|
|
|
268
308
|
invalid('signers', 'modified compiled transaction message', 'signers that preserve the assembled fee payer, instructions, programs, and account roles while optionally replacing only the transaction lifetime', 'Use a signer that signs the assembled Plan without changing its message, or reassemble a new Plan for the intended transaction before retrying.');
|
|
269
309
|
}
|
|
270
310
|
}
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
return null;
|
|
274
|
-
const value = transaction.lifetimeConstraint.lastValidBlockHeight;
|
|
275
|
-
if (typeof value !== 'bigint' || value < 0n || value > MAX_U64) {
|
|
276
|
-
invalid('signers', 'invalid final lastValidBlockHeight metadata', 'a final transaction lifetime with lastValidBlockHeight encoded as an unsigned 64-bit bigint', 'Use a signer that returns trustworthy blockhash lifetime metadata, or use an opaque sending signer whose lifetime cannot produce a definite-expiry claim.');
|
|
277
|
-
}
|
|
278
|
-
return value;
|
|
279
|
-
}
|
|
280
|
-
// Original Token Account layout: mint/authority at 0/32, initialized state at
|
|
281
|
-
// 108, and u32 COption tags at 72/109/129. No capability decoder is imported.
|
|
311
|
+
/** Whether the account still is the guarded original Token account, with at
|
|
312
|
+
* least the guarded balance for a `token-account` guard. */
|
|
282
313
|
function matchesTokenAccount(account, expected) {
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
314
|
+
const balance = originalTokenBalance(account, expected.mint, expected.owner);
|
|
315
|
+
return (typeof balance === 'bigint' &&
|
|
316
|
+
(expected.kind !== 'token-account' || balance >= expected.minimumBalance));
|
|
317
|
+
}
|
|
318
|
+
function checkRegistrationFunding(registrations, fee) {
|
|
319
|
+
const balances = new Map();
|
|
320
|
+
for (const registration of registrations) {
|
|
321
|
+
const previous = balances.get(registration.funder);
|
|
322
|
+
if (previous === undefined || registration.observedLamports < previous)
|
|
323
|
+
balances.set(registration.funder, registration.observedLamports);
|
|
324
|
+
}
|
|
325
|
+
if (fee && balances.has(fee.payer))
|
|
326
|
+
balances.set(fee.payer, balances.get(fee.payer) - fee.lamports);
|
|
327
|
+
for (const registration of registrations) {
|
|
328
|
+
const balance = balances.get(registration.funder);
|
|
329
|
+
if (balance < registration.requiredLamports)
|
|
330
|
+
throw new SageSdkError('ACTION_PRECONDITION_FAILED', 'Character registration funding cannot cover the ordered upfront storage and applicable transaction fee. Fund the wallet separately and recreate the Plan; a later Character refund cannot fund an earlier allocation.', { address: registration.funder });
|
|
331
|
+
balances.set(registration.funder, balance - registration.netDebit);
|
|
332
|
+
}
|
|
333
|
+
if (fee)
|
|
334
|
+
for (const registration of registrations) {
|
|
335
|
+
const balance = balances.get(registration.funder);
|
|
336
|
+
if (balance !== 0n && balance < registration.minimumBalance)
|
|
337
|
+
throw new SageSdkError('ACTION_PRECONDITION_FAILED', 'Character registration leaves the funder below its empty-System-account rent minimum. Leave zero or a rent-exempt balance after storage and fees, then recreate the Plan.', { address: registration.funder });
|
|
338
|
+
}
|
|
296
339
|
}
|
|
297
|
-
async function checkPreconditions(context,
|
|
298
|
-
const
|
|
340
|
+
async function checkPreconditions(context, allPreconditions, steps, commitment) {
|
|
341
|
+
for (const guard of allPreconditions) {
|
|
342
|
+
if (guard.kind === 'fleet-crew-transfer') {
|
|
343
|
+
try {
|
|
344
|
+
await resolveFleetCrewTransfer(context, guard, guard, commitment);
|
|
345
|
+
}
|
|
346
|
+
catch (error) {
|
|
347
|
+
throw new ActionPreconditionFailedError(guard, undefined, error instanceof SageSdkError
|
|
348
|
+
? error.message
|
|
349
|
+
: 'Crew transfer prerequisites could not be verified. Refresh crew state and recreate the Plan.');
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
if (guard.kind === 'scan-completion')
|
|
353
|
+
await revalidateScanCompletion(context, guard, commitment);
|
|
354
|
+
if (guard.kind === 'scan-detect')
|
|
355
|
+
await revalidateDetect(context, guard, commitment);
|
|
356
|
+
if (guard.kind === 'fleet-attack') {
|
|
357
|
+
try {
|
|
358
|
+
await validateFleetAttackActors(context, guard);
|
|
359
|
+
}
|
|
360
|
+
catch (error) {
|
|
361
|
+
throw new ActionPreconditionFailedError(guard, undefined, guardCause(guard, error) ??
|
|
362
|
+
'The attacking or defending Fleet or Character could not be verified. Refresh both Fleets and their Characters, then recreate the Plan before signing.');
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
for (const guard of allPreconditions) {
|
|
367
|
+
if (guard.kind !== 'fleet-respawn')
|
|
368
|
+
continue;
|
|
369
|
+
try {
|
|
370
|
+
const current = await resolveFleetRespawn(context, { ...guard, fleet: guard.address }, guard, commitment);
|
|
371
|
+
const planned = steps[0].instruction;
|
|
372
|
+
const fresh = current.instruction;
|
|
373
|
+
if (planned.programAddress !== fresh.programAddress ||
|
|
374
|
+
planned.data?.length !== fresh.data?.length ||
|
|
375
|
+
fresh.data?.some((v, i) => planned.data?.[i] !== v) ||
|
|
376
|
+
planned.accounts?.length !== fresh.accounts?.length ||
|
|
377
|
+
fresh.accounts?.some((a, i) => planned.accounts?.[i]?.address !== a.address ||
|
|
378
|
+
planned.accounts?.[i]?.role !== a.role))
|
|
379
|
+
throw new SageSdkError('ACTION_PRECONDITION_FAILED', 'Recovery instruction accounts changed. Recreate and inspect the recovery Plan before signing.');
|
|
380
|
+
}
|
|
381
|
+
catch (error) {
|
|
382
|
+
throw new ActionPreconditionFailedError(guard, undefined, error instanceof SageSdkError
|
|
383
|
+
? error.message
|
|
384
|
+
: 'Recovery prerequisites could not be validated. Refresh the Fleet and recreate the Plan.');
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
const checkedXp = new Set();
|
|
388
|
+
const freshGameVersions = new Map();
|
|
389
|
+
const registrationFunding = [];
|
|
390
|
+
const initializations = new Map();
|
|
391
|
+
for (const guard of allPreconditions) {
|
|
392
|
+
if (guard.kind !== 'character-registration')
|
|
393
|
+
continue;
|
|
394
|
+
registrationFunding.push(await revalidateCharacterRegistration(context, guard, commitment, freshGameVersions, initializations));
|
|
395
|
+
}
|
|
396
|
+
checkRegistrationFunding(registrationFunding);
|
|
397
|
+
for (const guard of allPreconditions) {
|
|
398
|
+
if (guard.kind !== 'fleet-arrival')
|
|
399
|
+
continue;
|
|
400
|
+
try {
|
|
401
|
+
const current = await validateFleetArrivalIntent(context, guard.intent, freshGameVersions);
|
|
402
|
+
for (const xp of allPreconditions) {
|
|
403
|
+
if (xp.kind !== 'xp-runtime' ||
|
|
404
|
+
xp.intent.game !== current.xp.intent.game ||
|
|
405
|
+
xp.intent.character !== current.xp.intent.character ||
|
|
406
|
+
xp.intent.structure !== current.xp.intent.structure ||
|
|
407
|
+
(xp.intent.profile !== undefined &&
|
|
408
|
+
xp.intent.profile !== current.intent.profile))
|
|
409
|
+
continue;
|
|
410
|
+
if (['xpBudget', 'xpBudgetConfig', 'xpAccrual'].some((key) => xp.accounts[key] !== current.xp.accounts[key]))
|
|
411
|
+
throw new SageSdkError('ACTION_PRECONDITION_FAILED', 'Arrival XP runtime changed. Refresh the Fleet and recreate the Plan.');
|
|
412
|
+
checkedXp.add(xp);
|
|
413
|
+
}
|
|
414
|
+
if (current.character !== guard.character ||
|
|
415
|
+
current.regionTracker !== guard.regionTracker)
|
|
416
|
+
throw new SageSdkError('ACTION_PRECONDITION_FAILED', 'Arrival account links changed. Refresh the Fleet and recreate the Plan.');
|
|
417
|
+
}
|
|
418
|
+
catch (error) {
|
|
419
|
+
throw new ActionPreconditionFailedError(guard, undefined, error instanceof SageSdkError
|
|
420
|
+
? error.message
|
|
421
|
+
: 'Arrival prerequisites could not be validated. Refresh the Fleet and recreate the Plan.');
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
await revalidateRuntimeGuards(context, allPreconditions
|
|
425
|
+
.filter(isRuntimeGuard)
|
|
426
|
+
.filter((guard) => !checkedXp.has(guard)), freshGameVersions);
|
|
427
|
+
const preconditions = allPreconditions.filter((guard) => !isRuntimeGuard(guard) &&
|
|
428
|
+
guard.kind !== 'fleet-attack' &&
|
|
429
|
+
guard.kind !== 'fleet-arrival' &&
|
|
430
|
+
guard.kind !== 'character-registration' &&
|
|
431
|
+
guard.kind !== 'scan-detect' &&
|
|
432
|
+
guard.kind !== 'scan-completion' &&
|
|
433
|
+
guard.kind !== 'fleet-respawn' &&
|
|
434
|
+
guard.kind !== 'fleet-crew-transfer');
|
|
435
|
+
const fleetCreationAccounts = new Map();
|
|
436
|
+
const fleetAssemblyAccounts = new Map();
|
|
437
|
+
const importFundingAccounts = new Map();
|
|
438
|
+
const assemblyGames = new Set();
|
|
439
|
+
const assemblyCatalogs = new Map();
|
|
440
|
+
const requiredAddresses = new Set(preconditions.map(({ address }) => address));
|
|
441
|
+
for (const guard of preconditions) {
|
|
442
|
+
if (guard.kind === 'fleet-dock-funding' && guard.status === 'available') {
|
|
443
|
+
for (const address of [
|
|
444
|
+
guard.profile,
|
|
445
|
+
guard.starbasePlayer,
|
|
446
|
+
guard.system,
|
|
447
|
+
guard.game,
|
|
448
|
+
RENT_ADDRESS,
|
|
449
|
+
])
|
|
450
|
+
requiredAddresses.add(address);
|
|
451
|
+
}
|
|
452
|
+
if (guard.kind === 'fleet-docking-policy')
|
|
453
|
+
for (const address of [
|
|
454
|
+
guard.ownership,
|
|
455
|
+
guard.system,
|
|
456
|
+
guard.starbasePlayer,
|
|
457
|
+
])
|
|
458
|
+
requiredAddresses.add(address);
|
|
459
|
+
if (guard.kind === 'local-market-order' && guard.status === 'available') {
|
|
460
|
+
for (const address of [
|
|
461
|
+
guard.character,
|
|
462
|
+
guard.starbasePlayer,
|
|
463
|
+
...marketOrderFundingAddresses(guard.profile, allPreconditions),
|
|
464
|
+
])
|
|
465
|
+
requiredAddresses.add(address);
|
|
466
|
+
}
|
|
467
|
+
if (guard.kind === 'scan-signal-open') {
|
|
468
|
+
for (const address of openSignalAddresses(guard))
|
|
469
|
+
requiredAddresses.add(address);
|
|
470
|
+
}
|
|
471
|
+
if (guard.kind !== 'fleet-create')
|
|
472
|
+
continue;
|
|
473
|
+
const resolved = await resolveFleetCreation(guard);
|
|
474
|
+
if (resolved.fleet !== guard.address)
|
|
475
|
+
throw new ActionPreconditionFailedError(guard, undefined, 'The Fleet address does not match this Game, Profile and exact label. Recreate the Fleet creation Plan from its intended label.');
|
|
476
|
+
fleetCreationAccounts.set(guard, resolved);
|
|
477
|
+
for (const address of [
|
|
478
|
+
resolved.game,
|
|
479
|
+
resolved.profile,
|
|
480
|
+
resolved.system,
|
|
481
|
+
resolved.character,
|
|
482
|
+
resolved.profileFaction,
|
|
483
|
+
resolved.starbasePlayer,
|
|
484
|
+
resolved.fleet,
|
|
485
|
+
resolved.rent,
|
|
486
|
+
resolved.clock,
|
|
487
|
+
])
|
|
488
|
+
requiredAddresses.add(address);
|
|
489
|
+
}
|
|
490
|
+
for (const guard of preconditions) {
|
|
491
|
+
if (guard.kind !== 'fleet-add-ship')
|
|
492
|
+
continue;
|
|
493
|
+
const resolved = await resolveFleetShipAssembly(guard);
|
|
494
|
+
fleetAssemblyAccounts.set(guard, resolved);
|
|
495
|
+
assemblyGames.add(resolved.game);
|
|
496
|
+
for (const address of [
|
|
497
|
+
resolved.game,
|
|
498
|
+
resolved.profile,
|
|
499
|
+
resolved.system,
|
|
500
|
+
resolved.character,
|
|
501
|
+
resolved.profileFaction,
|
|
502
|
+
resolved.starbasePlayer,
|
|
503
|
+
resolved.fleet,
|
|
504
|
+
resolved.rent,
|
|
505
|
+
resolved.clock,
|
|
506
|
+
])
|
|
507
|
+
requiredAddresses.add(address);
|
|
508
|
+
}
|
|
509
|
+
for (const guard of preconditions) {
|
|
510
|
+
if (guard.kind !== 'research-unlock')
|
|
511
|
+
continue;
|
|
512
|
+
for (const address of [
|
|
513
|
+
guard.game,
|
|
514
|
+
guard.profile,
|
|
515
|
+
guard.system,
|
|
516
|
+
guard.starbasePlayer,
|
|
517
|
+
guard.currencyCache,
|
|
518
|
+
CLOCK_ADDRESS,
|
|
519
|
+
RENT_ADDRESS,
|
|
520
|
+
])
|
|
521
|
+
requiredAddresses.add(address);
|
|
522
|
+
}
|
|
523
|
+
// Profile storage funding is rederived from each instruction and the fresh
|
|
524
|
+
// accounts it resizes; a deposit's cargo id comes from its source mint.
|
|
525
|
+
const storageActionSteps = storageSteps(steps);
|
|
526
|
+
for (const step of storageActionSteps) {
|
|
527
|
+
for (const address of [
|
|
528
|
+
step.instruction.accounts[1].address,
|
|
529
|
+
...storageActionAccounts(step.kind, step.instruction),
|
|
530
|
+
RENT_ADDRESS,
|
|
531
|
+
])
|
|
532
|
+
requiredAddresses.add(address);
|
|
533
|
+
if (step.kind === 'deposit')
|
|
534
|
+
requiredAddresses.add(requireGameAddress(context));
|
|
535
|
+
}
|
|
536
|
+
for (const guard of preconditions) {
|
|
537
|
+
if (guard.kind !== 'ship-import-funding')
|
|
538
|
+
continue;
|
|
539
|
+
let resolved;
|
|
540
|
+
try {
|
|
541
|
+
resolved = await resolveShipImportFunding(guard);
|
|
542
|
+
}
|
|
543
|
+
catch {
|
|
544
|
+
throw new ActionPreconditionFailedError(guard, undefined, 'The ship import target does not match its Game, Profile and System. Refresh the canonical StarbasePlayer and prepare a new import.');
|
|
545
|
+
}
|
|
546
|
+
importFundingAccounts.set(guard, resolved);
|
|
547
|
+
for (const address of [
|
|
548
|
+
resolved.profile,
|
|
549
|
+
resolved.character,
|
|
550
|
+
resolved.starbasePlayer,
|
|
551
|
+
resolved.rent,
|
|
552
|
+
])
|
|
553
|
+
requiredAddresses.add(address);
|
|
554
|
+
}
|
|
555
|
+
const addresses = [...requiredAddresses];
|
|
299
556
|
const accounts = await readContextRawAccounts(context, addresses, {
|
|
300
557
|
commitment,
|
|
301
558
|
});
|
|
302
559
|
const byAddress = new Map(addresses.map((address, index) => [address, accounts[index]]));
|
|
303
560
|
const cargoIdsByGame = new Map();
|
|
304
561
|
for (const guard of preconditions) {
|
|
305
|
-
if (guard.kind !== 'game-cargo-config')
|
|
562
|
+
if (guard.kind !== 'game-cargo-bytes-config')
|
|
306
563
|
continue;
|
|
307
564
|
const ids = cargoIdsByGame.get(guard.address) ?? [];
|
|
308
565
|
ids.push(guard.cargoId);
|
|
@@ -320,27 +577,261 @@ async function checkPreconditions(context, preconditions, commitment) {
|
|
|
320
577
|
// Invocation-local only: every execution attempt still reads and decodes fresh state.
|
|
321
578
|
const cargoHashesByGame = new Map();
|
|
322
579
|
const validatedGames = new Set();
|
|
323
|
-
|
|
580
|
+
// One exact decode per fresh Game row, shared by every Game guard below.
|
|
581
|
+
const gameDecodes = new Map();
|
|
582
|
+
const profileFunding = new Map();
|
|
583
|
+
const fundedTargets = new Set();
|
|
584
|
+
let storageResults;
|
|
585
|
+
// One decoded cargo row set per Game, shared by cargo-definition guards and
|
|
586
|
+
// a deposit's cargo lookup.
|
|
587
|
+
const cargoRowsByGame = new Map();
|
|
588
|
+
const cargoRows = (game) => {
|
|
589
|
+
let rows = cargoRowsByGame.get(game.address);
|
|
590
|
+
if (!rows) {
|
|
591
|
+
rows = decodeGameCargoConfigurationRows(game, gameDecodes);
|
|
592
|
+
cargoRowsByGame.set(game.address, rows);
|
|
593
|
+
}
|
|
594
|
+
return rows;
|
|
595
|
+
};
|
|
596
|
+
const recordFunding = (guard, funding, target = `${guard.kind}:${guard.address}`) => {
|
|
597
|
+
// Repeated guards for one action are assertions, not additional debits.
|
|
598
|
+
// Every guard still validates its own ceiling before reaching here.
|
|
599
|
+
if (fundedTargets.has(target))
|
|
600
|
+
return;
|
|
601
|
+
fundedTargets.add(target);
|
|
602
|
+
const current = profileFunding.get(guard.profile);
|
|
603
|
+
profileFunding.set(guard.profile, {
|
|
604
|
+
debit: (current?.debit ?? 0n) + funding.profileDebit,
|
|
605
|
+
reserve: funding.profileReserve,
|
|
606
|
+
guard,
|
|
607
|
+
});
|
|
608
|
+
};
|
|
609
|
+
const fleetFailure = (guard, error) => {
|
|
610
|
+
// Only SDK diagnostics from this bounded validation batch are exposed.
|
|
611
|
+
// Never stringify provider/codec objects or retain their inner causes.
|
|
612
|
+
if (error instanceof SageSdkError &&
|
|
613
|
+
error.address !== undefined &&
|
|
614
|
+
requiredAddresses.has(error.address))
|
|
615
|
+
return new ActionPreconditionFailedError(guard, byAddress.get(error.address)?.slot, error.message, error.address);
|
|
616
|
+
return new ActionPreconditionFailedError(guard, undefined, 'Fleet prerequisites could not be validated. Refresh the related accounts and replan with a supported binding version.');
|
|
617
|
+
};
|
|
618
|
+
// A docking Plan from another deployment is reported as such before any
|
|
619
|
+
// freshness guard, whatever the saved guard order.
|
|
620
|
+
for (const precondition of preconditions)
|
|
621
|
+
if ((precondition.kind === 'fleet-dock-funding' ||
|
|
622
|
+
precondition.kind === 'fleet-docking-policy') &&
|
|
623
|
+
precondition.game !== requireGameAddress(context))
|
|
624
|
+
throw fleetFailure(precondition, new SageSdkError('ACTION_PRECONDITION_FAILED', precondition.kind === 'fleet-dock-funding'
|
|
625
|
+
? `The docking Plan belongs to Game ${precondition.game}, but the context uses Game ${requireGameAddress(context)}. Recreate it with the intended Game context.`
|
|
626
|
+
: 'The docking faction policy belongs to another Game. Recreate the Plan with the intended Game context.', { address: precondition.address }));
|
|
627
|
+
// Dependent docking and cargo storage estimates run after every other
|
|
628
|
+
// freshness guard, so an exact account-state, cargo-definition or policy
|
|
629
|
+
// diagnostic wins whatever the saved order.
|
|
630
|
+
const estimate = (g) => g.kind === 'fleet-dock-funding' || g.kind === 'profile-storage-funding';
|
|
631
|
+
const ordered = [
|
|
632
|
+
...preconditions.filter((g) => !estimate(g)),
|
|
633
|
+
...preconditions.filter((g) => g.kind === 'fleet-dock-funding'),
|
|
634
|
+
...preconditions.filter((g) => g.kind === 'profile-storage-funding'),
|
|
635
|
+
];
|
|
636
|
+
for (const precondition of ordered) {
|
|
324
637
|
const account = byAddress.get(precondition.address);
|
|
638
|
+
if (precondition.kind === 'fleet-dock-funding') {
|
|
639
|
+
try {
|
|
640
|
+
const funding = revalidateDockFunding(precondition, byAddress, precondition.status === 'available'
|
|
641
|
+
? decodeDockingSequences(byAddress.get(precondition.game), gameDecodes)
|
|
642
|
+
: undefined);
|
|
643
|
+
if (funding)
|
|
644
|
+
recordFunding(precondition, funding);
|
|
645
|
+
}
|
|
646
|
+
catch (error) {
|
|
647
|
+
throw fleetFailure(precondition, error);
|
|
648
|
+
}
|
|
649
|
+
continue;
|
|
650
|
+
}
|
|
651
|
+
if (precondition.kind === 'local-market-order') {
|
|
652
|
+
try {
|
|
653
|
+
if (precondition.game !== requireGameAddress(context))
|
|
654
|
+
throw new SageSdkError('ACTION_PRECONDITION_FAILED', 'The order belongs to another Game. Recreate it with the intended Game context.');
|
|
655
|
+
revalidateMarketOrder(precondition, byAddress, allPreconditions);
|
|
656
|
+
}
|
|
657
|
+
catch (error) {
|
|
658
|
+
const failedAddress = error instanceof SageSdkError ? error.address : undefined;
|
|
659
|
+
throw new ActionPreconditionFailedError(precondition, byAddress.get(failedAddress ?? precondition.address)?.slot, error instanceof SageSdkError
|
|
660
|
+
? error.message
|
|
661
|
+
: 'The Local Market debit bounds could not be verified. Refresh its funding accounts and recreate the order Plan.', failedAddress);
|
|
662
|
+
}
|
|
663
|
+
continue;
|
|
664
|
+
}
|
|
665
|
+
if (precondition.kind === 'scan-signal-open') {
|
|
666
|
+
if (precondition.game !== requireGameAddress(context))
|
|
667
|
+
throw new ActionPreconditionFailedError(precondition, undefined, 'This signal setup belongs to a different configured Game. Refetch and recreate the Plan using the intended Game context.');
|
|
668
|
+
try {
|
|
669
|
+
recordFunding(precondition, await validateOpenSignal(precondition, byAddress, precondition.authorityHash));
|
|
670
|
+
}
|
|
671
|
+
catch (error) {
|
|
672
|
+
throw fleetFailure(precondition, error);
|
|
673
|
+
}
|
|
674
|
+
continue;
|
|
675
|
+
}
|
|
676
|
+
if (precondition.kind === 'ship-import-funding') {
|
|
677
|
+
try {
|
|
678
|
+
const funding = validateShipImportFunding(precondition, importFundingAccounts.get(precondition), byAddress, precondition.maximumProfileDebit);
|
|
679
|
+
recordFunding(precondition, funding);
|
|
680
|
+
}
|
|
681
|
+
catch (error) {
|
|
682
|
+
throw fleetFailure(precondition, error);
|
|
683
|
+
}
|
|
684
|
+
continue;
|
|
685
|
+
}
|
|
686
|
+
if (precondition.kind === 'profile-storage-funding') {
|
|
687
|
+
try {
|
|
688
|
+
storageResults ??= validateStorageFunding(steps, preconditions.filter((guard) => guard.kind === 'profile-storage-funding'), byAddress, (instruction) => readStorageAction(instruction, byAddress,
|
|
689
|
+
// A deposit Plan's cargo-definition guards already required the
|
|
690
|
+
// Game in this batch.
|
|
691
|
+
(mint) => cargoRows(byAddress.get(requireGameAddress(context))).rows.find((row) => row.mint === mint)?.id));
|
|
692
|
+
const result = storageResults.get(precondition);
|
|
693
|
+
if ('error' in result)
|
|
694
|
+
throw result.error;
|
|
695
|
+
const { funding } = result;
|
|
696
|
+
// Each guard is one action, and several may resize one account, so
|
|
697
|
+
// every guard adds its own debit. A zero debit withdraws nothing and
|
|
698
|
+
// imposes no Profile reserve on the combined check.
|
|
699
|
+
if (funding.profileDebit > 0n)
|
|
700
|
+
recordFunding(precondition, funding, `${precondition.kind}:${String(ordered.indexOf(precondition))}`);
|
|
701
|
+
}
|
|
702
|
+
catch (error) {
|
|
703
|
+
// Every storage check failure names the Profile, a resized account
|
|
704
|
+
// or the Rent sysvar, all read in this batch.
|
|
705
|
+
throw fleetFailure(precondition, error);
|
|
706
|
+
}
|
|
707
|
+
continue;
|
|
708
|
+
}
|
|
709
|
+
if (precondition.kind === 'research-unlock') {
|
|
710
|
+
try {
|
|
711
|
+
const game = byAddress.get(precondition.game);
|
|
712
|
+
if (precondition.game !== requireGameAddress(context) || !game)
|
|
713
|
+
throw new SageSdkError('ACTION_PRECONDITION_FAILED', 'The research unlock belongs to another or missing Game. Recreate it with the intended Game context.', { address: precondition.game });
|
|
714
|
+
const resolved = await resolveResearchUnlock(precondition);
|
|
715
|
+
if (resolved.character !== precondition.address ||
|
|
716
|
+
resolved.starbasePlayer !== precondition.starbasePlayer ||
|
|
717
|
+
resolved.currencyCache !== precondition.currencyCache)
|
|
718
|
+
throw new SageSdkError('ACTION_PRECONDITION_FAILED', 'The research unlock accounts are not canonical for this Game, Profile and System. Recreate the Plan with planUnlockResearchNode.');
|
|
719
|
+
const funding = await validateResearchUnlock(precondition, resolved, byAddress, decodeGameResearchUnlockRules(game, gameDecodes));
|
|
720
|
+
// A zero storage debit withdraws nothing, so it imposes no Profile
|
|
721
|
+
// reserve on the combined check.
|
|
722
|
+
if (funding.profileDebit > 0n)
|
|
723
|
+
recordFunding(precondition, funding);
|
|
724
|
+
}
|
|
725
|
+
catch (error) {
|
|
726
|
+
const failed = error instanceof SageSdkError ? error.address : undefined;
|
|
727
|
+
throw new ActionPreconditionFailedError(precondition, byAddress.get(failed ?? precondition.address)?.slot, error instanceof SageSdkError
|
|
728
|
+
? error.message
|
|
729
|
+
: 'Research prerequisites could not be validated. Refresh the Character, Starbase Player and Game definitions, then recreate the unlock Plan.', failed);
|
|
730
|
+
}
|
|
731
|
+
continue;
|
|
732
|
+
}
|
|
733
|
+
if (precondition.kind === 'fleet-add-ship') {
|
|
734
|
+
try {
|
|
735
|
+
const game = byAddress.get(precondition.game);
|
|
736
|
+
let catalog = assemblyCatalogs.get(precondition.game);
|
|
737
|
+
if (!catalog && game) {
|
|
738
|
+
catalog = decodeGameShipAssemblyCatalog(game, gameDecodes);
|
|
739
|
+
assemblyCatalogs.set(precondition.game, catalog);
|
|
740
|
+
}
|
|
741
|
+
const funding = await validateFleetShipAssembly(precondition, fleetAssemblyAccounts.get(precondition), byAddress, precondition, catalog);
|
|
742
|
+
recordFunding(precondition, funding);
|
|
743
|
+
}
|
|
744
|
+
catch (error) {
|
|
745
|
+
throw fleetFailure(precondition, error);
|
|
746
|
+
}
|
|
747
|
+
continue;
|
|
748
|
+
}
|
|
749
|
+
if (precondition.kind === 'fleet-create') {
|
|
750
|
+
try {
|
|
751
|
+
const funding = await validateFleetCreation(precondition, fleetCreationAccounts.get(precondition), byAddress, precondition.maximumProfileDebit);
|
|
752
|
+
recordFunding(precondition, funding);
|
|
753
|
+
}
|
|
754
|
+
catch (error) {
|
|
755
|
+
throw fleetFailure(precondition, error);
|
|
756
|
+
}
|
|
757
|
+
continue;
|
|
758
|
+
}
|
|
759
|
+
if (precondition.kind === 'fleet-docking-policy') {
|
|
760
|
+
try {
|
|
761
|
+
await validateFleetDockingPolicy({
|
|
762
|
+
tracker: account,
|
|
763
|
+
ownership: byAddress.get(precondition.ownership),
|
|
764
|
+
system: byAddress.get(precondition.system),
|
|
765
|
+
starbasePlayer: byAddress.get(precondition.starbasePlayer),
|
|
766
|
+
}, precondition);
|
|
767
|
+
}
|
|
768
|
+
catch (error) {
|
|
769
|
+
throw fleetFailure(precondition, error);
|
|
770
|
+
}
|
|
771
|
+
continue;
|
|
772
|
+
}
|
|
325
773
|
let narrowed = true;
|
|
774
|
+
let cause;
|
|
326
775
|
if (precondition.kind === 'token-account')
|
|
327
776
|
narrowed =
|
|
328
777
|
account !== undefined && matchesTokenAccount(account, precondition);
|
|
329
|
-
if (precondition.kind === '
|
|
778
|
+
if (precondition.kind === 'currency-cache' ||
|
|
779
|
+
precondition.kind === 'movement-character' ||
|
|
780
|
+
precondition.kind === 'starbase-system' ||
|
|
781
|
+
precondition.kind === 'fleet-mining' ||
|
|
782
|
+
isFactionTradeGuard(precondition) ||
|
|
783
|
+
precondition.kind === 'recipe-state' ||
|
|
784
|
+
precondition.kind === 'token-mint' ||
|
|
330
785
|
precondition.kind === 'game-ship-config' ||
|
|
331
786
|
precondition.kind === 'game-account' ||
|
|
332
|
-
precondition.kind === 'game-cargo-config' ||
|
|
787
|
+
precondition.kind === 'game-cargo-bytes-config' ||
|
|
333
788
|
precondition.kind === 'cargo-cache') {
|
|
334
789
|
try {
|
|
335
790
|
if (!account)
|
|
336
791
|
narrowed = false;
|
|
792
|
+
else if (precondition.kind === 'currency-cache') {
|
|
793
|
+
narrowed = precondition.game === requireGameAddress(context);
|
|
794
|
+
if (narrowed)
|
|
795
|
+
await validateCurrencyCache(account, precondition.game);
|
|
796
|
+
}
|
|
797
|
+
else if (precondition.kind === 'movement-character') {
|
|
798
|
+
narrowed =
|
|
799
|
+
precondition.game === requireGameAddress(context) &&
|
|
800
|
+
(await hashMovementCharacter(account, precondition)) ===
|
|
801
|
+
precondition.stateHash;
|
|
802
|
+
}
|
|
803
|
+
else if (precondition.kind === 'starbase-system') {
|
|
804
|
+
narrowed = precondition.game === requireGameAddress(context);
|
|
805
|
+
if (narrowed)
|
|
806
|
+
await validateStarbaseSystem(account, precondition);
|
|
807
|
+
}
|
|
808
|
+
else if (precondition.kind === 'fleet-mining') {
|
|
809
|
+
narrowed =
|
|
810
|
+
precondition.game === requireGameAddress(context) &&
|
|
811
|
+
(await matchesFleetMiningState(account, precondition));
|
|
812
|
+
}
|
|
813
|
+
else if (isFactionTradeGuard(precondition)) {
|
|
814
|
+
narrowed = await matchesFactionTradeState(account, precondition);
|
|
815
|
+
}
|
|
816
|
+
else if (precondition.kind === 'recipe-state') {
|
|
817
|
+
narrowed =
|
|
818
|
+
(await hashRecipeConfiguration(account)) ===
|
|
819
|
+
precondition.configHash;
|
|
820
|
+
if (narrowed)
|
|
821
|
+
validateRecipeUsage(account, precondition.requiredUses);
|
|
822
|
+
}
|
|
337
823
|
else if (precondition.kind === 'token-mint') {
|
|
338
824
|
narrowed = validateTokenMint(account) === precondition.decimals;
|
|
339
825
|
}
|
|
340
826
|
else if (precondition.kind === 'game-ship-config') {
|
|
341
827
|
let hashes = shipHashesByGame.get(precondition.address);
|
|
342
828
|
if (!hashes) {
|
|
343
|
-
|
|
829
|
+
let catalog = assemblyCatalogs.get(precondition.address);
|
|
830
|
+
if (!catalog && assemblyGames.has(precondition.address)) {
|
|
831
|
+
catalog = decodeGameShipAssemblyCatalog(account, gameDecodes);
|
|
832
|
+
assemblyCatalogs.set(precondition.address, catalog);
|
|
833
|
+
}
|
|
834
|
+
hashes = await hashGameShipConfigurations(account, shipIdsByGame.get(precondition.address), catalog, gameDecodes);
|
|
344
835
|
shipHashesByGame.set(precondition.address, hashes);
|
|
345
836
|
}
|
|
346
837
|
narrowed =
|
|
@@ -348,14 +839,20 @@ async function checkPreconditions(context, preconditions, commitment) {
|
|
|
348
839
|
}
|
|
349
840
|
else if (precondition.kind === 'game-account') {
|
|
350
841
|
if (!validatedGames.has(account.address)) {
|
|
351
|
-
|
|
842
|
+
if (assemblyGames.has(precondition.address)) {
|
|
843
|
+
if (!assemblyCatalogs.has(precondition.address))
|
|
844
|
+
assemblyCatalogs.set(precondition.address, decodeGameShipAssemblyCatalog(account, gameDecodes));
|
|
845
|
+
}
|
|
846
|
+
else
|
|
847
|
+
validateGameForCharacterRegistration(account, gameDecodes);
|
|
352
848
|
validatedGames.add(account.address);
|
|
353
849
|
}
|
|
354
850
|
}
|
|
355
|
-
else if (precondition.kind === 'game-cargo-config') {
|
|
851
|
+
else if (precondition.kind === 'game-cargo-bytes-config') {
|
|
356
852
|
let hashes = cargoHashesByGame.get(precondition.address);
|
|
357
853
|
if (!hashes) {
|
|
358
|
-
|
|
854
|
+
const ids = cargoIdsByGame.get(precondition.address);
|
|
855
|
+
hashes = await hashGameCargoConfigurationGuards(account, ids, cargoRows(account));
|
|
359
856
|
cargoHashesByGame.set(precondition.address, hashes);
|
|
360
857
|
}
|
|
361
858
|
narrowed =
|
|
@@ -363,35 +860,43 @@ async function checkPreconditions(context, preconditions, commitment) {
|
|
|
363
860
|
}
|
|
364
861
|
else {
|
|
365
862
|
validateWalletCargoCache(account, precondition.game, precondition.bump);
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
seeds: [
|
|
369
|
-
new TextEncoder().encode('CargoDefinitionsCache'),
|
|
370
|
-
getAddressEncoder().encode(precondition.game),
|
|
371
|
-
],
|
|
372
|
-
});
|
|
863
|
+
// validateWalletCargoCache requires the SAGE owner.
|
|
864
|
+
const [canonical, bump] = await deriveCargoDefinitionsCacheAddress(precondition.game);
|
|
373
865
|
narrowed =
|
|
374
866
|
canonical === account.address && bump === precondition.bump;
|
|
375
867
|
}
|
|
376
868
|
}
|
|
377
|
-
catch {
|
|
869
|
+
catch (error) {
|
|
378
870
|
narrowed = false;
|
|
871
|
+
cause = guardCause(precondition, error);
|
|
379
872
|
}
|
|
380
873
|
}
|
|
381
874
|
if (!narrowed ||
|
|
382
875
|
(precondition.kind === 'token-account-or-absent' &&
|
|
383
876
|
account !== undefined &&
|
|
384
877
|
!matchesTokenAccount(account, precondition)) ||
|
|
878
|
+
(precondition.kind === 'system-account-or-absent' &&
|
|
879
|
+
account !== undefined &&
|
|
880
|
+
(account.owner !== '11111111111111111111111111111111' ||
|
|
881
|
+
account.executable ||
|
|
882
|
+
account.data.length !== 0)) ||
|
|
385
883
|
(precondition.kind === 'account-absent' && account !== undefined) ||
|
|
386
884
|
(precondition.kind === 'account-state' &&
|
|
387
885
|
(account === undefined ||
|
|
388
886
|
(await hashAccountState(account.owner, account.data)) !==
|
|
389
887
|
precondition.dataHash))) {
|
|
390
|
-
throw new ActionPreconditionFailedError(precondition, account?.slot);
|
|
888
|
+
throw new ActionPreconditionFailedError(precondition, account?.slot, cause);
|
|
391
889
|
}
|
|
392
890
|
}
|
|
891
|
+
for (const [profile, funding] of profileFunding) {
|
|
892
|
+
// Validation above guarantees a fresh Profile from the same finite batch.
|
|
893
|
+
const account = byAddress.get(profile);
|
|
894
|
+
if (account.lamports < funding.reserve + funding.debit)
|
|
895
|
+
throw new ActionPreconditionFailedError(funding.guard, account.slot, 'The Profile cannot cover the combined Profile storage debits while preserving its rent reserve. Fund the Profile explicitly, then recreate and inspect the Plans.', profile);
|
|
896
|
+
}
|
|
897
|
+
return registrationFunding;
|
|
393
898
|
}
|
|
394
|
-
function commitmentReached(actual, requested) {
|
|
899
|
+
export function commitmentReached(actual, requested) {
|
|
395
900
|
if (actual === null)
|
|
396
901
|
return false;
|
|
397
902
|
const strength = {
|
|
@@ -516,7 +1021,9 @@ async function confirmTransaction(writeRpc, signature, lastValidBlockHeight, opt
|
|
|
516
1021
|
}
|
|
517
1022
|
}
|
|
518
1023
|
}
|
|
519
|
-
async function signAndSubmit(writeRpc, transaction, signers, sendingSigner, commitment, lifecycle) {
|
|
1024
|
+
async function signAndSubmit(writeRpc, transaction, contextSlot, signers, sendingSigner, commitment, lifecycle) {
|
|
1025
|
+
// Capture RPC metadata before handing the transaction to any signer.
|
|
1026
|
+
const { blockhash, lastValidBlockHeight: assembledHeight } = transaction.lifetimeConstraint;
|
|
520
1027
|
await lifecycle?.onBeforeSign();
|
|
521
1028
|
if (sendingSigner !== undefined) {
|
|
522
1029
|
let enteredOpaqueSender = false;
|
|
@@ -525,7 +1032,6 @@ async function signAndSubmit(writeRpc, transaction, signers, sendingSigner, comm
|
|
|
525
1032
|
async signAndSendTransactions(transactions, config) {
|
|
526
1033
|
for (const signed of transactions) {
|
|
527
1034
|
assertPlanTransactionMessage(transaction, signed);
|
|
528
|
-
readFinalLastValidBlockHeight(signed);
|
|
529
1035
|
}
|
|
530
1036
|
await lifecycle?.onBeforeOpaqueInvoke();
|
|
531
1037
|
enteredOpaqueSender = true;
|
|
@@ -551,8 +1057,13 @@ async function signAndSubmit(writeRpc, transaction, signers, sendingSigner, comm
|
|
|
551
1057
|
const signed = await signTransactionWithSigners(signingSigners, transaction);
|
|
552
1058
|
assertPlanTransactionMessage(transaction, signed);
|
|
553
1059
|
const signature = getSignatureFromTransaction(signed);
|
|
554
|
-
const lastValidBlockHeight =
|
|
555
|
-
|
|
1060
|
+
const lastValidBlockHeight = 'blockhash' in signed.lifetimeConstraint &&
|
|
1061
|
+
signed.lifetimeConstraint.blockhash === blockhash
|
|
1062
|
+
? assembledHeight
|
|
1063
|
+
: null;
|
|
1064
|
+
await lifecycle?.onSigned(signature, lastValidBlockHeight === null
|
|
1065
|
+
? null
|
|
1066
|
+
: Object.freeze({ lastValidBlockHeight, contextSlot }));
|
|
556
1067
|
await lifecycle?.onBeforeSubmit();
|
|
557
1068
|
try {
|
|
558
1069
|
const submittedSignature = await writeRpc
|
|
@@ -613,22 +1124,42 @@ export async function executePlanWithLifecycle(context, plan, options, lifecycle
|
|
|
613
1124
|
validatePlanAssemblyPolicy(plan, validated);
|
|
614
1125
|
const signers = matchSigners(plan, validated);
|
|
615
1126
|
const sendingSigner = resolveSendingSigner(signers);
|
|
616
|
-
const writeRpc = context
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
1127
|
+
const writeRpc = requireWriteRpc(context, 'execute');
|
|
1128
|
+
// Guard order is not trusted: funding follows instruction order, including hydrated Plans.
|
|
1129
|
+
const ordered = [...plan.preconditions].sort((a, b) => {
|
|
1130
|
+
const index = (guard) => guard.kind === 'character-registration'
|
|
1131
|
+
? plan.steps.findIndex((step) => step.instruction.accounts?.[2]?.address === guard.address)
|
|
1132
|
+
: -1;
|
|
1133
|
+
return index(a) - index(b);
|
|
1134
|
+
});
|
|
1135
|
+
const registrationFunding = await checkPreconditions(context, ordered, plan.steps, validated.commitment);
|
|
1136
|
+
const { transaction, contextSlot } = await assembleValidatedPlanWithContext(writeRpc, plan, {
|
|
621
1137
|
feePayer: validated.feePayer.address,
|
|
622
1138
|
commitment: validated.commitment,
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
: { computeUnitLimit: validated.computeUnitLimit }),
|
|
626
|
-
...(validated.priorityFeeMicroLamports === undefined
|
|
627
|
-
? {}
|
|
628
|
-
: { priorityFeeMicroLamports: validated.priorityFeeMicroLamports }),
|
|
1139
|
+
computeUnitLimit: validated.computeUnitLimit,
|
|
1140
|
+
priorityFeeMicroLamports: validated.priorityFeeMicroLamports,
|
|
629
1141
|
});
|
|
1142
|
+
if (registrationFunding.length > 0) {
|
|
1143
|
+
if (typeof writeRpc.getFeeForMessage !== 'function')
|
|
1144
|
+
throw new SageSdkError('MISSING_WRITE_TRANSPORT', 'The writeRpc transport has no callable getFeeForMessage method, so Character registration cannot check current transaction fees before signing. Update the custom writeRpc transport to implement the required SageWriteRpc getFeeForMessage method, then retry.');
|
|
1145
|
+
const payer = validated.feePayer.address;
|
|
1146
|
+
const { value: fee } = await writeRpc
|
|
1147
|
+
.getFeeForMessage(getBase64Decoder().decode(transaction.messageBytes), { commitment: validated.commitment })
|
|
1148
|
+
.send();
|
|
1149
|
+
if (typeof fee !== 'bigint' || fee < 0n)
|
|
1150
|
+
throw new SageSdkError('ACTION_PRECONDITION_FAILED', 'Current transaction fee could not be determined. Refresh the blockhash and recreate the registration Plan before signing.', { address: payer });
|
|
1151
|
+
if (!registrationFunding.some((funding) => funding.funder === payer)) {
|
|
1152
|
+
const [account, rent] = await readContextRawAccounts(context, [payer, RENT_ADDRESS], { commitment: validated.commitment });
|
|
1153
|
+
if (!account || !isEmptySystemAccount(account) || !rent)
|
|
1154
|
+
throw new SageSdkError('ACTION_PRECONDITION_FAILED', 'Registration fee payer must be an existing empty System wallet with current Rent available. Select and fund it separately.', { address: payer });
|
|
1155
|
+
const remaining = account.lamports - fee;
|
|
1156
|
+
if (remaining < 0n || (remaining > 0n && remaining < readRent(rent)(0)))
|
|
1157
|
+
throw new SageSdkError('ACTION_PRECONDITION_FAILED', 'Registration fee payer cannot pay the current fee and retain zero or a rent-exempt balance. Fund it separately.', { address: payer });
|
|
1158
|
+
}
|
|
1159
|
+
checkRegistrationFunding(registrationFunding, { payer, lamports: fee });
|
|
1160
|
+
}
|
|
630
1161
|
await lifecycle?.onPrepared(sendingSigner === undefined ? 'observable' : 'opaque');
|
|
631
|
-
const submission = await signAndSubmit(writeRpc, transaction, signers, sendingSigner, validated.commitment, lifecycle);
|
|
1162
|
+
const submission = await signAndSubmit(writeRpc, transaction, contextSlot, signers, sendingSigner, validated.commitment, lifecycle);
|
|
632
1163
|
if (submission.status === 'unknown')
|
|
633
1164
|
return submission;
|
|
634
1165
|
const result = await confirmTransaction(writeRpc, submission.signature, submission.lastValidBlockHeight, validated);
|