@aephia/atlas-kit 0.6.0-next.8 → 0.6.0-next.81
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 +1 -1
- package/dist/cargo/actions/deposit.d.ts.map +1 -1
- package/dist/cargo/actions/deposit.js +25 -12
- package/dist/cargo/actions/deposit.js.map +1 -1
- package/dist/cargo/actions/index.d.ts.map +1 -1
- package/dist/cargo/actions/index.js +3 -2
- package/dist/cargo/actions/index.js.map +1 -1
- package/dist/cargo/actions/wallet-token.d.ts +1 -1
- package/dist/cargo/actions/wallet-token.d.ts.map +1 -1
- package/dist/cargo/actions/wallet-token.js +1 -9
- package/dist/cargo/actions/wallet-token.js.map +1 -1
- package/dist/cargo/actions/withdrawal.d.ts.map +1 -1
- package/dist/cargo/actions/withdrawal.js +22 -10
- package/dist/cargo/actions/withdrawal.js.map +1 -1
- package/dist/claim-stakes/actions/index.d.ts +13 -0
- package/dist/claim-stakes/actions/index.d.ts.map +1 -1
- package/dist/claim-stakes/actions/index.js +95 -44
- 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 +23 -2
- 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 +1 -0
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +1 -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.map +1 -1
- package/dist/combat/actions/index.js +98 -50
- package/dist/combat/actions/index.js.map +1 -1
- package/dist/crafting/actions/index.d.ts +11 -0
- package/dist/crafting/actions/index.d.ts.map +1 -1
- package/dist/crafting/actions/index.js +60 -29
- package/dist/crafting/actions/index.js.map +1 -1
- package/dist/crafting/index.d.ts +31 -2
- package/dist/crafting/index.d.ts.map +1 -1
- package/dist/crafting/index.js +41 -14
- package/dist/crafting/index.js.map +1 -1
- package/dist/factions/actions/index.d.ts +1 -0
- package/dist/factions/actions/index.d.ts.map +1 -1
- 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 +14 -8
- 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 +149 -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 +138 -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 +114 -0
- package/dist/fleets/actions/crew-transfer.js.map +1 -0
- package/dist/fleets/actions/index.d.ts +33 -15
- package/dist/fleets/actions/index.d.ts.map +1 -1
- package/dist/fleets/actions/index.js +168 -110
- 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 +122 -0
- package/dist/fleets/actions/respawn.js.map +1 -0
- package/dist/fleets/actions/ship-import.d.ts.map +1 -1
- package/dist/fleets/actions/ship-import.js +37 -11
- 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 +34 -0
- package/dist/fleets/index.d.ts.map +1 -1
- package/dist/fleets/index.js +51 -2
- 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/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 +56 -0
- package/dist/identity/actions/create-profile.d.ts.map +1 -0
- package/dist/identity/actions/create-profile.js +139 -0
- package/dist/identity/actions/create-profile.js.map +1 -0
- package/dist/identity/actions/index.d.ts +4 -3
- package/dist/identity/actions/index.d.ts.map +1 -1
- package/dist/identity/actions/index.js +49 -27
- package/dist/identity/actions/index.js.map +1 -1
- package/dist/identity/index.d.ts +15 -0
- package/dist/identity/index.d.ts.map +1 -1
- package/dist/identity/index.js +15 -0
- package/dist/identity/index.js.map +1 -1
- package/dist/identity/permissions.d.ts +124 -0
- package/dist/identity/permissions.d.ts.map +1 -0
- package/dist/identity/permissions.js +171 -0
- package/dist/identity/permissions.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/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/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/claim-stake.d.ts +4 -27
- package/dist/internal/c4/claim-stake.d.ts.map +1 -1
- package/dist/internal/c4/claim-stake.js +25 -38
- package/dist/internal/c4/claim-stake.js.map +1 -1
- package/dist/internal/c4/combat.d.ts +0 -27
- package/dist/internal/c4/combat.d.ts.map +1 -1
- package/dist/internal/c4/combat.js +0 -33
- 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 +11 -31
- package/dist/internal/c4/crafting.d.ts.map +1 -1
- package/dist/internal/c4/crafting.js +26 -43
- package/dist/internal/c4/crafting.js.map +1 -1
- package/dist/internal/c4/faction-adapter.d.ts +12 -0
- package/dist/internal/c4/faction-adapter.d.ts.map +1 -0
- package/dist/internal/c4/faction-adapter.js +52 -0
- package/dist/internal/c4/faction-adapter.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 +31 -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 +48 -0
- package/dist/internal/c4/faction-treasury.js.map +1 -0
- package/dist/internal/c4/factions.d.ts +9 -57
- package/dist/internal/c4/factions.d.ts.map +1 -1
- package/dist/internal/c4/factions.js +21 -139
- 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 +180 -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 +15 -0
- package/dist/internal/c4/fleet-crew-binding.js.map +1 -1
- package/dist/internal/c4/fleet-respawn.d.ts +19 -0
- package/dist/internal/c4/fleet-respawn.d.ts.map +1 -0
- package/dist/internal/c4/fleet-respawn.js +91 -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 +45 -19
- package/dist/internal/c4/fleet.d.ts.map +1 -1
- package/dist/internal/c4/fleet.js +26 -7
- package/dist/internal/c4/fleet.js.map +1 -1
- package/dist/internal/c4/game.d.ts +27 -9
- package/dist/internal/c4/game.d.ts.map +1 -1
- package/dist/internal/c4/game.js +77 -14
- package/dist/internal/c4/game.js.map +1 -1
- package/dist/internal/c4/identity.d.ts +4 -8
- package/dist/internal/c4/identity.d.ts.map +1 -1
- package/dist/internal/c4/identity.js +3 -24
- package/dist/internal/c4/identity.js.map +1 -1
- package/dist/internal/c4/local-market-order.d.ts +2 -0
- package/dist/internal/c4/local-market-order.d.ts.map +1 -0
- package/dist/internal/c4/local-market-order.js +4 -0
- package/dist/internal/c4/local-market-order.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 +0 -33
- 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 +13 -51
- 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/profile-creation.d.ts +17 -0
- package/dist/internal/c4/profile-creation.d.ts.map +1 -0
- package/dist/internal/c4/profile-creation.js +36 -0
- package/dist/internal/c4/profile-creation.js.map +1 -0
- package/dist/internal/c4/profile-permissions.d.ts +14 -0
- package/dist/internal/c4/profile-permissions.d.ts.map +1 -0
- package/dist/internal/c4/profile-permissions.js +81 -0
- package/dist/internal/c4/profile-permissions.js.map +1 -0
- 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 +0 -27
- package/dist/internal/c4/rewards.d.ts.map +1 -1
- package/dist/internal/c4/rewards.js +0 -33
- package/dist/internal/c4/rewards.js.map +1 -1
- package/dist/internal/c4/runtime-bindings.d.ts +3 -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 +258 -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 +2 -33
- 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 +25 -21
- 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 +3 -41
- package/dist/internal/c4/starbase.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 +58 -25
- 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/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 +20 -0
- package/dist/internal/planning/arrival-guards.d.ts.map +1 -0
- package/dist/internal/planning/arrival-guards.js +187 -0
- package/dist/internal/planning/arrival-guards.js.map +1 -0
- package/dist/internal/planning/authorization-adapter.d.ts +6 -6
- package/dist/internal/planning/authorization-adapter.d.ts.map +1 -1
- package/dist/internal/planning/authorization-adapter.js +81 -16
- 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 +58 -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 +86 -0
- package/dist/internal/planning/character-registration.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 +198 -0
- package/dist/internal/planning/democracy-history.js.map +1 -0
- 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 +105 -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 +110 -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 +107 -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 +47 -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 +131 -0
- package/dist/internal/planning/fleet-crew-transfer.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 +136 -0
- package/dist/internal/planning/fleet-ship-assembly.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 +239 -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 +123 -0
- package/dist/internal/planning/local-market-order-funding.js.map +1 -0
- package/dist/internal/planning/local-market-order.d.ts +42 -0
- package/dist/internal/planning/local-market-order.d.ts.map +1 -0
- package/dist/internal/planning/local-market-order.js +192 -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 +41 -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 +103 -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 +31 -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 +84 -0
- package/dist/internal/planning/open-signal.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 +41 -0
- package/dist/internal/planning/respawn-guards.js.map +1 -0
- package/dist/internal/planning/runtime-guards.d.ts +43 -0
- package/dist/internal/planning/runtime-guards.d.ts.map +1 -0
- package/dist/internal/planning/runtime-guards.js +636 -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 +94 -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 +196 -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 +244 -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 +52 -0
- package/dist/internal/planning/ship-import-funding.js.map +1 -0
- package/dist/internal/planning/ship-token.d.ts.map +1 -1
- package/dist/internal/planning/ship-token.js +2 -4
- package/dist/internal/planning/ship-token.js.map +1 -1
- 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 +93 -0
- package/dist/internal/planning/starbase-system-guard.js.map +1 -0
- package/dist/internal/planning/starbase-system.d.ts +12 -0
- package/dist/internal/planning/starbase-system.d.ts.map +1 -0
- package/dist/internal/planning/starbase-system.js +22 -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 +15 -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/xp-runtime.d.ts +36 -0
- package/dist/internal/planning/xp-runtime.d.ts.map +1 -0
- package/dist/internal/planning/xp-runtime.js +126 -0
- package/dist/internal/planning/xp-runtime.js.map +1 -0
- package/dist/loyalty/actions/index.d.ts.map +1 -1
- package/dist/loyalty/actions/index.js +4 -3
- package/dist/loyalty/actions/index.js.map +1 -1
- package/dist/loyalty/index.d.ts.map +1 -1
- package/dist/loyalty/index.js +2 -6
- package/dist/loyalty/index.js.map +1 -1
- package/dist/markets/actions/index.d.ts +58 -3
- package/dist/markets/actions/index.d.ts.map +1 -1
- package/dist/markets/actions/index.js +133 -25
- 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 +291 -0
- package/dist/markets/actions/trade-faction-market.js.map +1 -0
- package/dist/markets/index.d.ts +7 -7
- package/dist/markets/index.d.ts.map +1 -1
- package/dist/markets/index.js +9 -9
- package/dist/markets/index.js.map +1 -1
- package/dist/mining/actions/index.d.ts +84 -0
- package/dist/mining/actions/index.d.ts.map +1 -0
- package/dist/mining/actions/index.js +328 -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 +8 -2
- package/dist/mining/index.d.ts.map +1 -1
- package/dist/mining/index.js +6 -2
- package/dist/mining/index.js.map +1 -1
- package/dist/planning/assembly.d.ts.map +1 -1
- package/dist/planning/assembly.js +20 -0
- package/dist/planning/assembly.js.map +1 -1
- package/dist/planning/execution.d.ts.map +1 -1
- package/dist/planning/execution.js +405 -16
- package/dist/planning/execution.js.map +1 -1
- package/dist/planning/index.d.ts +171 -149
- package/dist/planning/index.d.ts.map +1 -1
- package/dist/planning/index.js +837 -121
- package/dist/planning/index.js.map +1 -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/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 +6 -11
- package/dist/registry/cargo.d.ts.map +1 -1
- package/dist/registry/cargo.js +19 -19
- package/dist/registry/cargo.js.map +1 -1
- package/dist/registry/index.d.ts +4 -0
- package/dist/registry/index.d.ts.map +1 -1
- package/dist/registry/index.js.map +1 -1
- package/dist/registry/onboarding.d.ts +8 -1
- package/dist/registry/onboarding.d.ts.map +1 -1
- package/dist/registry/onboarding.js +18 -5
- 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 +28 -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/scanning/actions/index.d.ts +116 -0
- package/dist/scanning/actions/index.d.ts.map +1 -0
- package/dist/scanning/actions/index.js +185 -0
- package/dist/scanning/actions/index.js.map +1 -0
- package/dist/scanning/index.d.ts +4 -1
- package/dist/scanning/index.d.ts.map +1 -1
- package/dist/scanning/index.js +12 -8
- 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/world/index.d.ts +110 -5
- package/dist/world/index.d.ts.map +1 -1
- package/dist/world/index.js +109 -4
- 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,7 +1,29 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { revalidateMarketOrder, marketOrderFundingAddresses, } from '../internal/planning/local-market-order-funding.js';
|
|
2
|
+
import { resolveFleetCrewTransfer } from '../internal/planning/fleet-crew-transfer.js';
|
|
3
|
+
import { revalidateScanCompletion } from '../internal/planning/scan-completion.js';
|
|
4
|
+
import { openSignalAddresses, validateOpenSignal, } from '../internal/planning/open-signal.js';
|
|
5
|
+
import { revalidateDetect } from '../internal/planning/scan-detect.js';
|
|
6
|
+
import { resolveFleetRespawn } from '../internal/planning/fleet-respawn.js';
|
|
7
|
+
import { validateFleetAttackActors } from '../internal/planning/fleet-attack-xp.js';
|
|
8
|
+
import { RENT_ADDRESS, readRent, } from '../internal/planning/faction-enrollment.js';
|
|
9
|
+
import { getBase64Decoder, } from '@solana/kit';
|
|
10
|
+
import { hashMovementCharacter } from '../internal/planning/movement-character.js';
|
|
11
|
+
import { validateStarbaseSystem } from '../internal/planning/starbase-system.js';
|
|
12
|
+
import { revalidateCharacterRegistration, isEmptySystemAccount, } from '../internal/planning/character-registration.js';
|
|
13
|
+
import { validateFleetArrivalIntent } from '../internal/planning/fleet-arrival.js';
|
|
14
|
+
import { isRuntimeGuard, revalidateRuntimeGuards, } from '../internal/planning/runtime-guards.js';
|
|
15
|
+
import { isFactionTradeGuard } from '../internal/planning/faction-trade-guards.js';
|
|
16
|
+
import { resolveShipImportFunding, validateShipImportFunding, } from '../internal/planning/ship-import-funding.js';
|
|
17
|
+
import { matchesFleetMiningState } from '../internal/planning/mining-stop.js';
|
|
18
|
+
import { requireGameAddress } from '../internal/game-context.js';
|
|
19
|
+
import { matchesFactionTradeState } from '../internal/planning/faction-trade-state.js';
|
|
20
|
+
import { resolveFleetShipAssembly, validateFleetShipAssembly, } from '../internal/planning/fleet-ship-assembly.js';
|
|
21
|
+
import { resolveFleetCreation, validateFleetCreation, } from '../internal/planning/fleet-creation.js';
|
|
22
|
+
import { validateTokenMint } from '../internal/planning/token-mint.js';
|
|
23
|
+
import { hashGameShipConfigurations, decodeGameShipAssemblyCatalog, } from '../registry/ships.js';
|
|
2
24
|
import { validateGameForCharacterRegistration } from '../registry/onboarding.js';
|
|
3
25
|
import { hashAccountState } from '../internal/planning/account-state.js';
|
|
4
|
-
import {
|
|
26
|
+
import { hashGameCargoConfigurationGuards } from '../registry/cargo.js';
|
|
5
27
|
import { validateWalletCargoCache } from '../internal/c4/wallet-cargo-cache.js';
|
|
6
28
|
import { getAddressEncoder, getProgramDerivedAddress, getAddressDecoder, getBase58Decoder, getBase64EncodedWireTransaction, getSignatureFromTransaction, isAddress, isTransactionModifyingSigner, isTransactionPartialSigner, isTransactionSendingSigner, signAndSendTransactionWithSigners, signTransactionWithSigners, } from '@solana/kit';
|
|
7
29
|
import { InvalidActionInputError, SageSdkError } from '../client/errors.js';
|
|
@@ -36,12 +58,23 @@ class MissingWriteTransportError extends SageSdkError {
|
|
|
36
58
|
class ActionPreconditionFailedError extends SageSdkError {
|
|
37
59
|
describes;
|
|
38
60
|
observedSlot;
|
|
39
|
-
constructor(precondition, observedSlot) {
|
|
40
|
-
super('ACTION_PRECONDITION_FAILED', `The account state required by this Plan changed at ${
|
|
61
|
+
constructor(precondition, observedSlot, cause, address = precondition.address) {
|
|
62
|
+
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
63
|
this.describes = precondition.describes;
|
|
42
64
|
this.observedSlot = observedSlot;
|
|
43
65
|
}
|
|
44
66
|
}
|
|
67
|
+
/** The cause a wrapped guard failure may carry: only a validator's own
|
|
68
|
+
* precondition cause and remedy for the guarded address. Adapter, provider and
|
|
69
|
+
* unknown failures yield `undefined`, so the wrapper falls back to the guard's
|
|
70
|
+
* generic description and never concatenates inner exception text. */
|
|
71
|
+
function guardCause(precondition, error) {
|
|
72
|
+
return error instanceof SageSdkError &&
|
|
73
|
+
error.code === 'ACTION_PRECONDITION_FAILED' &&
|
|
74
|
+
(error.address === undefined || error.address === precondition.address)
|
|
75
|
+
? error.message
|
|
76
|
+
: undefined;
|
|
77
|
+
}
|
|
45
78
|
class TransactionExpiredError extends SageSdkError {
|
|
46
79
|
signature;
|
|
47
80
|
lastValidBlockHeight;
|
|
@@ -293,15 +326,207 @@ function matchesTokenAccount(account, expected) {
|
|
|
293
326
|
return (decoder.decode(account.data.subarray(0, 32)) === expected.mint &&
|
|
294
327
|
decoder.decode(account.data.subarray(32, 64)) === expected.owner);
|
|
295
328
|
}
|
|
296
|
-
|
|
297
|
-
const
|
|
329
|
+
function checkRegistrationFunding(registrations, fee) {
|
|
330
|
+
const balances = new Map();
|
|
331
|
+
for (const registration of registrations) {
|
|
332
|
+
const previous = balances.get(registration.funder);
|
|
333
|
+
if (previous === undefined || registration.observedLamports < previous)
|
|
334
|
+
balances.set(registration.funder, registration.observedLamports);
|
|
335
|
+
}
|
|
336
|
+
if (fee && balances.has(fee.payer))
|
|
337
|
+
balances.set(fee.payer, balances.get(fee.payer) - fee.lamports);
|
|
338
|
+
for (const registration of registrations) {
|
|
339
|
+
const balance = balances.get(registration.funder);
|
|
340
|
+
if (balance < registration.requiredLamports)
|
|
341
|
+
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 });
|
|
342
|
+
balances.set(registration.funder, balance - registration.netDebit);
|
|
343
|
+
}
|
|
344
|
+
if (fee)
|
|
345
|
+
for (const registration of registrations) {
|
|
346
|
+
const balance = balances.get(registration.funder);
|
|
347
|
+
if (balance !== 0n && balance < registration.minimumBalance)
|
|
348
|
+
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 });
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
async function checkPreconditions(context, allPreconditions, steps, commitment) {
|
|
352
|
+
for (const guard of allPreconditions) {
|
|
353
|
+
if (guard.kind === 'fleet-crew-transfer') {
|
|
354
|
+
try {
|
|
355
|
+
await resolveFleetCrewTransfer(context, guard, guard, commitment);
|
|
356
|
+
}
|
|
357
|
+
catch (error) {
|
|
358
|
+
throw new ActionPreconditionFailedError(guard, undefined, error instanceof SageSdkError
|
|
359
|
+
? error.message
|
|
360
|
+
: 'Crew transfer prerequisites could not be verified. Refresh crew state and recreate the Plan.');
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
if (guard.kind === 'scan-completion')
|
|
364
|
+
await revalidateScanCompletion(context, guard, commitment);
|
|
365
|
+
if (guard.kind === 'scan-detect')
|
|
366
|
+
await revalidateDetect(context, guard, commitment);
|
|
367
|
+
if (guard.kind === 'fleet-attack') {
|
|
368
|
+
try {
|
|
369
|
+
await validateFleetAttackActors(context, guard);
|
|
370
|
+
}
|
|
371
|
+
catch (error) {
|
|
372
|
+
throw new ActionPreconditionFailedError(guard, undefined, guardCause(guard, error) ??
|
|
373
|
+
'The attacking or defending Fleet or Character could not be verified. Refresh both Fleets and their Characters, then recreate the Plan before signing.');
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
for (const guard of allPreconditions) {
|
|
378
|
+
if (guard.kind !== 'fleet-respawn')
|
|
379
|
+
continue;
|
|
380
|
+
try {
|
|
381
|
+
const current = await resolveFleetRespawn(context, { ...guard, fleet: guard.address }, guard, commitment);
|
|
382
|
+
const planned = steps[0].instruction;
|
|
383
|
+
const fresh = current.instruction;
|
|
384
|
+
if (planned.programAddress !== fresh.programAddress ||
|
|
385
|
+
planned.data?.length !== fresh.data?.length ||
|
|
386
|
+
fresh.data?.some((v, i) => planned.data?.[i] !== v) ||
|
|
387
|
+
planned.accounts?.length !== fresh.accounts?.length ||
|
|
388
|
+
fresh.accounts?.some((a, i) => planned.accounts?.[i]?.address !== a.address ||
|
|
389
|
+
planned.accounts?.[i]?.role !== a.role))
|
|
390
|
+
throw new SageSdkError('ACTION_PRECONDITION_FAILED', 'Recovery instruction accounts changed. Recreate and inspect the recovery Plan before signing.');
|
|
391
|
+
}
|
|
392
|
+
catch (error) {
|
|
393
|
+
throw new ActionPreconditionFailedError(guard, undefined, error instanceof SageSdkError
|
|
394
|
+
? error.message
|
|
395
|
+
: 'Recovery prerequisites could not be validated. Refresh the Fleet and recreate the Plan.');
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
const checkedXp = new Set();
|
|
399
|
+
const freshGameVersions = new Map();
|
|
400
|
+
const registrationFunding = [];
|
|
401
|
+
const initializations = new Map();
|
|
402
|
+
for (const guard of allPreconditions) {
|
|
403
|
+
if (guard.kind !== 'character-registration')
|
|
404
|
+
continue;
|
|
405
|
+
registrationFunding.push(await revalidateCharacterRegistration(context, guard, commitment, freshGameVersions, initializations));
|
|
406
|
+
}
|
|
407
|
+
checkRegistrationFunding(registrationFunding);
|
|
408
|
+
for (const guard of allPreconditions) {
|
|
409
|
+
if (guard.kind !== 'fleet-arrival')
|
|
410
|
+
continue;
|
|
411
|
+
try {
|
|
412
|
+
const current = await validateFleetArrivalIntent(context, guard.intent, freshGameVersions);
|
|
413
|
+
for (const xp of allPreconditions) {
|
|
414
|
+
if (xp.kind !== 'xp-runtime' ||
|
|
415
|
+
xp.intent.game !== current.xp.intent.game ||
|
|
416
|
+
xp.intent.character !== current.xp.intent.character ||
|
|
417
|
+
xp.intent.structure !== current.xp.intent.structure ||
|
|
418
|
+
(xp.intent.profile !== undefined &&
|
|
419
|
+
xp.intent.profile !== current.intent.profile))
|
|
420
|
+
continue;
|
|
421
|
+
if (['xpBudget', 'xpBudgetConfig', 'xpAccrual'].some((key) => xp.accounts[key] !== current.xp.accounts[key]))
|
|
422
|
+
throw new SageSdkError('ACTION_PRECONDITION_FAILED', 'Arrival XP runtime changed. Refresh the Fleet and recreate the Plan.');
|
|
423
|
+
checkedXp.add(xp);
|
|
424
|
+
}
|
|
425
|
+
if (current.character !== guard.character ||
|
|
426
|
+
current.regionTracker !== guard.regionTracker)
|
|
427
|
+
throw new SageSdkError('ACTION_PRECONDITION_FAILED', 'Arrival account links changed. Refresh the Fleet and recreate the Plan.');
|
|
428
|
+
}
|
|
429
|
+
catch (error) {
|
|
430
|
+
throw new ActionPreconditionFailedError(guard, undefined, error instanceof SageSdkError
|
|
431
|
+
? error.message
|
|
432
|
+
: 'Arrival prerequisites could not be validated. Refresh the Fleet and recreate the Plan.');
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
await revalidateRuntimeGuards(context, allPreconditions
|
|
436
|
+
.filter(isRuntimeGuard)
|
|
437
|
+
.filter((guard) => !checkedXp.has(guard)), freshGameVersions);
|
|
438
|
+
const preconditions = allPreconditions.filter((guard) => !isRuntimeGuard(guard) &&
|
|
439
|
+
guard.kind !== 'fleet-attack' &&
|
|
440
|
+
guard.kind !== 'fleet-arrival' &&
|
|
441
|
+
guard.kind !== 'character-registration' &&
|
|
442
|
+
guard.kind !== 'scan-detect' &&
|
|
443
|
+
guard.kind !== 'scan-completion' &&
|
|
444
|
+
guard.kind !== 'fleet-respawn' &&
|
|
445
|
+
guard.kind !== 'fleet-crew-transfer');
|
|
446
|
+
const fleetCreationAccounts = new Map();
|
|
447
|
+
const fleetAssemblyAccounts = new Map();
|
|
448
|
+
const importFundingAccounts = new Map();
|
|
449
|
+
const assemblyGames = new Set();
|
|
450
|
+
const assemblyCatalogs = new Map();
|
|
451
|
+
const requiredAddresses = new Set(preconditions.map(({ address }) => address));
|
|
452
|
+
for (const guard of preconditions) {
|
|
453
|
+
if (guard.kind === 'local-market-order' && guard.status === 'available') {
|
|
454
|
+
for (const address of [
|
|
455
|
+
guard.character,
|
|
456
|
+
guard.starbasePlayer,
|
|
457
|
+
...marketOrderFundingAddresses(guard.profile, allPreconditions),
|
|
458
|
+
])
|
|
459
|
+
requiredAddresses.add(address);
|
|
460
|
+
}
|
|
461
|
+
if (guard.kind === 'scan-signal-open') {
|
|
462
|
+
for (const address of openSignalAddresses(guard))
|
|
463
|
+
requiredAddresses.add(address);
|
|
464
|
+
}
|
|
465
|
+
if (guard.kind !== 'fleet-create')
|
|
466
|
+
continue;
|
|
467
|
+
const resolved = await resolveFleetCreation(guard);
|
|
468
|
+
if (resolved.fleet !== guard.address)
|
|
469
|
+
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.');
|
|
470
|
+
fleetCreationAccounts.set(guard, resolved);
|
|
471
|
+
for (const address of [
|
|
472
|
+
resolved.game,
|
|
473
|
+
resolved.profile,
|
|
474
|
+
resolved.system,
|
|
475
|
+
resolved.character,
|
|
476
|
+
resolved.profileFaction,
|
|
477
|
+
resolved.starbasePlayer,
|
|
478
|
+
resolved.fleet,
|
|
479
|
+
resolved.rent,
|
|
480
|
+
resolved.clock,
|
|
481
|
+
])
|
|
482
|
+
requiredAddresses.add(address);
|
|
483
|
+
}
|
|
484
|
+
for (const guard of preconditions) {
|
|
485
|
+
if (guard.kind !== 'fleet-add-ship')
|
|
486
|
+
continue;
|
|
487
|
+
const resolved = await resolveFleetShipAssembly(guard);
|
|
488
|
+
fleetAssemblyAccounts.set(guard, resolved);
|
|
489
|
+
assemblyGames.add(resolved.game);
|
|
490
|
+
for (const address of [
|
|
491
|
+
resolved.game,
|
|
492
|
+
resolved.profile,
|
|
493
|
+
resolved.system,
|
|
494
|
+
resolved.character,
|
|
495
|
+
resolved.profileFaction,
|
|
496
|
+
resolved.starbasePlayer,
|
|
497
|
+
resolved.fleet,
|
|
498
|
+
resolved.rent,
|
|
499
|
+
resolved.clock,
|
|
500
|
+
])
|
|
501
|
+
requiredAddresses.add(address);
|
|
502
|
+
}
|
|
503
|
+
for (const guard of preconditions) {
|
|
504
|
+
if (guard.kind !== 'ship-import-funding')
|
|
505
|
+
continue;
|
|
506
|
+
let resolved;
|
|
507
|
+
try {
|
|
508
|
+
resolved = await resolveShipImportFunding(guard);
|
|
509
|
+
}
|
|
510
|
+
catch {
|
|
511
|
+
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.');
|
|
512
|
+
}
|
|
513
|
+
importFundingAccounts.set(guard, resolved);
|
|
514
|
+
for (const address of [
|
|
515
|
+
resolved.profile,
|
|
516
|
+
resolved.character,
|
|
517
|
+
resolved.starbasePlayer,
|
|
518
|
+
resolved.rent,
|
|
519
|
+
])
|
|
520
|
+
requiredAddresses.add(address);
|
|
521
|
+
}
|
|
522
|
+
const addresses = [...requiredAddresses];
|
|
298
523
|
const accounts = await readContextRawAccounts(context, addresses, {
|
|
299
524
|
commitment,
|
|
300
525
|
});
|
|
301
526
|
const byAddress = new Map(addresses.map((address, index) => [address, accounts[index]]));
|
|
302
527
|
const cargoIdsByGame = new Map();
|
|
303
528
|
for (const guard of preconditions) {
|
|
304
|
-
if (guard.kind !== 'game-cargo-config')
|
|
529
|
+
if (guard.kind !== 'game-cargo-bytes-config')
|
|
305
530
|
continue;
|
|
306
531
|
const ids = cargoIdsByGame.get(guard.address) ?? [];
|
|
307
532
|
ids.push(guard.cargoId);
|
|
@@ -319,23 +544,142 @@ async function checkPreconditions(context, preconditions, commitment) {
|
|
|
319
544
|
// Invocation-local only: every execution attempt still reads and decodes fresh state.
|
|
320
545
|
const cargoHashesByGame = new Map();
|
|
321
546
|
const validatedGames = new Set();
|
|
547
|
+
const profileFunding = new Map();
|
|
548
|
+
const fundedTargets = new Set();
|
|
549
|
+
const recordFunding = (guard, funding) => {
|
|
550
|
+
// Repeated guards for one action are assertions, not additional debits.
|
|
551
|
+
// Every guard still validates its own ceiling before reaching here.
|
|
552
|
+
const target = `${guard.kind}:${guard.address}`;
|
|
553
|
+
if (fundedTargets.has(target))
|
|
554
|
+
return;
|
|
555
|
+
fundedTargets.add(target);
|
|
556
|
+
const current = profileFunding.get(guard.profile);
|
|
557
|
+
profileFunding.set(guard.profile, {
|
|
558
|
+
debit: (current?.debit ?? 0n) + funding.profileDebit,
|
|
559
|
+
reserve: funding.profileReserve,
|
|
560
|
+
guard,
|
|
561
|
+
});
|
|
562
|
+
};
|
|
563
|
+
const fleetFailure = (guard, error) => {
|
|
564
|
+
// Only SDK diagnostics from this bounded validation batch are exposed.
|
|
565
|
+
// Never stringify provider/codec objects or retain their inner causes.
|
|
566
|
+
if (error instanceof SageSdkError &&
|
|
567
|
+
error.address !== undefined &&
|
|
568
|
+
requiredAddresses.has(error.address))
|
|
569
|
+
return new ActionPreconditionFailedError(guard, byAddress.get(error.address)?.slot, error.message, error.address);
|
|
570
|
+
return new ActionPreconditionFailedError(guard, undefined, 'Fleet prerequisites could not be validated. Refresh the related accounts and replan with a supported binding version.');
|
|
571
|
+
};
|
|
322
572
|
for (const precondition of preconditions) {
|
|
323
573
|
const account = byAddress.get(precondition.address);
|
|
574
|
+
if (precondition.kind === 'local-market-order') {
|
|
575
|
+
try {
|
|
576
|
+
if (precondition.game !== requireGameAddress(context))
|
|
577
|
+
throw new SageSdkError('ACTION_PRECONDITION_FAILED', 'The order belongs to another Game. Recreate it with the intended Game context.');
|
|
578
|
+
revalidateMarketOrder(precondition, byAddress, allPreconditions);
|
|
579
|
+
}
|
|
580
|
+
catch (error) {
|
|
581
|
+
const failedAddress = error instanceof SageSdkError ? error.address : undefined;
|
|
582
|
+
throw new ActionPreconditionFailedError(precondition, byAddress.get(failedAddress ?? precondition.address)?.slot, error instanceof SageSdkError
|
|
583
|
+
? error.message
|
|
584
|
+
: 'The Local Market debit bounds could not be verified. Refresh its funding accounts and recreate the order Plan.', failedAddress);
|
|
585
|
+
}
|
|
586
|
+
continue;
|
|
587
|
+
}
|
|
588
|
+
if (precondition.kind === 'scan-signal-open') {
|
|
589
|
+
if (precondition.game !== requireGameAddress(context))
|
|
590
|
+
throw new ActionPreconditionFailedError(precondition, undefined, 'This signal setup belongs to a different configured Game. Refetch and recreate the Plan using the intended Game context.');
|
|
591
|
+
try {
|
|
592
|
+
recordFunding(precondition, await validateOpenSignal(precondition, byAddress, precondition.authorityHash));
|
|
593
|
+
}
|
|
594
|
+
catch (error) {
|
|
595
|
+
throw fleetFailure(precondition, error);
|
|
596
|
+
}
|
|
597
|
+
continue;
|
|
598
|
+
}
|
|
599
|
+
if (precondition.kind === 'ship-import-funding') {
|
|
600
|
+
try {
|
|
601
|
+
const funding = validateShipImportFunding(precondition, importFundingAccounts.get(precondition), byAddress, precondition.maximumProfileDebit);
|
|
602
|
+
recordFunding(precondition, funding);
|
|
603
|
+
}
|
|
604
|
+
catch (error) {
|
|
605
|
+
throw fleetFailure(precondition, error);
|
|
606
|
+
}
|
|
607
|
+
continue;
|
|
608
|
+
}
|
|
609
|
+
if (precondition.kind === 'fleet-add-ship') {
|
|
610
|
+
try {
|
|
611
|
+
const game = byAddress.get(precondition.game);
|
|
612
|
+
let catalog = assemblyCatalogs.get(precondition.game);
|
|
613
|
+
if (!catalog && game) {
|
|
614
|
+
catalog = decodeGameShipAssemblyCatalog(game);
|
|
615
|
+
assemblyCatalogs.set(precondition.game, catalog);
|
|
616
|
+
}
|
|
617
|
+
const funding = await validateFleetShipAssembly(precondition, fleetAssemblyAccounts.get(precondition), byAddress, precondition, catalog);
|
|
618
|
+
recordFunding(precondition, funding);
|
|
619
|
+
}
|
|
620
|
+
catch (error) {
|
|
621
|
+
throw fleetFailure(precondition, error);
|
|
622
|
+
}
|
|
623
|
+
continue;
|
|
624
|
+
}
|
|
625
|
+
if (precondition.kind === 'fleet-create') {
|
|
626
|
+
try {
|
|
627
|
+
const funding = await validateFleetCreation(precondition, fleetCreationAccounts.get(precondition), byAddress, precondition.maximumProfileDebit);
|
|
628
|
+
recordFunding(precondition, funding);
|
|
629
|
+
}
|
|
630
|
+
catch (error) {
|
|
631
|
+
throw fleetFailure(precondition, error);
|
|
632
|
+
}
|
|
633
|
+
continue;
|
|
634
|
+
}
|
|
324
635
|
let narrowed = true;
|
|
636
|
+
let cause;
|
|
325
637
|
if (precondition.kind === 'token-account')
|
|
326
638
|
narrowed =
|
|
327
639
|
account !== undefined && matchesTokenAccount(account, precondition);
|
|
328
|
-
if (precondition.kind === '
|
|
640
|
+
if (precondition.kind === 'movement-character' ||
|
|
641
|
+
precondition.kind === 'starbase-system' ||
|
|
642
|
+
precondition.kind === 'fleet-mining' ||
|
|
643
|
+
isFactionTradeGuard(precondition) ||
|
|
644
|
+
precondition.kind === 'token-mint' ||
|
|
645
|
+
precondition.kind === 'game-ship-config' ||
|
|
329
646
|
precondition.kind === 'game-account' ||
|
|
330
|
-
precondition.kind === 'game-cargo-config' ||
|
|
647
|
+
precondition.kind === 'game-cargo-bytes-config' ||
|
|
331
648
|
precondition.kind === 'cargo-cache') {
|
|
332
649
|
try {
|
|
333
650
|
if (!account)
|
|
334
651
|
narrowed = false;
|
|
652
|
+
else if (precondition.kind === 'movement-character') {
|
|
653
|
+
narrowed =
|
|
654
|
+
precondition.game === requireGameAddress(context) &&
|
|
655
|
+
(await hashMovementCharacter(account, precondition)) ===
|
|
656
|
+
precondition.stateHash;
|
|
657
|
+
}
|
|
658
|
+
else if (precondition.kind === 'starbase-system') {
|
|
659
|
+
narrowed = precondition.game === requireGameAddress(context);
|
|
660
|
+
if (narrowed)
|
|
661
|
+
await validateStarbaseSystem(account, precondition);
|
|
662
|
+
}
|
|
663
|
+
else if (precondition.kind === 'fleet-mining') {
|
|
664
|
+
narrowed =
|
|
665
|
+
precondition.game === requireGameAddress(context) &&
|
|
666
|
+
(await matchesFleetMiningState(account, precondition));
|
|
667
|
+
}
|
|
668
|
+
else if (isFactionTradeGuard(precondition)) {
|
|
669
|
+
narrowed = await matchesFactionTradeState(account, precondition);
|
|
670
|
+
}
|
|
671
|
+
else if (precondition.kind === 'token-mint') {
|
|
672
|
+
narrowed = validateTokenMint(account) === precondition.decimals;
|
|
673
|
+
}
|
|
335
674
|
else if (precondition.kind === 'game-ship-config') {
|
|
336
675
|
let hashes = shipHashesByGame.get(precondition.address);
|
|
337
676
|
if (!hashes) {
|
|
338
|
-
|
|
677
|
+
let catalog = assemblyCatalogs.get(precondition.address);
|
|
678
|
+
if (!catalog && assemblyGames.has(precondition.address)) {
|
|
679
|
+
catalog = decodeGameShipAssemblyCatalog(account);
|
|
680
|
+
assemblyCatalogs.set(precondition.address, catalog);
|
|
681
|
+
}
|
|
682
|
+
hashes = await hashGameShipConfigurations(account, shipIdsByGame.get(precondition.address), catalog);
|
|
339
683
|
shipHashesByGame.set(precondition.address, hashes);
|
|
340
684
|
}
|
|
341
685
|
narrowed =
|
|
@@ -343,14 +687,20 @@ async function checkPreconditions(context, preconditions, commitment) {
|
|
|
343
687
|
}
|
|
344
688
|
else if (precondition.kind === 'game-account') {
|
|
345
689
|
if (!validatedGames.has(account.address)) {
|
|
346
|
-
|
|
690
|
+
if (assemblyGames.has(precondition.address)) {
|
|
691
|
+
if (!assemblyCatalogs.has(precondition.address))
|
|
692
|
+
assemblyCatalogs.set(precondition.address, decodeGameShipAssemblyCatalog(account));
|
|
693
|
+
}
|
|
694
|
+
else
|
|
695
|
+
validateGameForCharacterRegistration(account);
|
|
347
696
|
validatedGames.add(account.address);
|
|
348
697
|
}
|
|
349
698
|
}
|
|
350
|
-
else if (precondition.kind === 'game-cargo-config') {
|
|
699
|
+
else if (precondition.kind === 'game-cargo-bytes-config') {
|
|
351
700
|
let hashes = cargoHashesByGame.get(precondition.address);
|
|
352
701
|
if (!hashes) {
|
|
353
|
-
|
|
702
|
+
const ids = cargoIdsByGame.get(precondition.address);
|
|
703
|
+
hashes = await hashGameCargoConfigurationGuards(account, ids);
|
|
354
704
|
cargoHashesByGame.set(precondition.address, hashes);
|
|
355
705
|
}
|
|
356
706
|
narrowed =
|
|
@@ -369,22 +719,35 @@ async function checkPreconditions(context, preconditions, commitment) {
|
|
|
369
719
|
canonical === account.address && bump === precondition.bump;
|
|
370
720
|
}
|
|
371
721
|
}
|
|
372
|
-
catch {
|
|
722
|
+
catch (error) {
|
|
373
723
|
narrowed = false;
|
|
724
|
+
cause = guardCause(precondition, error);
|
|
374
725
|
}
|
|
375
726
|
}
|
|
376
727
|
if (!narrowed ||
|
|
377
728
|
(precondition.kind === 'token-account-or-absent' &&
|
|
378
729
|
account !== undefined &&
|
|
379
730
|
!matchesTokenAccount(account, precondition)) ||
|
|
731
|
+
(precondition.kind === 'system-account-or-absent' &&
|
|
732
|
+
account !== undefined &&
|
|
733
|
+
(account.owner !== '11111111111111111111111111111111' ||
|
|
734
|
+
account.executable ||
|
|
735
|
+
account.data.length !== 0)) ||
|
|
380
736
|
(precondition.kind === 'account-absent' && account !== undefined) ||
|
|
381
737
|
(precondition.kind === 'account-state' &&
|
|
382
738
|
(account === undefined ||
|
|
383
739
|
(await hashAccountState(account.owner, account.data)) !==
|
|
384
740
|
precondition.dataHash))) {
|
|
385
|
-
throw new ActionPreconditionFailedError(precondition, account?.slot);
|
|
741
|
+
throw new ActionPreconditionFailedError(precondition, account?.slot, cause);
|
|
386
742
|
}
|
|
387
743
|
}
|
|
744
|
+
for (const [profile, funding] of profileFunding) {
|
|
745
|
+
// Validation above guarantees a fresh Profile from the same finite batch.
|
|
746
|
+
const account = byAddress.get(profile);
|
|
747
|
+
if (account.lamports < funding.reserve + funding.debit)
|
|
748
|
+
throw new ActionPreconditionFailedError(funding.guard, account.slot, 'The Profile cannot cover the combined Fleet creation, assembly and ship import debits while preserving its rent reserve. Fund the Profile or the Fleet/StarbasePlayer targets explicitly, then replan.', profile);
|
|
749
|
+
}
|
|
750
|
+
return registrationFunding;
|
|
388
751
|
}
|
|
389
752
|
function commitmentReached(actual, requested) {
|
|
390
753
|
if (actual === null)
|
|
@@ -611,7 +974,14 @@ export async function executePlanWithLifecycle(context, plan, options, lifecycle
|
|
|
611
974
|
const writeRpc = context.writeRpc;
|
|
612
975
|
if (writeRpc === undefined)
|
|
613
976
|
throw new MissingWriteTransportError();
|
|
614
|
-
|
|
977
|
+
// Guard order is not trusted: funding follows instruction order, including hydrated Plans.
|
|
978
|
+
const ordered = [...plan.preconditions].sort((a, b) => {
|
|
979
|
+
const index = (guard) => guard.kind === 'character-registration'
|
|
980
|
+
? plan.steps.findIndex((step) => step.instruction.accounts?.[2]?.address === guard.address)
|
|
981
|
+
: -1;
|
|
982
|
+
return index(a) - index(b);
|
|
983
|
+
});
|
|
984
|
+
const registrationFunding = await checkPreconditions(context, ordered, plan.steps, validated.commitment);
|
|
615
985
|
const transaction = await assemblePlan(context, plan, {
|
|
616
986
|
feePayer: validated.feePayer.address,
|
|
617
987
|
commitment: validated.commitment,
|
|
@@ -622,6 +992,25 @@ export async function executePlanWithLifecycle(context, plan, options, lifecycle
|
|
|
622
992
|
? {}
|
|
623
993
|
: { priorityFeeMicroLamports: validated.priorityFeeMicroLamports }),
|
|
624
994
|
});
|
|
995
|
+
if (registrationFunding.length > 0) {
|
|
996
|
+
if (typeof writeRpc.getFeeForMessage !== 'function')
|
|
997
|
+
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.');
|
|
998
|
+
const payer = validated.feePayer.address;
|
|
999
|
+
const { value: fee } = await writeRpc
|
|
1000
|
+
.getFeeForMessage(getBase64Decoder().decode(transaction.messageBytes), { commitment: validated.commitment })
|
|
1001
|
+
.send();
|
|
1002
|
+
if (typeof fee !== 'bigint' || fee < 0n)
|
|
1003
|
+
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 });
|
|
1004
|
+
if (!registrationFunding.some((funding) => funding.funder === payer)) {
|
|
1005
|
+
const [account, rent] = await readContextRawAccounts(context, [payer, RENT_ADDRESS], { commitment: validated.commitment });
|
|
1006
|
+
if (!account || !isEmptySystemAccount(account) || !rent)
|
|
1007
|
+
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 });
|
|
1008
|
+
const remaining = account.lamports - fee;
|
|
1009
|
+
if (remaining < 0n || (remaining > 0n && remaining < readRent(rent)(0)))
|
|
1010
|
+
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 });
|
|
1011
|
+
}
|
|
1012
|
+
checkRegistrationFunding(registrationFunding, { payer, lamports: fee });
|
|
1013
|
+
}
|
|
625
1014
|
await lifecycle?.onPrepared(sendingSigner === undefined ? 'observable' : 'opaque');
|
|
626
1015
|
const submission = await signAndSubmit(writeRpc, transaction, signers, sendingSigner, validated.commitment, lifecycle);
|
|
627
1016
|
if (submission.status === 'unknown')
|