@aephia/atlas-kit 0.6.0-next.9 → 0.6.0-next.90
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 +28 -27
- 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 +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.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 +63 -36
- 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 +44 -15
- 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 +2 -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/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 +34 -15
- package/dist/fleets/actions/index.d.ts.map +1 -1
- package/dist/fleets/actions/index.js +227 -118
- 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 +41 -13
- 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 +2 -0
- package/dist/identity/actions/create-profile.d.ts.map +1 -1
- package/dist/identity/actions/create-profile.js +14 -9
- package/dist/identity/actions/create-profile.js.map +1 -1
- package/dist/identity/actions/index.d.ts +3 -3
- package/dist/identity/actions/index.d.ts.map +1 -1
- package/dist/identity/actions/index.js +48 -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 +12 -32
- package/dist/internal/c4/crafting.d.ts.map +1 -1
- package/dist/internal/c4/crafting.js +31 -44
- package/dist/internal/c4/crafting.js.map +1 -1
- 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-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 +36 -9
- package/dist/internal/c4/game.d.ts.map +1 -1
- package/dist/internal/c4/game.js +147 -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 +31 -0
- package/dist/internal/c4/local-market-order.d.ts.map +1 -0
- package/dist/internal/c4/local-market-order.js +47 -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-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 +10 -7
- package/dist/internal/planning/authorization-adapter.d.ts.map +1 -1
- package/dist/internal/planning/authorization-adapter.js +87 -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-enrollment.d.ts +0 -2
- package/dist/internal/planning/faction-enrollment.d.ts.map +1 -1
- package/dist/internal/planning/faction-enrollment.js +1 -22
- 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 +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 +108 -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-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 +225 -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 +153 -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 +42 -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 +85 -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 +165 -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 +137 -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 +126 -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 +166 -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 +85 -0
- package/dist/internal/planning/open-signal.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 +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 +0 -1
- package/dist/internal/planning/ship-token.d.ts.map +1 -1
- package/dist/internal/planning/ship-token.js +2 -5
- 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/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.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 +61 -3
- package/dist/markets/actions/index.d.ts.map +1 -1
- package/dist/markets/actions/index.js +137 -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 +38 -7
- package/dist/markets/index.d.ts.map +1 -1
- package/dist/markets/index.js +57 -10
- 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 +24 -0
- package/dist/planning/assembly.js.map +1 -1
- package/dist/planning/execution.d.ts.map +1 -1
- package/dist/planning/execution.js +459 -17
- package/dist/planning/execution.js.map +1 -1
- package/dist/planning/index.d.ts +181 -149
- package/dist/planning/index.d.ts.map +1 -1
- package/dist/planning/index.js +869 -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/docking.d.ts +13 -0
- package/dist/registry/docking.d.ts.map +1 -0
- package/dist/registry/docking.js +19 -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.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,32 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { revalidateDockFunding } from '../internal/planning/fleet-dock-funding.js';
|
|
2
|
+
import { decodeDockingSequences } from '../registry/docking.js';
|
|
3
|
+
import { revalidateMarketOrder, marketOrderFundingAddresses, } from '../internal/planning/local-market-order-funding.js';
|
|
4
|
+
import { resolveFleetCrewTransfer } from '../internal/planning/fleet-crew-transfer.js';
|
|
5
|
+
import { revalidateScanCompletion } from '../internal/planning/scan-completion.js';
|
|
6
|
+
import { openSignalAddresses, validateOpenSignal, } from '../internal/planning/open-signal.js';
|
|
7
|
+
import { revalidateDetect } from '../internal/planning/scan-detect.js';
|
|
8
|
+
import { resolveFleetRespawn } from '../internal/planning/fleet-respawn.js';
|
|
9
|
+
import { validateFleetAttackActors } from '../internal/planning/fleet-attack-xp.js';
|
|
10
|
+
import { RENT_ADDRESS, readRent } from '../internal/planning/rent.js';
|
|
11
|
+
import { getBase64Decoder, } from '@solana/kit';
|
|
12
|
+
import { hashMovementCharacter } from '../internal/planning/movement-character.js';
|
|
13
|
+
import { validateFleetDockingPolicy } from '../internal/planning/fleet-docking.js';
|
|
14
|
+
import { validateStarbaseSystem } from '../internal/planning/starbase-system.js';
|
|
15
|
+
import { revalidateCharacterRegistration, isEmptySystemAccount, } from '../internal/planning/character-registration.js';
|
|
16
|
+
import { validateFleetArrivalIntent } from '../internal/planning/fleet-arrival.js';
|
|
17
|
+
import { isRuntimeGuard, revalidateRuntimeGuards, } from '../internal/planning/runtime-guards.js';
|
|
18
|
+
import { isFactionTradeGuard } from '../internal/planning/faction-trade-guards.js';
|
|
19
|
+
import { resolveShipImportFunding, validateShipImportFunding, } from '../internal/planning/ship-import-funding.js';
|
|
20
|
+
import { matchesFleetMiningState } from '../internal/planning/mining-stop.js';
|
|
21
|
+
import { requireGameAddress } from '../internal/game-context.js';
|
|
22
|
+
import { matchesFactionTradeState } from '../internal/planning/faction-trade-state.js';
|
|
23
|
+
import { resolveFleetShipAssembly, validateFleetShipAssembly, } from '../internal/planning/fleet-ship-assembly.js';
|
|
24
|
+
import { resolveFleetCreation, validateFleetCreation, } from '../internal/planning/fleet-creation.js';
|
|
25
|
+
import { validateTokenMint } from '../internal/planning/token-mint.js';
|
|
26
|
+
import { hashGameShipConfigurations, decodeGameShipAssemblyCatalog, } from '../registry/ships.js';
|
|
2
27
|
import { validateGameForCharacterRegistration } from '../registry/onboarding.js';
|
|
3
28
|
import { hashAccountState } from '../internal/planning/account-state.js';
|
|
4
|
-
import {
|
|
29
|
+
import { hashGameCargoConfigurationGuards } from '../registry/cargo.js';
|
|
5
30
|
import { validateWalletCargoCache } from '../internal/c4/wallet-cargo-cache.js';
|
|
6
31
|
import { getAddressEncoder, getProgramDerivedAddress, getAddressDecoder, getBase58Decoder, getBase64EncodedWireTransaction, getSignatureFromTransaction, isAddress, isTransactionModifyingSigner, isTransactionPartialSigner, isTransactionSendingSigner, signAndSendTransactionWithSigners, signTransactionWithSigners, } from '@solana/kit';
|
|
7
32
|
import { InvalidActionInputError, SageSdkError } from '../client/errors.js';
|
|
@@ -36,12 +61,23 @@ class MissingWriteTransportError extends SageSdkError {
|
|
|
36
61
|
class ActionPreconditionFailedError extends SageSdkError {
|
|
37
62
|
describes;
|
|
38
63
|
observedSlot;
|
|
39
|
-
constructor(precondition, observedSlot) {
|
|
40
|
-
super('ACTION_PRECONDITION_FAILED', `The account state required by this Plan changed at ${
|
|
64
|
+
constructor(precondition, observedSlot, cause, address = precondition.address) {
|
|
65
|
+
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
66
|
this.describes = precondition.describes;
|
|
42
67
|
this.observedSlot = observedSlot;
|
|
43
68
|
}
|
|
44
69
|
}
|
|
70
|
+
/** The cause a wrapped guard failure may carry: only a validator's own
|
|
71
|
+
* precondition cause and remedy for the guarded address. Adapter, provider and
|
|
72
|
+
* unknown failures yield `undefined`, so the wrapper falls back to the guard's
|
|
73
|
+
* generic description and never concatenates inner exception text. */
|
|
74
|
+
function guardCause(precondition, error) {
|
|
75
|
+
return error instanceof SageSdkError &&
|
|
76
|
+
error.code === 'ACTION_PRECONDITION_FAILED' &&
|
|
77
|
+
(error.address === undefined || error.address === precondition.address)
|
|
78
|
+
? error.message
|
|
79
|
+
: undefined;
|
|
80
|
+
}
|
|
45
81
|
class TransactionExpiredError extends SageSdkError {
|
|
46
82
|
signature;
|
|
47
83
|
lastValidBlockHeight;
|
|
@@ -293,15 +329,219 @@ function matchesTokenAccount(account, expected) {
|
|
|
293
329
|
return (decoder.decode(account.data.subarray(0, 32)) === expected.mint &&
|
|
294
330
|
decoder.decode(account.data.subarray(32, 64)) === expected.owner);
|
|
295
331
|
}
|
|
296
|
-
|
|
297
|
-
const
|
|
332
|
+
function checkRegistrationFunding(registrations, fee) {
|
|
333
|
+
const balances = new Map();
|
|
334
|
+
for (const registration of registrations) {
|
|
335
|
+
const previous = balances.get(registration.funder);
|
|
336
|
+
if (previous === undefined || registration.observedLamports < previous)
|
|
337
|
+
balances.set(registration.funder, registration.observedLamports);
|
|
338
|
+
}
|
|
339
|
+
if (fee && balances.has(fee.payer))
|
|
340
|
+
balances.set(fee.payer, balances.get(fee.payer) - fee.lamports);
|
|
341
|
+
for (const registration of registrations) {
|
|
342
|
+
const balance = balances.get(registration.funder);
|
|
343
|
+
if (balance < registration.requiredLamports)
|
|
344
|
+
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 });
|
|
345
|
+
balances.set(registration.funder, balance - registration.netDebit);
|
|
346
|
+
}
|
|
347
|
+
if (fee)
|
|
348
|
+
for (const registration of registrations) {
|
|
349
|
+
const balance = balances.get(registration.funder);
|
|
350
|
+
if (balance !== 0n && balance < registration.minimumBalance)
|
|
351
|
+
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 });
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
async function checkPreconditions(context, allPreconditions, steps, commitment) {
|
|
355
|
+
for (const guard of allPreconditions) {
|
|
356
|
+
if (guard.kind === 'fleet-crew-transfer') {
|
|
357
|
+
try {
|
|
358
|
+
await resolveFleetCrewTransfer(context, guard, guard, commitment);
|
|
359
|
+
}
|
|
360
|
+
catch (error) {
|
|
361
|
+
throw new ActionPreconditionFailedError(guard, undefined, error instanceof SageSdkError
|
|
362
|
+
? error.message
|
|
363
|
+
: 'Crew transfer prerequisites could not be verified. Refresh crew state and recreate the Plan.');
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
if (guard.kind === 'scan-completion')
|
|
367
|
+
await revalidateScanCompletion(context, guard, commitment);
|
|
368
|
+
if (guard.kind === 'scan-detect')
|
|
369
|
+
await revalidateDetect(context, guard, commitment);
|
|
370
|
+
if (guard.kind === 'fleet-attack') {
|
|
371
|
+
try {
|
|
372
|
+
await validateFleetAttackActors(context, guard);
|
|
373
|
+
}
|
|
374
|
+
catch (error) {
|
|
375
|
+
throw new ActionPreconditionFailedError(guard, undefined, guardCause(guard, error) ??
|
|
376
|
+
'The attacking or defending Fleet or Character could not be verified. Refresh both Fleets and their Characters, then recreate the Plan before signing.');
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
for (const guard of allPreconditions) {
|
|
381
|
+
if (guard.kind !== 'fleet-respawn')
|
|
382
|
+
continue;
|
|
383
|
+
try {
|
|
384
|
+
const current = await resolveFleetRespawn(context, { ...guard, fleet: guard.address }, guard, commitment);
|
|
385
|
+
const planned = steps[0].instruction;
|
|
386
|
+
const fresh = current.instruction;
|
|
387
|
+
if (planned.programAddress !== fresh.programAddress ||
|
|
388
|
+
planned.data?.length !== fresh.data?.length ||
|
|
389
|
+
fresh.data?.some((v, i) => planned.data?.[i] !== v) ||
|
|
390
|
+
planned.accounts?.length !== fresh.accounts?.length ||
|
|
391
|
+
fresh.accounts?.some((a, i) => planned.accounts?.[i]?.address !== a.address ||
|
|
392
|
+
planned.accounts?.[i]?.role !== a.role))
|
|
393
|
+
throw new SageSdkError('ACTION_PRECONDITION_FAILED', 'Recovery instruction accounts changed. Recreate and inspect the recovery Plan before signing.');
|
|
394
|
+
}
|
|
395
|
+
catch (error) {
|
|
396
|
+
throw new ActionPreconditionFailedError(guard, undefined, error instanceof SageSdkError
|
|
397
|
+
? error.message
|
|
398
|
+
: 'Recovery prerequisites could not be validated. Refresh the Fleet and recreate the Plan.');
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
const checkedXp = new Set();
|
|
402
|
+
const freshGameVersions = new Map();
|
|
403
|
+
const registrationFunding = [];
|
|
404
|
+
const initializations = new Map();
|
|
405
|
+
for (const guard of allPreconditions) {
|
|
406
|
+
if (guard.kind !== 'character-registration')
|
|
407
|
+
continue;
|
|
408
|
+
registrationFunding.push(await revalidateCharacterRegistration(context, guard, commitment, freshGameVersions, initializations));
|
|
409
|
+
}
|
|
410
|
+
checkRegistrationFunding(registrationFunding);
|
|
411
|
+
for (const guard of allPreconditions) {
|
|
412
|
+
if (guard.kind !== 'fleet-arrival')
|
|
413
|
+
continue;
|
|
414
|
+
try {
|
|
415
|
+
const current = await validateFleetArrivalIntent(context, guard.intent, freshGameVersions);
|
|
416
|
+
for (const xp of allPreconditions) {
|
|
417
|
+
if (xp.kind !== 'xp-runtime' ||
|
|
418
|
+
xp.intent.game !== current.xp.intent.game ||
|
|
419
|
+
xp.intent.character !== current.xp.intent.character ||
|
|
420
|
+
xp.intent.structure !== current.xp.intent.structure ||
|
|
421
|
+
(xp.intent.profile !== undefined &&
|
|
422
|
+
xp.intent.profile !== current.intent.profile))
|
|
423
|
+
continue;
|
|
424
|
+
if (['xpBudget', 'xpBudgetConfig', 'xpAccrual'].some((key) => xp.accounts[key] !== current.xp.accounts[key]))
|
|
425
|
+
throw new SageSdkError('ACTION_PRECONDITION_FAILED', 'Arrival XP runtime changed. Refresh the Fleet and recreate the Plan.');
|
|
426
|
+
checkedXp.add(xp);
|
|
427
|
+
}
|
|
428
|
+
if (current.character !== guard.character ||
|
|
429
|
+
current.regionTracker !== guard.regionTracker)
|
|
430
|
+
throw new SageSdkError('ACTION_PRECONDITION_FAILED', 'Arrival account links changed. Refresh the Fleet and recreate the Plan.');
|
|
431
|
+
}
|
|
432
|
+
catch (error) {
|
|
433
|
+
throw new ActionPreconditionFailedError(guard, undefined, error instanceof SageSdkError
|
|
434
|
+
? error.message
|
|
435
|
+
: 'Arrival prerequisites could not be validated. Refresh the Fleet and recreate the Plan.');
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
await revalidateRuntimeGuards(context, allPreconditions
|
|
439
|
+
.filter(isRuntimeGuard)
|
|
440
|
+
.filter((guard) => !checkedXp.has(guard)), freshGameVersions);
|
|
441
|
+
const preconditions = allPreconditions.filter((guard) => !isRuntimeGuard(guard) &&
|
|
442
|
+
guard.kind !== 'fleet-attack' &&
|
|
443
|
+
guard.kind !== 'fleet-arrival' &&
|
|
444
|
+
guard.kind !== 'character-registration' &&
|
|
445
|
+
guard.kind !== 'scan-detect' &&
|
|
446
|
+
guard.kind !== 'scan-completion' &&
|
|
447
|
+
guard.kind !== 'fleet-respawn' &&
|
|
448
|
+
guard.kind !== 'fleet-crew-transfer');
|
|
449
|
+
const fleetCreationAccounts = new Map();
|
|
450
|
+
const fleetAssemblyAccounts = new Map();
|
|
451
|
+
const importFundingAccounts = new Map();
|
|
452
|
+
const assemblyGames = new Set();
|
|
453
|
+
const assemblyCatalogs = new Map();
|
|
454
|
+
const requiredAddresses = new Set(preconditions.map(({ address }) => address));
|
|
455
|
+
for (const guard of preconditions) {
|
|
456
|
+
if (guard.kind === 'fleet-dock-funding' && guard.status === 'available') {
|
|
457
|
+
for (const address of [
|
|
458
|
+
guard.profile,
|
|
459
|
+
guard.starbasePlayer,
|
|
460
|
+
guard.system,
|
|
461
|
+
guard.game,
|
|
462
|
+
RENT_ADDRESS,
|
|
463
|
+
])
|
|
464
|
+
requiredAddresses.add(address);
|
|
465
|
+
}
|
|
466
|
+
if (guard.kind === 'fleet-docking-policy')
|
|
467
|
+
requiredAddresses.add(guard.ownership);
|
|
468
|
+
if (guard.kind === 'local-market-order' && guard.status === 'available') {
|
|
469
|
+
for (const address of [
|
|
470
|
+
guard.character,
|
|
471
|
+
guard.starbasePlayer,
|
|
472
|
+
...marketOrderFundingAddresses(guard.profile, allPreconditions),
|
|
473
|
+
])
|
|
474
|
+
requiredAddresses.add(address);
|
|
475
|
+
}
|
|
476
|
+
if (guard.kind === 'scan-signal-open') {
|
|
477
|
+
for (const address of openSignalAddresses(guard))
|
|
478
|
+
requiredAddresses.add(address);
|
|
479
|
+
}
|
|
480
|
+
if (guard.kind !== 'fleet-create')
|
|
481
|
+
continue;
|
|
482
|
+
const resolved = await resolveFleetCreation(guard);
|
|
483
|
+
if (resolved.fleet !== guard.address)
|
|
484
|
+
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.');
|
|
485
|
+
fleetCreationAccounts.set(guard, resolved);
|
|
486
|
+
for (const address of [
|
|
487
|
+
resolved.game,
|
|
488
|
+
resolved.profile,
|
|
489
|
+
resolved.system,
|
|
490
|
+
resolved.character,
|
|
491
|
+
resolved.profileFaction,
|
|
492
|
+
resolved.starbasePlayer,
|
|
493
|
+
resolved.fleet,
|
|
494
|
+
resolved.rent,
|
|
495
|
+
resolved.clock,
|
|
496
|
+
])
|
|
497
|
+
requiredAddresses.add(address);
|
|
498
|
+
}
|
|
499
|
+
for (const guard of preconditions) {
|
|
500
|
+
if (guard.kind !== 'fleet-add-ship')
|
|
501
|
+
continue;
|
|
502
|
+
const resolved = await resolveFleetShipAssembly(guard);
|
|
503
|
+
fleetAssemblyAccounts.set(guard, resolved);
|
|
504
|
+
assemblyGames.add(resolved.game);
|
|
505
|
+
for (const address of [
|
|
506
|
+
resolved.game,
|
|
507
|
+
resolved.profile,
|
|
508
|
+
resolved.system,
|
|
509
|
+
resolved.character,
|
|
510
|
+
resolved.profileFaction,
|
|
511
|
+
resolved.starbasePlayer,
|
|
512
|
+
resolved.fleet,
|
|
513
|
+
resolved.rent,
|
|
514
|
+
resolved.clock,
|
|
515
|
+
])
|
|
516
|
+
requiredAddresses.add(address);
|
|
517
|
+
}
|
|
518
|
+
for (const guard of preconditions) {
|
|
519
|
+
if (guard.kind !== 'ship-import-funding')
|
|
520
|
+
continue;
|
|
521
|
+
let resolved;
|
|
522
|
+
try {
|
|
523
|
+
resolved = await resolveShipImportFunding(guard);
|
|
524
|
+
}
|
|
525
|
+
catch {
|
|
526
|
+
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.');
|
|
527
|
+
}
|
|
528
|
+
importFundingAccounts.set(guard, resolved);
|
|
529
|
+
for (const address of [
|
|
530
|
+
resolved.profile,
|
|
531
|
+
resolved.character,
|
|
532
|
+
resolved.starbasePlayer,
|
|
533
|
+
resolved.rent,
|
|
534
|
+
])
|
|
535
|
+
requiredAddresses.add(address);
|
|
536
|
+
}
|
|
537
|
+
const addresses = [...requiredAddresses];
|
|
298
538
|
const accounts = await readContextRawAccounts(context, addresses, {
|
|
299
539
|
commitment,
|
|
300
540
|
});
|
|
301
541
|
const byAddress = new Map(addresses.map((address, index) => [address, accounts[index]]));
|
|
302
542
|
const cargoIdsByGame = new Map();
|
|
303
543
|
for (const guard of preconditions) {
|
|
304
|
-
if (guard.kind !== 'game-cargo-config')
|
|
544
|
+
if (guard.kind !== 'game-cargo-bytes-config')
|
|
305
545
|
continue;
|
|
306
546
|
const ids = cargoIdsByGame.get(guard.address) ?? [];
|
|
307
547
|
ids.push(guard.cargoId);
|
|
@@ -319,23 +559,180 @@ async function checkPreconditions(context, preconditions, commitment) {
|
|
|
319
559
|
// Invocation-local only: every execution attempt still reads and decodes fresh state.
|
|
320
560
|
const cargoHashesByGame = new Map();
|
|
321
561
|
const validatedGames = new Set();
|
|
322
|
-
|
|
562
|
+
const profileFunding = new Map();
|
|
563
|
+
const fundedTargets = new Set();
|
|
564
|
+
const recordFunding = (guard, funding) => {
|
|
565
|
+
// Repeated guards for one action are assertions, not additional debits.
|
|
566
|
+
// Every guard still validates its own ceiling before reaching here.
|
|
567
|
+
const target = `${guard.kind}:${guard.address}`;
|
|
568
|
+
if (fundedTargets.has(target))
|
|
569
|
+
return;
|
|
570
|
+
fundedTargets.add(target);
|
|
571
|
+
const current = profileFunding.get(guard.profile);
|
|
572
|
+
profileFunding.set(guard.profile, {
|
|
573
|
+
debit: (current?.debit ?? 0n) + funding.profileDebit,
|
|
574
|
+
reserve: funding.profileReserve,
|
|
575
|
+
guard,
|
|
576
|
+
});
|
|
577
|
+
};
|
|
578
|
+
const fleetFailure = (guard, error) => {
|
|
579
|
+
// Only SDK diagnostics from this bounded validation batch are exposed.
|
|
580
|
+
// Never stringify provider/codec objects or retain their inner causes.
|
|
581
|
+
if (error instanceof SageSdkError &&
|
|
582
|
+
error.address !== undefined &&
|
|
583
|
+
requiredAddresses.has(error.address))
|
|
584
|
+
return new ActionPreconditionFailedError(guard, byAddress.get(error.address)?.slot, error.message, error.address);
|
|
585
|
+
return new ActionPreconditionFailedError(guard, undefined, 'Fleet prerequisites could not be validated. Refresh the related accounts and replan with a supported binding version.');
|
|
586
|
+
};
|
|
587
|
+
let dockingSequences;
|
|
588
|
+
let dockingSequencesRead = false;
|
|
589
|
+
// Exact account-state diagnostics must win over dependent funding estimates,
|
|
590
|
+
// including hydrated Plans whose guard order differs from the planner's.
|
|
591
|
+
const ordered = preconditions.some((g) => g.kind === 'fleet-dock-funding')
|
|
592
|
+
? [
|
|
593
|
+
...preconditions.filter((g) => g.kind === 'account-state'),
|
|
594
|
+
...preconditions.filter((g) => g.kind !== 'account-state'),
|
|
595
|
+
]
|
|
596
|
+
: preconditions;
|
|
597
|
+
for (const precondition of ordered) {
|
|
323
598
|
const account = byAddress.get(precondition.address);
|
|
599
|
+
if (precondition.kind === 'fleet-dock-funding') {
|
|
600
|
+
try {
|
|
601
|
+
if (precondition.game !== requireGameAddress(context))
|
|
602
|
+
throw new SageSdkError('ACTION_PRECONDITION_FAILED', `The docking Plan belongs to Game ${precondition.game}, but the context uses Game ${requireGameAddress(context)}. Recreate it with the intended Game context.`, { address: precondition.address });
|
|
603
|
+
if (precondition.status === 'available' && !dockingSequencesRead) {
|
|
604
|
+
dockingSequences = decodeDockingSequences(byAddress.get(precondition.game));
|
|
605
|
+
dockingSequencesRead = true;
|
|
606
|
+
}
|
|
607
|
+
const funding = revalidateDockFunding(precondition, byAddress, dockingSequences);
|
|
608
|
+
if (funding)
|
|
609
|
+
recordFunding(precondition, funding);
|
|
610
|
+
}
|
|
611
|
+
catch (error) {
|
|
612
|
+
throw fleetFailure(precondition, error);
|
|
613
|
+
}
|
|
614
|
+
continue;
|
|
615
|
+
}
|
|
616
|
+
if (precondition.kind === 'local-market-order') {
|
|
617
|
+
try {
|
|
618
|
+
if (precondition.game !== requireGameAddress(context))
|
|
619
|
+
throw new SageSdkError('ACTION_PRECONDITION_FAILED', 'The order belongs to another Game. Recreate it with the intended Game context.');
|
|
620
|
+
revalidateMarketOrder(precondition, byAddress, allPreconditions);
|
|
621
|
+
}
|
|
622
|
+
catch (error) {
|
|
623
|
+
const failedAddress = error instanceof SageSdkError ? error.address : undefined;
|
|
624
|
+
throw new ActionPreconditionFailedError(precondition, byAddress.get(failedAddress ?? precondition.address)?.slot, error instanceof SageSdkError
|
|
625
|
+
? error.message
|
|
626
|
+
: 'The Local Market debit bounds could not be verified. Refresh its funding accounts and recreate the order Plan.', failedAddress);
|
|
627
|
+
}
|
|
628
|
+
continue;
|
|
629
|
+
}
|
|
630
|
+
if (precondition.kind === 'scan-signal-open') {
|
|
631
|
+
if (precondition.game !== requireGameAddress(context))
|
|
632
|
+
throw new ActionPreconditionFailedError(precondition, undefined, 'This signal setup belongs to a different configured Game. Refetch and recreate the Plan using the intended Game context.');
|
|
633
|
+
try {
|
|
634
|
+
recordFunding(precondition, await validateOpenSignal(precondition, byAddress, precondition.authorityHash));
|
|
635
|
+
}
|
|
636
|
+
catch (error) {
|
|
637
|
+
throw fleetFailure(precondition, error);
|
|
638
|
+
}
|
|
639
|
+
continue;
|
|
640
|
+
}
|
|
641
|
+
if (precondition.kind === 'ship-import-funding') {
|
|
642
|
+
try {
|
|
643
|
+
const funding = validateShipImportFunding(precondition, importFundingAccounts.get(precondition), byAddress, precondition.maximumProfileDebit);
|
|
644
|
+
recordFunding(precondition, funding);
|
|
645
|
+
}
|
|
646
|
+
catch (error) {
|
|
647
|
+
throw fleetFailure(precondition, error);
|
|
648
|
+
}
|
|
649
|
+
continue;
|
|
650
|
+
}
|
|
651
|
+
if (precondition.kind === 'fleet-add-ship') {
|
|
652
|
+
try {
|
|
653
|
+
const game = byAddress.get(precondition.game);
|
|
654
|
+
let catalog = assemblyCatalogs.get(precondition.game);
|
|
655
|
+
if (!catalog && game) {
|
|
656
|
+
catalog = decodeGameShipAssemblyCatalog(game);
|
|
657
|
+
assemblyCatalogs.set(precondition.game, catalog);
|
|
658
|
+
}
|
|
659
|
+
const funding = await validateFleetShipAssembly(precondition, fleetAssemblyAccounts.get(precondition), byAddress, precondition, catalog);
|
|
660
|
+
recordFunding(precondition, funding);
|
|
661
|
+
}
|
|
662
|
+
catch (error) {
|
|
663
|
+
throw fleetFailure(precondition, error);
|
|
664
|
+
}
|
|
665
|
+
continue;
|
|
666
|
+
}
|
|
667
|
+
if (precondition.kind === 'fleet-create') {
|
|
668
|
+
try {
|
|
669
|
+
const funding = await validateFleetCreation(precondition, fleetCreationAccounts.get(precondition), byAddress, precondition.maximumProfileDebit);
|
|
670
|
+
recordFunding(precondition, funding);
|
|
671
|
+
}
|
|
672
|
+
catch (error) {
|
|
673
|
+
throw fleetFailure(precondition, error);
|
|
674
|
+
}
|
|
675
|
+
continue;
|
|
676
|
+
}
|
|
677
|
+
if (precondition.kind === 'fleet-docking-policy') {
|
|
678
|
+
try {
|
|
679
|
+
if (precondition.game !== requireGameAddress(context))
|
|
680
|
+
throw new SageSdkError('ACTION_PRECONDITION_FAILED', 'The docking faction policy belongs to another Game. Recreate the Plan with the intended Game context.', { address: precondition.address });
|
|
681
|
+
await validateFleetDockingPolicy(account, byAddress.get(precondition.ownership), precondition);
|
|
682
|
+
}
|
|
683
|
+
catch (error) {
|
|
684
|
+
throw fleetFailure(precondition, error);
|
|
685
|
+
}
|
|
686
|
+
continue;
|
|
687
|
+
}
|
|
324
688
|
let narrowed = true;
|
|
689
|
+
let cause;
|
|
325
690
|
if (precondition.kind === 'token-account')
|
|
326
691
|
narrowed =
|
|
327
692
|
account !== undefined && matchesTokenAccount(account, precondition);
|
|
328
|
-
if (precondition.kind === '
|
|
693
|
+
if (precondition.kind === 'movement-character' ||
|
|
694
|
+
precondition.kind === 'starbase-system' ||
|
|
695
|
+
precondition.kind === 'fleet-mining' ||
|
|
696
|
+
isFactionTradeGuard(precondition) ||
|
|
697
|
+
precondition.kind === 'token-mint' ||
|
|
698
|
+
precondition.kind === 'game-ship-config' ||
|
|
329
699
|
precondition.kind === 'game-account' ||
|
|
330
|
-
precondition.kind === 'game-cargo-config' ||
|
|
700
|
+
precondition.kind === 'game-cargo-bytes-config' ||
|
|
331
701
|
precondition.kind === 'cargo-cache') {
|
|
332
702
|
try {
|
|
333
703
|
if (!account)
|
|
334
704
|
narrowed = false;
|
|
705
|
+
else if (precondition.kind === 'movement-character') {
|
|
706
|
+
narrowed =
|
|
707
|
+
precondition.game === requireGameAddress(context) &&
|
|
708
|
+
(await hashMovementCharacter(account, precondition)) ===
|
|
709
|
+
precondition.stateHash;
|
|
710
|
+
}
|
|
711
|
+
else if (precondition.kind === 'starbase-system') {
|
|
712
|
+
narrowed = precondition.game === requireGameAddress(context);
|
|
713
|
+
if (narrowed)
|
|
714
|
+
await validateStarbaseSystem(account, precondition);
|
|
715
|
+
}
|
|
716
|
+
else if (precondition.kind === 'fleet-mining') {
|
|
717
|
+
narrowed =
|
|
718
|
+
precondition.game === requireGameAddress(context) &&
|
|
719
|
+
(await matchesFleetMiningState(account, precondition));
|
|
720
|
+
}
|
|
721
|
+
else if (isFactionTradeGuard(precondition)) {
|
|
722
|
+
narrowed = await matchesFactionTradeState(account, precondition);
|
|
723
|
+
}
|
|
724
|
+
else if (precondition.kind === 'token-mint') {
|
|
725
|
+
narrowed = validateTokenMint(account) === precondition.decimals;
|
|
726
|
+
}
|
|
335
727
|
else if (precondition.kind === 'game-ship-config') {
|
|
336
728
|
let hashes = shipHashesByGame.get(precondition.address);
|
|
337
729
|
if (!hashes) {
|
|
338
|
-
|
|
730
|
+
let catalog = assemblyCatalogs.get(precondition.address);
|
|
731
|
+
if (!catalog && assemblyGames.has(precondition.address)) {
|
|
732
|
+
catalog = decodeGameShipAssemblyCatalog(account);
|
|
733
|
+
assemblyCatalogs.set(precondition.address, catalog);
|
|
734
|
+
}
|
|
735
|
+
hashes = await hashGameShipConfigurations(account, shipIdsByGame.get(precondition.address), catalog);
|
|
339
736
|
shipHashesByGame.set(precondition.address, hashes);
|
|
340
737
|
}
|
|
341
738
|
narrowed =
|
|
@@ -343,14 +740,20 @@ async function checkPreconditions(context, preconditions, commitment) {
|
|
|
343
740
|
}
|
|
344
741
|
else if (precondition.kind === 'game-account') {
|
|
345
742
|
if (!validatedGames.has(account.address)) {
|
|
346
|
-
|
|
743
|
+
if (assemblyGames.has(precondition.address)) {
|
|
744
|
+
if (!assemblyCatalogs.has(precondition.address))
|
|
745
|
+
assemblyCatalogs.set(precondition.address, decodeGameShipAssemblyCatalog(account));
|
|
746
|
+
}
|
|
747
|
+
else
|
|
748
|
+
validateGameForCharacterRegistration(account);
|
|
347
749
|
validatedGames.add(account.address);
|
|
348
750
|
}
|
|
349
751
|
}
|
|
350
|
-
else if (precondition.kind === 'game-cargo-config') {
|
|
752
|
+
else if (precondition.kind === 'game-cargo-bytes-config') {
|
|
351
753
|
let hashes = cargoHashesByGame.get(precondition.address);
|
|
352
754
|
if (!hashes) {
|
|
353
|
-
|
|
755
|
+
const ids = cargoIdsByGame.get(precondition.address);
|
|
756
|
+
hashes = await hashGameCargoConfigurationGuards(account, ids);
|
|
354
757
|
cargoHashesByGame.set(precondition.address, hashes);
|
|
355
758
|
}
|
|
356
759
|
narrowed =
|
|
@@ -369,22 +772,35 @@ async function checkPreconditions(context, preconditions, commitment) {
|
|
|
369
772
|
canonical === account.address && bump === precondition.bump;
|
|
370
773
|
}
|
|
371
774
|
}
|
|
372
|
-
catch {
|
|
775
|
+
catch (error) {
|
|
373
776
|
narrowed = false;
|
|
777
|
+
cause = guardCause(precondition, error);
|
|
374
778
|
}
|
|
375
779
|
}
|
|
376
780
|
if (!narrowed ||
|
|
377
781
|
(precondition.kind === 'token-account-or-absent' &&
|
|
378
782
|
account !== undefined &&
|
|
379
783
|
!matchesTokenAccount(account, precondition)) ||
|
|
784
|
+
(precondition.kind === 'system-account-or-absent' &&
|
|
785
|
+
account !== undefined &&
|
|
786
|
+
(account.owner !== '11111111111111111111111111111111' ||
|
|
787
|
+
account.executable ||
|
|
788
|
+
account.data.length !== 0)) ||
|
|
380
789
|
(precondition.kind === 'account-absent' && account !== undefined) ||
|
|
381
790
|
(precondition.kind === 'account-state' &&
|
|
382
791
|
(account === undefined ||
|
|
383
792
|
(await hashAccountState(account.owner, account.data)) !==
|
|
384
793
|
precondition.dataHash))) {
|
|
385
|
-
throw new ActionPreconditionFailedError(precondition, account?.slot);
|
|
794
|
+
throw new ActionPreconditionFailedError(precondition, account?.slot, cause);
|
|
386
795
|
}
|
|
387
796
|
}
|
|
797
|
+
for (const [profile, funding] of profileFunding) {
|
|
798
|
+
// Validation above guarantees a fresh Profile from the same finite batch.
|
|
799
|
+
const account = byAddress.get(profile);
|
|
800
|
+
if (account.lamports < funding.reserve + funding.debit)
|
|
801
|
+
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);
|
|
802
|
+
}
|
|
803
|
+
return registrationFunding;
|
|
388
804
|
}
|
|
389
805
|
function commitmentReached(actual, requested) {
|
|
390
806
|
if (actual === null)
|
|
@@ -611,7 +1027,14 @@ export async function executePlanWithLifecycle(context, plan, options, lifecycle
|
|
|
611
1027
|
const writeRpc = context.writeRpc;
|
|
612
1028
|
if (writeRpc === undefined)
|
|
613
1029
|
throw new MissingWriteTransportError();
|
|
614
|
-
|
|
1030
|
+
// Guard order is not trusted: funding follows instruction order, including hydrated Plans.
|
|
1031
|
+
const ordered = [...plan.preconditions].sort((a, b) => {
|
|
1032
|
+
const index = (guard) => guard.kind === 'character-registration'
|
|
1033
|
+
? plan.steps.findIndex((step) => step.instruction.accounts?.[2]?.address === guard.address)
|
|
1034
|
+
: -1;
|
|
1035
|
+
return index(a) - index(b);
|
|
1036
|
+
});
|
|
1037
|
+
const registrationFunding = await checkPreconditions(context, ordered, plan.steps, validated.commitment);
|
|
615
1038
|
const transaction = await assemblePlan(context, plan, {
|
|
616
1039
|
feePayer: validated.feePayer.address,
|
|
617
1040
|
commitment: validated.commitment,
|
|
@@ -622,6 +1045,25 @@ export async function executePlanWithLifecycle(context, plan, options, lifecycle
|
|
|
622
1045
|
? {}
|
|
623
1046
|
: { priorityFeeMicroLamports: validated.priorityFeeMicroLamports }),
|
|
624
1047
|
});
|
|
1048
|
+
if (registrationFunding.length > 0) {
|
|
1049
|
+
if (typeof writeRpc.getFeeForMessage !== 'function')
|
|
1050
|
+
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.');
|
|
1051
|
+
const payer = validated.feePayer.address;
|
|
1052
|
+
const { value: fee } = await writeRpc
|
|
1053
|
+
.getFeeForMessage(getBase64Decoder().decode(transaction.messageBytes), { commitment: validated.commitment })
|
|
1054
|
+
.send();
|
|
1055
|
+
if (typeof fee !== 'bigint' || fee < 0n)
|
|
1056
|
+
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 });
|
|
1057
|
+
if (!registrationFunding.some((funding) => funding.funder === payer)) {
|
|
1058
|
+
const [account, rent] = await readContextRawAccounts(context, [payer, RENT_ADDRESS], { commitment: validated.commitment });
|
|
1059
|
+
if (!account || !isEmptySystemAccount(account) || !rent)
|
|
1060
|
+
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 });
|
|
1061
|
+
const remaining = account.lamports - fee;
|
|
1062
|
+
if (remaining < 0n || (remaining > 0n && remaining < readRent(rent)(0)))
|
|
1063
|
+
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 });
|
|
1064
|
+
}
|
|
1065
|
+
checkRegistrationFunding(registrationFunding, { payer, lamports: fee });
|
|
1066
|
+
}
|
|
625
1067
|
await lifecycle?.onPrepared(sendingSigner === undefined ? 'observable' : 'opaque');
|
|
626
1068
|
const submission = await signAndSubmit(writeRpc, transaction, signers, sendingSigner, validated.commitment, lifecycle);
|
|
627
1069
|
if (submission.status === 'unknown')
|