@aephia/atlas-kit 0.6.0-next.12 → 0.6.0-next.121
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 +2 -2
- package/dist/cargo/actions/deposit.d.ts.map +1 -1
- package/dist/cargo/actions/deposit.js +28 -117
- package/dist/cargo/actions/deposit.js.map +1 -1
- package/dist/cargo/actions/index.d.ts +1 -1
- package/dist/cargo/actions/index.d.ts.map +1 -1
- package/dist/cargo/actions/index.js +28 -84
- 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 -53
- 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 -164
- 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 +14 -1
- package/dist/claim-stakes/actions/index.d.ts.map +1 -1
- package/dist/claim-stakes/actions/index.js +399 -592
- package/dist/claim-stakes/actions/index.js.map +1 -1
- package/dist/claim-stakes/index.d.ts +14 -0
- package/dist/claim-stakes/index.d.ts.map +1 -1
- package/dist/claim-stakes/index.js +25 -12
- 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 +6 -2
- package/dist/client/errors.d.ts.map +1 -1
- package/dist/client/errors.js +31 -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 +4 -4
- package/dist/combat/actions/index.d.ts.map +1 -1
- package/dist/combat/actions/index.js +207 -261
- package/dist/combat/actions/index.js.map +1 -1
- package/dist/combat/index.d.ts +13 -3
- package/dist/combat/index.d.ts.map +1 -1
- package/dist/combat/index.js +9 -16
- package/dist/combat/index.js.map +1 -1
- package/dist/crafting/actions/index.d.ts +12 -1
- package/dist/crafting/actions/index.d.ts.map +1 -1
- package/dist/crafting/actions/index.js +181 -303
- 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 +1 -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 +35 -0
- package/dist/fleets/actions/add-ship.d.ts.map +1 -0
- package/dist/fleets/actions/add-ship.js +120 -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 +41 -0
- package/dist/fleets/actions/crew-transfer.d.ts.map +1 -0
- package/dist/fleets/actions/crew-transfer.js +94 -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 +64 -24
- package/dist/fleets/actions/index.d.ts.map +1 -1
- package/dist/fleets/actions/index.js +385 -334
- 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 +67 -91
- package/dist/fleets/actions/ship-import.js.map +1 -1
- package/dist/fleets/cooldown.d.ts +44 -0
- package/dist/fleets/cooldown.d.ts.map +1 -0
- package/dist/fleets/cooldown.js +43 -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 +41 -0
- package/dist/fleets/movement-arithmetic.js.map +1 -0
- package/dist/fleets/subwarp-estimate.d.ts +70 -0
- package/dist/fleets/subwarp-estimate.d.ts.map +1 -0
- package/dist/fleets/subwarp-estimate.js +38 -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 +68 -0
- package/dist/fleets/warp-lane-policy.d.ts.map +1 -0
- package/dist/fleets/warp-lane-policy.js +91 -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 +4 -4
- package/dist/identity/actions/index.d.ts.map +1 -1
- package/dist/identity/actions/index.js +51 -29
- package/dist/identity/actions/index.js.map +1 -1
- 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 +24 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +20 -3
- 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-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.d.ts +4 -27
- package/dist/internal/c4/claim-stake.d.ts.map +1 -1
- package/dist/internal/c4/claim-stake.js +38 -83
- 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.d.ts +25 -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 +81 -0
- package/dist/internal/c4/discriminators.d.ts.map +1 -0
- package/dist/internal/c4/discriminators.js +166 -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 +13 -57
- package/dist/internal/c4/factions.d.ts.map +1 -1
- package/dist/internal/c4/factions.js +79 -222
- 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 +11 -0
- package/dist/internal/c4/fleet-ship-assembly.d.ts.map +1 -0
- package/dist/internal/c4/fleet-ship-assembly.js +44 -0
- package/dist/internal/c4/fleet-ship-assembly.js.map +1 -0
- package/dist/internal/c4/fleet.d.ts +48 -19
- 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 +76 -30
- package/dist/internal/c4/game.d.ts.map +1 -1
- package/dist/internal/c4/game.js +173 -124
- 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 +87 -0
- package/dist/internal/c4/loot.d.ts.map +1 -0
- package/dist/internal/c4/loot.js +108 -0
- package/dist/internal/c4/loot.js.map +1 -0
- package/dist/internal/c4/loyalty.d.ts +0 -27
- package/dist/internal/c4/loyalty.d.ts.map +1 -1
- package/dist/internal/c4/loyalty.js +32 -160
- package/dist/internal/c4/loyalty.js.map +1 -1
- 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 +31 -0
- package/dist/internal/c4/pda.d.ts.map +1 -1
- package/dist/internal/c4/pda.js +60 -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 +2 -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 +1 -28
- package/dist/internal/c4/scanning.d.ts.map +1 -1
- package/dist/internal/c4/scanning.js +32 -103
- 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 +45 -43
- 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/wallet-cargo-cache.js +2 -1
- package/dist/internal/c4/wallet-cargo-cache.js.map +1 -1
- package/dist/internal/c4/world.d.ts +36 -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.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 +16 -0
- package/dist/internal/loyalty-atlas-bank-state.d.ts.map +1 -0
- package/dist/internal/loyalty-atlas-bank-state.js +10 -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 +45 -37
- package/dist/internal/planning/authorization-adapter.d.ts.map +1 -1
- package/dist/internal/planning/authorization-adapter.js +169 -81
- package/dist/internal/planning/authorization-adapter.js.map +1 -1
- 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/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 +33 -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 +123 -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 +154 -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 +43 -0
- package/dist/internal/planning/fleet-docking-guard.js.map +1 -0
- package/dist/internal/planning/fleet-docking.d.ts +10 -0
- package/dist/internal/planning/fleet-docking.d.ts.map +1 -0
- package/dist/internal/planning/fleet-docking.js +71 -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 +118 -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/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/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-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 +85 -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 +33 -0
- package/dist/internal/planning/own-starbase-facts.d.ts.map +1 -0
- package/dist/internal/planning/own-starbase-facts.js +49 -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 +168 -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/recipe-state.d.ts +6 -0
- package/dist/internal/planning/recipe-state.d.ts.map +1 -0
- package/dist/internal/planning/recipe-state.js +20 -0
- package/dist/internal/planning/recipe-state.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/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 +640 -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 +197 -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 +245 -0
- package/dist/internal/planning/scan-detect.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 +2 -41
- 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/token-mint.d.ts +4 -0
- package/dist/internal/planning/token-mint.d.ts.map +1 -0
- package/dist/internal/planning/token-mint.js +16 -0
- package/dist/internal/planning/token-mint.js.map +1 -0
- 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 +117 -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 +15 -45
- package/dist/loyalty/actions/index.js.map +1 -1
- package/dist/loyalty/index.d.ts.map +1 -1
- package/dist/loyalty/index.js +6 -18
- 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 +230 -178
- package/dist/markets/actions/index.js.map +1 -1
- package/dist/markets/actions/trade-faction-market.d.ts +43 -0
- package/dist/markets/actions/trade-faction-market.d.ts.map +1 -0
- package/dist/markets/actions/trade-faction-market.js +277 -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 +319 -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 +504 -72
- package/dist/planning/execution.js.map +1 -1
- package/dist/planning/index.d.ts +196 -149
- package/dist/planning/index.d.ts.map +1 -1
- package/dist/planning/index.js +31 -355
- 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 +127 -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 +20 -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 +20 -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.js +19 -19
- 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 +5 -2
- package/dist/scanning/index.d.ts.map +1 -1
- package/dist/scanning/index.js +17 -21
- 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 +111 -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 +1 -1
- package/dist/starbases/actions/index.d.ts.map +1 -1
- package/dist/starbases/actions/index.js +16 -58
- 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 +110 -5
- package/dist/world/index.d.ts.map +1 -1
- package/dist/world/index.js +112 -15
- package/dist/world/index.js.map +1 -1
- package/dist/world/planet-claim-stake-plots.d.ts +130 -0
- package/dist/world/planet-claim-stake-plots.d.ts.map +1 -0
- package/dist/world/planet-claim-stake-plots.js +110 -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,12 +1,41 @@
|
|
|
1
|
-
import {
|
|
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';
|
|
26
|
+
import { validateTokenMint } from '../internal/planning/token-mint.js';
|
|
27
|
+
import { hashGameShipConfigurations, decodeGameShipAssemblyCatalog, } from '../registry/ships.js';
|
|
2
28
|
import { validateGameForCharacterRegistration } from '../registry/onboarding.js';
|
|
3
29
|
import { hashAccountState } from '../internal/planning/account-state.js';
|
|
4
|
-
import {
|
|
30
|
+
import { hashGameCargoConfigurationGuards } from '../registry/cargo.js';
|
|
5
31
|
import { validateWalletCargoCache } from '../internal/c4/wallet-cargo-cache.js';
|
|
6
|
-
import {
|
|
32
|
+
import { deriveCargoDefinitionsCacheAddress } from '../internal/c4/pda.js';
|
|
33
|
+
import { getBase58Decoder, getBase64EncodedWireTransaction, getSignatureFromTransaction, isAddress, isTransactionModifyingSigner, isTransactionPartialSigner, isTransactionSendingSigner, signAndSendTransactionWithSigners, signTransactionWithSigners, } from '@solana/kit';
|
|
7
34
|
import { InvalidActionInputError, SageSdkError } from '../client/errors.js';
|
|
8
35
|
import { invalidateContextAddresses, readContextRawAccounts, } from '../client/reconciliation.js';
|
|
9
|
-
import {
|
|
36
|
+
import { assembleValidatedPlanWithContext, requireWriteRpc, validateAssemblyPolicy, validatePlanAssemblyPolicy, validatePlan, } from './assembly.js';
|
|
37
|
+
import { hashRecipeConfiguration, validateRecipeUsage, } from '../internal/planning/recipe-state.js';
|
|
38
|
+
import { originalTokenBalance } from '../internal/planning/original-token.js';
|
|
10
39
|
const DEFAULT_TIMEOUT_MS = 60_000;
|
|
11
40
|
const DEFAULT_POLL_INTERVAL_MS = 500;
|
|
12
41
|
const MAX_HOST_TIMER_MS = 2_147_483_647;
|
|
@@ -28,20 +57,26 @@ class SignerMismatchError extends InvalidActionInputError {
|
|
|
28
57
|
this.unexpected = unexpected;
|
|
29
58
|
}
|
|
30
59
|
}
|
|
31
|
-
class
|
|
32
|
-
constructor() {
|
|
33
|
-
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.');
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
class ActionPreconditionFailedError extends SageSdkError {
|
|
60
|
+
export class ActionPreconditionFailedError extends SageSdkError {
|
|
37
61
|
describes;
|
|
38
62
|
observedSlot;
|
|
39
|
-
constructor(precondition, observedSlot) {
|
|
40
|
-
super('ACTION_PRECONDITION_FAILED', `The account state required by this Plan changed at ${
|
|
63
|
+
constructor(precondition, observedSlot, cause, address = precondition.address) {
|
|
64
|
+
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 });
|
|
41
65
|
this.describes = precondition.describes;
|
|
42
66
|
this.observedSlot = observedSlot;
|
|
43
67
|
}
|
|
44
68
|
}
|
|
69
|
+
/** The cause a wrapped guard failure may carry: only a validator's own
|
|
70
|
+
* precondition cause and remedy for the guarded address. Adapter, provider and
|
|
71
|
+
* unknown failures yield `undefined`, so the wrapper falls back to the guard's
|
|
72
|
+
* generic description and never concatenates inner exception text. */
|
|
73
|
+
function guardCause(precondition, error) {
|
|
74
|
+
return error instanceof SageSdkError &&
|
|
75
|
+
error.code === 'ACTION_PRECONDITION_FAILED' &&
|
|
76
|
+
(error.address === undefined || error.address === precondition.address)
|
|
77
|
+
? error.message
|
|
78
|
+
: undefined;
|
|
79
|
+
}
|
|
45
80
|
class TransactionExpiredError extends SageSdkError {
|
|
46
81
|
signature;
|
|
47
82
|
lastValidBlockHeight;
|
|
@@ -267,41 +302,226 @@ function assertPlanTransactionMessage(expected, actual) {
|
|
|
267
302
|
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.');
|
|
268
303
|
}
|
|
269
304
|
}
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
return null;
|
|
273
|
-
const value = transaction.lifetimeConstraint.lastValidBlockHeight;
|
|
274
|
-
if (typeof value !== 'bigint' || value < 0n || value > MAX_U64) {
|
|
275
|
-
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.');
|
|
276
|
-
}
|
|
277
|
-
return value;
|
|
278
|
-
}
|
|
279
|
-
// Original Token Account layout: mint/authority at 0/32, initialized state at
|
|
280
|
-
// 108, and u32 COption tags at 72/109/129. No capability decoder is imported.
|
|
305
|
+
/** Whether the account still is the guarded original Token account, with at
|
|
306
|
+
* least the guarded balance for a `token-account` guard. */
|
|
281
307
|
function matchesTokenAccount(account, expected) {
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
return false;
|
|
286
|
-
const bytes = new DataView(account.data.buffer, account.data.byteOffset, account.data.byteLength);
|
|
287
|
-
if ((expected.kind === 'token-account' &&
|
|
288
|
-
bytes.getBigUint64(64, true) < expected.minimumBalance) ||
|
|
289
|
-
bytes.getUint8(108) !== 1 ||
|
|
290
|
-
[72, 109, 129].some((offset) => bytes.getUint32(offset, true) > 1))
|
|
291
|
-
return false;
|
|
292
|
-
const decoder = getAddressDecoder();
|
|
293
|
-
return (decoder.decode(account.data.subarray(0, 32)) === expected.mint &&
|
|
294
|
-
decoder.decode(account.data.subarray(32, 64)) === expected.owner);
|
|
308
|
+
const balance = originalTokenBalance(account, expected.mint, expected.owner);
|
|
309
|
+
return (typeof balance === 'bigint' &&
|
|
310
|
+
(expected.kind !== 'token-account' || balance >= expected.minimumBalance));
|
|
295
311
|
}
|
|
296
|
-
|
|
297
|
-
const
|
|
312
|
+
function checkRegistrationFunding(registrations, fee) {
|
|
313
|
+
const balances = new Map();
|
|
314
|
+
for (const registration of registrations) {
|
|
315
|
+
const previous = balances.get(registration.funder);
|
|
316
|
+
if (previous === undefined || registration.observedLamports < previous)
|
|
317
|
+
balances.set(registration.funder, registration.observedLamports);
|
|
318
|
+
}
|
|
319
|
+
if (fee && balances.has(fee.payer))
|
|
320
|
+
balances.set(fee.payer, balances.get(fee.payer) - fee.lamports);
|
|
321
|
+
for (const registration of registrations) {
|
|
322
|
+
const balance = balances.get(registration.funder);
|
|
323
|
+
if (balance < registration.requiredLamports)
|
|
324
|
+
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 });
|
|
325
|
+
balances.set(registration.funder, balance - registration.netDebit);
|
|
326
|
+
}
|
|
327
|
+
if (fee)
|
|
328
|
+
for (const registration of registrations) {
|
|
329
|
+
const balance = balances.get(registration.funder);
|
|
330
|
+
if (balance !== 0n && balance < registration.minimumBalance)
|
|
331
|
+
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 });
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
async function checkPreconditions(context, allPreconditions, steps, commitment) {
|
|
335
|
+
for (const guard of allPreconditions) {
|
|
336
|
+
if (guard.kind === 'fleet-crew-transfer') {
|
|
337
|
+
try {
|
|
338
|
+
await resolveFleetCrewTransfer(context, guard, guard, commitment);
|
|
339
|
+
}
|
|
340
|
+
catch (error) {
|
|
341
|
+
throw new ActionPreconditionFailedError(guard, undefined, error instanceof SageSdkError
|
|
342
|
+
? error.message
|
|
343
|
+
: 'Crew transfer prerequisites could not be verified. Refresh crew state and recreate the Plan.');
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
if (guard.kind === 'scan-completion')
|
|
347
|
+
await revalidateScanCompletion(context, guard, commitment);
|
|
348
|
+
if (guard.kind === 'scan-detect')
|
|
349
|
+
await revalidateDetect(context, guard, commitment);
|
|
350
|
+
if (guard.kind === 'fleet-attack') {
|
|
351
|
+
try {
|
|
352
|
+
await validateFleetAttackActors(context, guard);
|
|
353
|
+
}
|
|
354
|
+
catch (error) {
|
|
355
|
+
throw new ActionPreconditionFailedError(guard, undefined, guardCause(guard, error) ??
|
|
356
|
+
'The attacking or defending Fleet or Character could not be verified. Refresh both Fleets and their Characters, then recreate the Plan before signing.');
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
for (const guard of allPreconditions) {
|
|
361
|
+
if (guard.kind !== 'fleet-respawn')
|
|
362
|
+
continue;
|
|
363
|
+
try {
|
|
364
|
+
const current = await resolveFleetRespawn(context, { ...guard, fleet: guard.address }, guard, commitment);
|
|
365
|
+
const planned = steps[0].instruction;
|
|
366
|
+
const fresh = current.instruction;
|
|
367
|
+
if (planned.programAddress !== fresh.programAddress ||
|
|
368
|
+
planned.data?.length !== fresh.data?.length ||
|
|
369
|
+
fresh.data?.some((v, i) => planned.data?.[i] !== v) ||
|
|
370
|
+
planned.accounts?.length !== fresh.accounts?.length ||
|
|
371
|
+
fresh.accounts?.some((a, i) => planned.accounts?.[i]?.address !== a.address ||
|
|
372
|
+
planned.accounts?.[i]?.role !== a.role))
|
|
373
|
+
throw new SageSdkError('ACTION_PRECONDITION_FAILED', 'Recovery instruction accounts changed. Recreate and inspect the recovery Plan before signing.');
|
|
374
|
+
}
|
|
375
|
+
catch (error) {
|
|
376
|
+
throw new ActionPreconditionFailedError(guard, undefined, error instanceof SageSdkError
|
|
377
|
+
? error.message
|
|
378
|
+
: 'Recovery prerequisites could not be validated. Refresh the Fleet and recreate the Plan.');
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
const checkedXp = new Set();
|
|
382
|
+
const freshGameVersions = new Map();
|
|
383
|
+
const registrationFunding = [];
|
|
384
|
+
const initializations = new Map();
|
|
385
|
+
for (const guard of allPreconditions) {
|
|
386
|
+
if (guard.kind !== 'character-registration')
|
|
387
|
+
continue;
|
|
388
|
+
registrationFunding.push(await revalidateCharacterRegistration(context, guard, commitment, freshGameVersions, initializations));
|
|
389
|
+
}
|
|
390
|
+
checkRegistrationFunding(registrationFunding);
|
|
391
|
+
for (const guard of allPreconditions) {
|
|
392
|
+
if (guard.kind !== 'fleet-arrival')
|
|
393
|
+
continue;
|
|
394
|
+
try {
|
|
395
|
+
const current = await validateFleetArrivalIntent(context, guard.intent, freshGameVersions);
|
|
396
|
+
for (const xp of allPreconditions) {
|
|
397
|
+
if (xp.kind !== 'xp-runtime' ||
|
|
398
|
+
xp.intent.game !== current.xp.intent.game ||
|
|
399
|
+
xp.intent.character !== current.xp.intent.character ||
|
|
400
|
+
xp.intent.structure !== current.xp.intent.structure ||
|
|
401
|
+
(xp.intent.profile !== undefined &&
|
|
402
|
+
xp.intent.profile !== current.intent.profile))
|
|
403
|
+
continue;
|
|
404
|
+
if (['xpBudget', 'xpBudgetConfig', 'xpAccrual'].some((key) => xp.accounts[key] !== current.xp.accounts[key]))
|
|
405
|
+
throw new SageSdkError('ACTION_PRECONDITION_FAILED', 'Arrival XP runtime changed. Refresh the Fleet and recreate the Plan.');
|
|
406
|
+
checkedXp.add(xp);
|
|
407
|
+
}
|
|
408
|
+
if (current.character !== guard.character ||
|
|
409
|
+
current.regionTracker !== guard.regionTracker)
|
|
410
|
+
throw new SageSdkError('ACTION_PRECONDITION_FAILED', 'Arrival account links changed. Refresh the Fleet and recreate the Plan.');
|
|
411
|
+
}
|
|
412
|
+
catch (error) {
|
|
413
|
+
throw new ActionPreconditionFailedError(guard, undefined, error instanceof SageSdkError
|
|
414
|
+
? error.message
|
|
415
|
+
: 'Arrival prerequisites could not be validated. Refresh the Fleet and recreate the Plan.');
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
await revalidateRuntimeGuards(context, allPreconditions
|
|
419
|
+
.filter(isRuntimeGuard)
|
|
420
|
+
.filter((guard) => !checkedXp.has(guard)), freshGameVersions);
|
|
421
|
+
const preconditions = allPreconditions.filter((guard) => !isRuntimeGuard(guard) &&
|
|
422
|
+
guard.kind !== 'fleet-attack' &&
|
|
423
|
+
guard.kind !== 'fleet-arrival' &&
|
|
424
|
+
guard.kind !== 'character-registration' &&
|
|
425
|
+
guard.kind !== 'scan-detect' &&
|
|
426
|
+
guard.kind !== 'scan-completion' &&
|
|
427
|
+
guard.kind !== 'fleet-respawn' &&
|
|
428
|
+
guard.kind !== 'fleet-crew-transfer');
|
|
429
|
+
const fleetCreationAccounts = new Map();
|
|
430
|
+
const fleetAssemblyAccounts = new Map();
|
|
431
|
+
const importFundingAccounts = new Map();
|
|
432
|
+
const assemblyGames = new Set();
|
|
433
|
+
const assemblyCatalogs = new Map();
|
|
434
|
+
const requiredAddresses = new Set(preconditions.map(({ address }) => address));
|
|
435
|
+
for (const guard of preconditions) {
|
|
436
|
+
if (guard.kind === 'fleet-dock-funding' && guard.status === 'available') {
|
|
437
|
+
for (const address of [
|
|
438
|
+
guard.profile,
|
|
439
|
+
guard.starbasePlayer,
|
|
440
|
+
guard.system,
|
|
441
|
+
guard.game,
|
|
442
|
+
RENT_ADDRESS,
|
|
443
|
+
])
|
|
444
|
+
requiredAddresses.add(address);
|
|
445
|
+
}
|
|
446
|
+
if (guard.kind === 'fleet-docking-policy')
|
|
447
|
+
requiredAddresses.add(guard.ownership);
|
|
448
|
+
if (guard.kind === 'local-market-order' && guard.status === 'available') {
|
|
449
|
+
for (const address of [
|
|
450
|
+
guard.character,
|
|
451
|
+
guard.starbasePlayer,
|
|
452
|
+
...marketOrderFundingAddresses(guard.profile, allPreconditions),
|
|
453
|
+
])
|
|
454
|
+
requiredAddresses.add(address);
|
|
455
|
+
}
|
|
456
|
+
if (guard.kind === 'scan-signal-open') {
|
|
457
|
+
for (const address of openSignalAddresses(guard))
|
|
458
|
+
requiredAddresses.add(address);
|
|
459
|
+
}
|
|
460
|
+
if (guard.kind !== 'fleet-create')
|
|
461
|
+
continue;
|
|
462
|
+
const resolved = await resolveFleetCreation(guard);
|
|
463
|
+
if (resolved.fleet !== guard.address)
|
|
464
|
+
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.');
|
|
465
|
+
fleetCreationAccounts.set(guard, resolved);
|
|
466
|
+
for (const address of [
|
|
467
|
+
resolved.game,
|
|
468
|
+
resolved.profile,
|
|
469
|
+
resolved.system,
|
|
470
|
+
resolved.character,
|
|
471
|
+
resolved.profileFaction,
|
|
472
|
+
resolved.starbasePlayer,
|
|
473
|
+
resolved.fleet,
|
|
474
|
+
resolved.rent,
|
|
475
|
+
resolved.clock,
|
|
476
|
+
])
|
|
477
|
+
requiredAddresses.add(address);
|
|
478
|
+
}
|
|
479
|
+
for (const guard of preconditions) {
|
|
480
|
+
if (guard.kind !== 'fleet-add-ship')
|
|
481
|
+
continue;
|
|
482
|
+
const resolved = await resolveFleetShipAssembly(guard);
|
|
483
|
+
fleetAssemblyAccounts.set(guard, resolved);
|
|
484
|
+
assemblyGames.add(resolved.game);
|
|
485
|
+
for (const address of [
|
|
486
|
+
resolved.game,
|
|
487
|
+
resolved.profile,
|
|
488
|
+
resolved.system,
|
|
489
|
+
resolved.character,
|
|
490
|
+
resolved.profileFaction,
|
|
491
|
+
resolved.starbasePlayer,
|
|
492
|
+
resolved.fleet,
|
|
493
|
+
resolved.rent,
|
|
494
|
+
resolved.clock,
|
|
495
|
+
])
|
|
496
|
+
requiredAddresses.add(address);
|
|
497
|
+
}
|
|
498
|
+
for (const guard of preconditions) {
|
|
499
|
+
if (guard.kind !== 'ship-import-funding')
|
|
500
|
+
continue;
|
|
501
|
+
let resolved;
|
|
502
|
+
try {
|
|
503
|
+
resolved = await resolveShipImportFunding(guard);
|
|
504
|
+
}
|
|
505
|
+
catch {
|
|
506
|
+
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.');
|
|
507
|
+
}
|
|
508
|
+
importFundingAccounts.set(guard, resolved);
|
|
509
|
+
for (const address of [
|
|
510
|
+
resolved.profile,
|
|
511
|
+
resolved.character,
|
|
512
|
+
resolved.starbasePlayer,
|
|
513
|
+
resolved.rent,
|
|
514
|
+
])
|
|
515
|
+
requiredAddresses.add(address);
|
|
516
|
+
}
|
|
517
|
+
const addresses = [...requiredAddresses];
|
|
298
518
|
const accounts = await readContextRawAccounts(context, addresses, {
|
|
299
519
|
commitment,
|
|
300
520
|
});
|
|
301
521
|
const byAddress = new Map(addresses.map((address, index) => [address, accounts[index]]));
|
|
302
522
|
const cargoIdsByGame = new Map();
|
|
303
523
|
for (const guard of preconditions) {
|
|
304
|
-
if (guard.kind !== 'game-cargo-config')
|
|
524
|
+
if (guard.kind !== 'game-cargo-bytes-config')
|
|
305
525
|
continue;
|
|
306
526
|
const ids = cargoIdsByGame.get(guard.address) ?? [];
|
|
307
527
|
ids.push(guard.cargoId);
|
|
@@ -319,23 +539,195 @@ async function checkPreconditions(context, preconditions, commitment) {
|
|
|
319
539
|
// Invocation-local only: every execution attempt still reads and decodes fresh state.
|
|
320
540
|
const cargoHashesByGame = new Map();
|
|
321
541
|
const validatedGames = new Set();
|
|
322
|
-
|
|
542
|
+
// One exact decode per fresh Game row, shared by every Game guard below.
|
|
543
|
+
const gameDecodes = new Map();
|
|
544
|
+
const profileFunding = new Map();
|
|
545
|
+
const fundedTargets = new Set();
|
|
546
|
+
const recordFunding = (guard, funding) => {
|
|
547
|
+
// Repeated guards for one action are assertions, not additional debits.
|
|
548
|
+
// Every guard still validates its own ceiling before reaching here.
|
|
549
|
+
const target = `${guard.kind}:${guard.address}`;
|
|
550
|
+
if (fundedTargets.has(target))
|
|
551
|
+
return;
|
|
552
|
+
fundedTargets.add(target);
|
|
553
|
+
const current = profileFunding.get(guard.profile);
|
|
554
|
+
profileFunding.set(guard.profile, {
|
|
555
|
+
debit: (current?.debit ?? 0n) + funding.profileDebit,
|
|
556
|
+
reserve: funding.profileReserve,
|
|
557
|
+
guard,
|
|
558
|
+
});
|
|
559
|
+
};
|
|
560
|
+
const fleetFailure = (guard, error) => {
|
|
561
|
+
// Only SDK diagnostics from this bounded validation batch are exposed.
|
|
562
|
+
// Never stringify provider/codec objects or retain their inner causes.
|
|
563
|
+
if (error instanceof SageSdkError &&
|
|
564
|
+
error.address !== undefined &&
|
|
565
|
+
requiredAddresses.has(error.address))
|
|
566
|
+
return new ActionPreconditionFailedError(guard, byAddress.get(error.address)?.slot, error.message, error.address);
|
|
567
|
+
return new ActionPreconditionFailedError(guard, undefined, 'Fleet prerequisites could not be validated. Refresh the related accounts and replan with a supported binding version.');
|
|
568
|
+
};
|
|
569
|
+
// A docking Plan from another deployment is reported as such before any
|
|
570
|
+
// freshness guard, whatever the saved guard order.
|
|
571
|
+
for (const precondition of preconditions)
|
|
572
|
+
if ((precondition.kind === 'fleet-dock-funding' ||
|
|
573
|
+
precondition.kind === 'fleet-docking-policy') &&
|
|
574
|
+
precondition.game !== requireGameAddress(context))
|
|
575
|
+
throw fleetFailure(precondition, new SageSdkError('ACTION_PRECONDITION_FAILED', precondition.kind === 'fleet-dock-funding'
|
|
576
|
+
? `The docking Plan belongs to Game ${precondition.game}, but the context uses Game ${requireGameAddress(context)}. Recreate it with the intended Game context.`
|
|
577
|
+
: 'The docking faction policy belongs to another Game. Recreate the Plan with the intended Game context.', { address: precondition.address }));
|
|
578
|
+
// Dependent docking estimates run after every other freshness guard, so an
|
|
579
|
+
// exact account-state or policy diagnostic wins whatever the saved order.
|
|
580
|
+
const ordered = [
|
|
581
|
+
...preconditions.filter((g) => g.kind !== 'fleet-dock-funding'),
|
|
582
|
+
...preconditions.filter((g) => g.kind === 'fleet-dock-funding'),
|
|
583
|
+
];
|
|
584
|
+
for (const precondition of ordered) {
|
|
323
585
|
const account = byAddress.get(precondition.address);
|
|
586
|
+
if (precondition.kind === 'fleet-dock-funding') {
|
|
587
|
+
try {
|
|
588
|
+
const funding = revalidateDockFunding(precondition, byAddress, precondition.status === 'available'
|
|
589
|
+
? decodeDockingSequences(byAddress.get(precondition.game), gameDecodes)
|
|
590
|
+
: undefined);
|
|
591
|
+
if (funding)
|
|
592
|
+
recordFunding(precondition, funding);
|
|
593
|
+
}
|
|
594
|
+
catch (error) {
|
|
595
|
+
throw fleetFailure(precondition, error);
|
|
596
|
+
}
|
|
597
|
+
continue;
|
|
598
|
+
}
|
|
599
|
+
if (precondition.kind === 'local-market-order') {
|
|
600
|
+
try {
|
|
601
|
+
if (precondition.game !== requireGameAddress(context))
|
|
602
|
+
throw new SageSdkError('ACTION_PRECONDITION_FAILED', 'The order belongs to another Game. Recreate it with the intended Game context.');
|
|
603
|
+
revalidateMarketOrder(precondition, byAddress, allPreconditions);
|
|
604
|
+
}
|
|
605
|
+
catch (error) {
|
|
606
|
+
const failedAddress = error instanceof SageSdkError ? error.address : undefined;
|
|
607
|
+
throw new ActionPreconditionFailedError(precondition, byAddress.get(failedAddress ?? precondition.address)?.slot, error instanceof SageSdkError
|
|
608
|
+
? error.message
|
|
609
|
+
: 'The Local Market debit bounds could not be verified. Refresh its funding accounts and recreate the order Plan.', failedAddress);
|
|
610
|
+
}
|
|
611
|
+
continue;
|
|
612
|
+
}
|
|
613
|
+
if (precondition.kind === 'scan-signal-open') {
|
|
614
|
+
if (precondition.game !== requireGameAddress(context))
|
|
615
|
+
throw new ActionPreconditionFailedError(precondition, undefined, 'This signal setup belongs to a different configured Game. Refetch and recreate the Plan using the intended Game context.');
|
|
616
|
+
try {
|
|
617
|
+
recordFunding(precondition, await validateOpenSignal(precondition, byAddress, precondition.authorityHash));
|
|
618
|
+
}
|
|
619
|
+
catch (error) {
|
|
620
|
+
throw fleetFailure(precondition, error);
|
|
621
|
+
}
|
|
622
|
+
continue;
|
|
623
|
+
}
|
|
624
|
+
if (precondition.kind === 'ship-import-funding') {
|
|
625
|
+
try {
|
|
626
|
+
const funding = validateShipImportFunding(precondition, importFundingAccounts.get(precondition), byAddress, precondition.maximumProfileDebit);
|
|
627
|
+
recordFunding(precondition, funding);
|
|
628
|
+
}
|
|
629
|
+
catch (error) {
|
|
630
|
+
throw fleetFailure(precondition, error);
|
|
631
|
+
}
|
|
632
|
+
continue;
|
|
633
|
+
}
|
|
634
|
+
if (precondition.kind === 'fleet-add-ship') {
|
|
635
|
+
try {
|
|
636
|
+
const game = byAddress.get(precondition.game);
|
|
637
|
+
let catalog = assemblyCatalogs.get(precondition.game);
|
|
638
|
+
if (!catalog && game) {
|
|
639
|
+
catalog = decodeGameShipAssemblyCatalog(game, gameDecodes);
|
|
640
|
+
assemblyCatalogs.set(precondition.game, catalog);
|
|
641
|
+
}
|
|
642
|
+
const funding = await validateFleetShipAssembly(precondition, fleetAssemblyAccounts.get(precondition), byAddress, precondition, catalog);
|
|
643
|
+
recordFunding(precondition, funding);
|
|
644
|
+
}
|
|
645
|
+
catch (error) {
|
|
646
|
+
throw fleetFailure(precondition, error);
|
|
647
|
+
}
|
|
648
|
+
continue;
|
|
649
|
+
}
|
|
650
|
+
if (precondition.kind === 'fleet-create') {
|
|
651
|
+
try {
|
|
652
|
+
const funding = await validateFleetCreation(precondition, fleetCreationAccounts.get(precondition), byAddress, precondition.maximumProfileDebit);
|
|
653
|
+
recordFunding(precondition, funding);
|
|
654
|
+
}
|
|
655
|
+
catch (error) {
|
|
656
|
+
throw fleetFailure(precondition, error);
|
|
657
|
+
}
|
|
658
|
+
continue;
|
|
659
|
+
}
|
|
660
|
+
if (precondition.kind === 'fleet-docking-policy') {
|
|
661
|
+
try {
|
|
662
|
+
await validateFleetDockingPolicy(account, byAddress.get(precondition.ownership), precondition);
|
|
663
|
+
}
|
|
664
|
+
catch (error) {
|
|
665
|
+
throw fleetFailure(precondition, error);
|
|
666
|
+
}
|
|
667
|
+
continue;
|
|
668
|
+
}
|
|
324
669
|
let narrowed = true;
|
|
670
|
+
let cause;
|
|
325
671
|
if (precondition.kind === 'token-account')
|
|
326
672
|
narrowed =
|
|
327
673
|
account !== undefined && matchesTokenAccount(account, precondition);
|
|
328
|
-
if (precondition.kind === '
|
|
674
|
+
if (precondition.kind === 'currency-cache' ||
|
|
675
|
+
precondition.kind === 'movement-character' ||
|
|
676
|
+
precondition.kind === 'starbase-system' ||
|
|
677
|
+
precondition.kind === 'fleet-mining' ||
|
|
678
|
+
isFactionTradeGuard(precondition) ||
|
|
679
|
+
precondition.kind === 'recipe-state' ||
|
|
680
|
+
precondition.kind === 'token-mint' ||
|
|
681
|
+
precondition.kind === 'game-ship-config' ||
|
|
329
682
|
precondition.kind === 'game-account' ||
|
|
330
|
-
precondition.kind === 'game-cargo-config' ||
|
|
683
|
+
precondition.kind === 'game-cargo-bytes-config' ||
|
|
331
684
|
precondition.kind === 'cargo-cache') {
|
|
332
685
|
try {
|
|
333
686
|
if (!account)
|
|
334
687
|
narrowed = false;
|
|
688
|
+
else if (precondition.kind === 'currency-cache') {
|
|
689
|
+
narrowed = precondition.game === requireGameAddress(context);
|
|
690
|
+
if (narrowed)
|
|
691
|
+
await validateCurrencyCache(account, precondition.game);
|
|
692
|
+
}
|
|
693
|
+
else if (precondition.kind === 'movement-character') {
|
|
694
|
+
narrowed =
|
|
695
|
+
precondition.game === requireGameAddress(context) &&
|
|
696
|
+
(await hashMovementCharacter(account, precondition)) ===
|
|
697
|
+
precondition.stateHash;
|
|
698
|
+
}
|
|
699
|
+
else if (precondition.kind === 'starbase-system') {
|
|
700
|
+
narrowed = precondition.game === requireGameAddress(context);
|
|
701
|
+
if (narrowed)
|
|
702
|
+
await validateStarbaseSystem(account, precondition);
|
|
703
|
+
}
|
|
704
|
+
else if (precondition.kind === 'fleet-mining') {
|
|
705
|
+
narrowed =
|
|
706
|
+
precondition.game === requireGameAddress(context) &&
|
|
707
|
+
(await matchesFleetMiningState(account, precondition));
|
|
708
|
+
}
|
|
709
|
+
else if (isFactionTradeGuard(precondition)) {
|
|
710
|
+
narrowed = await matchesFactionTradeState(account, precondition);
|
|
711
|
+
}
|
|
712
|
+
else if (precondition.kind === 'recipe-state') {
|
|
713
|
+
narrowed =
|
|
714
|
+
(await hashRecipeConfiguration(account)) ===
|
|
715
|
+
precondition.configHash;
|
|
716
|
+
if (narrowed)
|
|
717
|
+
validateRecipeUsage(account, precondition.requiredUses);
|
|
718
|
+
}
|
|
719
|
+
else if (precondition.kind === 'token-mint') {
|
|
720
|
+
narrowed = validateTokenMint(account) === precondition.decimals;
|
|
721
|
+
}
|
|
335
722
|
else if (precondition.kind === 'game-ship-config') {
|
|
336
723
|
let hashes = shipHashesByGame.get(precondition.address);
|
|
337
724
|
if (!hashes) {
|
|
338
|
-
|
|
725
|
+
let catalog = assemblyCatalogs.get(precondition.address);
|
|
726
|
+
if (!catalog && assemblyGames.has(precondition.address)) {
|
|
727
|
+
catalog = decodeGameShipAssemblyCatalog(account, gameDecodes);
|
|
728
|
+
assemblyCatalogs.set(precondition.address, catalog);
|
|
729
|
+
}
|
|
730
|
+
hashes = await hashGameShipConfigurations(account, shipIdsByGame.get(precondition.address), catalog, gameDecodes);
|
|
339
731
|
shipHashesByGame.set(precondition.address, hashes);
|
|
340
732
|
}
|
|
341
733
|
narrowed =
|
|
@@ -343,14 +735,20 @@ async function checkPreconditions(context, preconditions, commitment) {
|
|
|
343
735
|
}
|
|
344
736
|
else if (precondition.kind === 'game-account') {
|
|
345
737
|
if (!validatedGames.has(account.address)) {
|
|
346
|
-
|
|
738
|
+
if (assemblyGames.has(precondition.address)) {
|
|
739
|
+
if (!assemblyCatalogs.has(precondition.address))
|
|
740
|
+
assemblyCatalogs.set(precondition.address, decodeGameShipAssemblyCatalog(account, gameDecodes));
|
|
741
|
+
}
|
|
742
|
+
else
|
|
743
|
+
validateGameForCharacterRegistration(account, gameDecodes);
|
|
347
744
|
validatedGames.add(account.address);
|
|
348
745
|
}
|
|
349
746
|
}
|
|
350
|
-
else if (precondition.kind === 'game-cargo-config') {
|
|
747
|
+
else if (precondition.kind === 'game-cargo-bytes-config') {
|
|
351
748
|
let hashes = cargoHashesByGame.get(precondition.address);
|
|
352
749
|
if (!hashes) {
|
|
353
|
-
|
|
750
|
+
const ids = cargoIdsByGame.get(precondition.address);
|
|
751
|
+
hashes = await hashGameCargoConfigurationGuards(account, ids, gameDecodes);
|
|
354
752
|
cargoHashesByGame.set(precondition.address, hashes);
|
|
355
753
|
}
|
|
356
754
|
narrowed =
|
|
@@ -358,35 +756,43 @@ async function checkPreconditions(context, preconditions, commitment) {
|
|
|
358
756
|
}
|
|
359
757
|
else {
|
|
360
758
|
validateWalletCargoCache(account, precondition.game, precondition.bump);
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
seeds: [
|
|
364
|
-
new TextEncoder().encode('CargoDefinitionsCache'),
|
|
365
|
-
getAddressEncoder().encode(precondition.game),
|
|
366
|
-
],
|
|
367
|
-
});
|
|
759
|
+
// validateWalletCargoCache requires the SAGE owner.
|
|
760
|
+
const [canonical, bump] = await deriveCargoDefinitionsCacheAddress(precondition.game);
|
|
368
761
|
narrowed =
|
|
369
762
|
canonical === account.address && bump === precondition.bump;
|
|
370
763
|
}
|
|
371
764
|
}
|
|
372
|
-
catch {
|
|
765
|
+
catch (error) {
|
|
373
766
|
narrowed = false;
|
|
767
|
+
cause = guardCause(precondition, error);
|
|
374
768
|
}
|
|
375
769
|
}
|
|
376
770
|
if (!narrowed ||
|
|
377
771
|
(precondition.kind === 'token-account-or-absent' &&
|
|
378
772
|
account !== undefined &&
|
|
379
773
|
!matchesTokenAccount(account, precondition)) ||
|
|
774
|
+
(precondition.kind === 'system-account-or-absent' &&
|
|
775
|
+
account !== undefined &&
|
|
776
|
+
(account.owner !== '11111111111111111111111111111111' ||
|
|
777
|
+
account.executable ||
|
|
778
|
+
account.data.length !== 0)) ||
|
|
380
779
|
(precondition.kind === 'account-absent' && account !== undefined) ||
|
|
381
780
|
(precondition.kind === 'account-state' &&
|
|
382
781
|
(account === undefined ||
|
|
383
782
|
(await hashAccountState(account.owner, account.data)) !==
|
|
384
783
|
precondition.dataHash))) {
|
|
385
|
-
throw new ActionPreconditionFailedError(precondition, account?.slot);
|
|
784
|
+
throw new ActionPreconditionFailedError(precondition, account?.slot, cause);
|
|
386
785
|
}
|
|
387
786
|
}
|
|
787
|
+
for (const [profile, funding] of profileFunding) {
|
|
788
|
+
// Validation above guarantees a fresh Profile from the same finite batch.
|
|
789
|
+
const account = byAddress.get(profile);
|
|
790
|
+
if (account.lamports < funding.reserve + funding.debit)
|
|
791
|
+
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);
|
|
792
|
+
}
|
|
793
|
+
return registrationFunding;
|
|
388
794
|
}
|
|
389
|
-
function commitmentReached(actual, requested) {
|
|
795
|
+
export function commitmentReached(actual, requested) {
|
|
390
796
|
if (actual === null)
|
|
391
797
|
return false;
|
|
392
798
|
const strength = {
|
|
@@ -511,7 +917,9 @@ async function confirmTransaction(writeRpc, signature, lastValidBlockHeight, opt
|
|
|
511
917
|
}
|
|
512
918
|
}
|
|
513
919
|
}
|
|
514
|
-
async function signAndSubmit(writeRpc, transaction, signers, sendingSigner, commitment, lifecycle) {
|
|
920
|
+
async function signAndSubmit(writeRpc, transaction, contextSlot, signers, sendingSigner, commitment, lifecycle) {
|
|
921
|
+
// Capture RPC metadata before handing the transaction to any signer.
|
|
922
|
+
const { blockhash, lastValidBlockHeight: assembledHeight } = transaction.lifetimeConstraint;
|
|
515
923
|
await lifecycle?.onBeforeSign();
|
|
516
924
|
if (sendingSigner !== undefined) {
|
|
517
925
|
let enteredOpaqueSender = false;
|
|
@@ -520,7 +928,6 @@ async function signAndSubmit(writeRpc, transaction, signers, sendingSigner, comm
|
|
|
520
928
|
async signAndSendTransactions(transactions, config) {
|
|
521
929
|
for (const signed of transactions) {
|
|
522
930
|
assertPlanTransactionMessage(transaction, signed);
|
|
523
|
-
readFinalLastValidBlockHeight(signed);
|
|
524
931
|
}
|
|
525
932
|
await lifecycle?.onBeforeOpaqueInvoke();
|
|
526
933
|
enteredOpaqueSender = true;
|
|
@@ -546,8 +953,13 @@ async function signAndSubmit(writeRpc, transaction, signers, sendingSigner, comm
|
|
|
546
953
|
const signed = await signTransactionWithSigners(signingSigners, transaction);
|
|
547
954
|
assertPlanTransactionMessage(transaction, signed);
|
|
548
955
|
const signature = getSignatureFromTransaction(signed);
|
|
549
|
-
const lastValidBlockHeight =
|
|
550
|
-
|
|
956
|
+
const lastValidBlockHeight = 'blockhash' in signed.lifetimeConstraint &&
|
|
957
|
+
signed.lifetimeConstraint.blockhash === blockhash
|
|
958
|
+
? assembledHeight
|
|
959
|
+
: null;
|
|
960
|
+
await lifecycle?.onSigned(signature, lastValidBlockHeight === null
|
|
961
|
+
? null
|
|
962
|
+
: Object.freeze({ lastValidBlockHeight, contextSlot }));
|
|
551
963
|
await lifecycle?.onBeforeSubmit();
|
|
552
964
|
try {
|
|
553
965
|
const submittedSignature = await writeRpc
|
|
@@ -608,22 +1020,42 @@ export async function executePlanWithLifecycle(context, plan, options, lifecycle
|
|
|
608
1020
|
validatePlanAssemblyPolicy(plan, validated);
|
|
609
1021
|
const signers = matchSigners(plan, validated);
|
|
610
1022
|
const sendingSigner = resolveSendingSigner(signers);
|
|
611
|
-
const writeRpc = context
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
1023
|
+
const writeRpc = requireWriteRpc(context, 'execute');
|
|
1024
|
+
// Guard order is not trusted: funding follows instruction order, including hydrated Plans.
|
|
1025
|
+
const ordered = [...plan.preconditions].sort((a, b) => {
|
|
1026
|
+
const index = (guard) => guard.kind === 'character-registration'
|
|
1027
|
+
? plan.steps.findIndex((step) => step.instruction.accounts?.[2]?.address === guard.address)
|
|
1028
|
+
: -1;
|
|
1029
|
+
return index(a) - index(b);
|
|
1030
|
+
});
|
|
1031
|
+
const registrationFunding = await checkPreconditions(context, ordered, plan.steps, validated.commitment);
|
|
1032
|
+
const { transaction, contextSlot } = await assembleValidatedPlanWithContext(writeRpc, plan, {
|
|
616
1033
|
feePayer: validated.feePayer.address,
|
|
617
1034
|
commitment: validated.commitment,
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
: { computeUnitLimit: validated.computeUnitLimit }),
|
|
621
|
-
...(validated.priorityFeeMicroLamports === undefined
|
|
622
|
-
? {}
|
|
623
|
-
: { priorityFeeMicroLamports: validated.priorityFeeMicroLamports }),
|
|
1035
|
+
computeUnitLimit: validated.computeUnitLimit,
|
|
1036
|
+
priorityFeeMicroLamports: validated.priorityFeeMicroLamports,
|
|
624
1037
|
});
|
|
1038
|
+
if (registrationFunding.length > 0) {
|
|
1039
|
+
if (typeof writeRpc.getFeeForMessage !== 'function')
|
|
1040
|
+
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.');
|
|
1041
|
+
const payer = validated.feePayer.address;
|
|
1042
|
+
const { value: fee } = await writeRpc
|
|
1043
|
+
.getFeeForMessage(getBase64Decoder().decode(transaction.messageBytes), { commitment: validated.commitment })
|
|
1044
|
+
.send();
|
|
1045
|
+
if (typeof fee !== 'bigint' || fee < 0n)
|
|
1046
|
+
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 });
|
|
1047
|
+
if (!registrationFunding.some((funding) => funding.funder === payer)) {
|
|
1048
|
+
const [account, rent] = await readContextRawAccounts(context, [payer, RENT_ADDRESS], { commitment: validated.commitment });
|
|
1049
|
+
if (!account || !isEmptySystemAccount(account) || !rent)
|
|
1050
|
+
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 });
|
|
1051
|
+
const remaining = account.lamports - fee;
|
|
1052
|
+
if (remaining < 0n || (remaining > 0n && remaining < readRent(rent)(0)))
|
|
1053
|
+
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 });
|
|
1054
|
+
}
|
|
1055
|
+
checkRegistrationFunding(registrationFunding, { payer, lamports: fee });
|
|
1056
|
+
}
|
|
625
1057
|
await lifecycle?.onPrepared(sendingSigner === undefined ? 'observable' : 'opaque');
|
|
626
|
-
const submission = await signAndSubmit(writeRpc, transaction, signers, sendingSigner, validated.commitment, lifecycle);
|
|
1058
|
+
const submission = await signAndSubmit(writeRpc, transaction, contextSlot, signers, sendingSigner, validated.commitment, lifecycle);
|
|
627
1059
|
if (submission.status === 'unknown')
|
|
628
1060
|
return submission;
|
|
629
1061
|
const result = await confirmTransaction(writeRpc, submission.signature, submission.lastValidBlockHeight, validated);
|