@aephia/atlas-kit 0.6.0-next.4 → 0.6.0-next.40
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.map +1 -1
- package/dist/cargo/actions/deposit.js +51 -9
- package/dist/cargo/actions/deposit.js.map +1 -1
- package/dist/cargo/actions/wallet-context.d.ts +2 -3
- package/dist/cargo/actions/wallet-context.d.ts.map +1 -1
- package/dist/cargo/actions/wallet-context.js +6 -33
- package/dist/cargo/actions/wallet-context.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 +54 -11
- package/dist/cargo/actions/withdrawal.js.map +1 -1
- package/dist/claim-stakes/actions/index.d.ts.map +1 -1
- package/dist/claim-stakes/actions/index.js +2 -3
- package/dist/claim-stakes/actions/index.js.map +1 -1
- package/dist/client/errors.d.ts +4 -0
- 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 +19 -8
- package/dist/combat/actions/index.js.map +1 -1
- package/dist/crafting/actions/index.d.ts.map +1 -1
- package/dist/crafting/actions/index.js +36 -13
- package/dist/crafting/actions/index.js.map +1 -1
- package/dist/crafting/index.d.ts +8 -2
- package/dist/crafting/index.d.ts.map +1 -1
- package/dist/crafting/index.js +1 -1
- package/dist/crafting/index.js.map +1 -1
- package/dist/factions/actions/index.d.ts +36 -0
- package/dist/factions/actions/index.d.ts.map +1 -0
- package/dist/factions/actions/index.js +136 -0
- package/dist/factions/actions/index.js.map +1 -0
- package/dist/factions/index.d.ts +1 -0
- package/dist/factions/index.d.ts.map +1 -1
- package/dist/factions/index.js +1 -0
- package/dist/factions/index.js.map +1 -1
- package/dist/factions/profile-faction.d.ts +58 -0
- package/dist/factions/profile-faction.d.ts.map +1 -0
- package/dist/factions/profile-faction.js +63 -0
- package/dist/factions/profile-faction.js.map +1 -0
- 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/index.d.ts +27 -15
- package/dist/fleets/actions/index.d.ts.map +1 -1
- package/dist/fleets/actions/index.js +95 -52
- package/dist/fleets/actions/index.js.map +1 -1
- package/dist/fleets/actions/ship-import.d.ts +48 -0
- package/dist/fleets/actions/ship-import.d.ts.map +1 -0
- package/dist/fleets/actions/ship-import.js +322 -0
- package/dist/fleets/actions/ship-import.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 +3 -0
- package/dist/identity/actions/index.d.ts.map +1 -1
- package/dist/identity/actions/index.js +11 -10
- 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/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.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 +0 -27
- package/dist/internal/c4/claim-stake.d.ts.map +1 -1
- package/dist/internal/c4/claim-stake.js +0 -33
- 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 +10 -31
- package/dist/internal/c4/crafting.d.ts.map +1 -1
- package/dist/internal/c4/crafting.js +22 -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-enrollment.d.ts +6 -0
- package/dist/internal/c4/faction-enrollment.d.ts.map +1 -0
- package/dist/internal/c4/faction-enrollment.js +8 -0
- package/dist/internal/c4/faction-enrollment.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 +27 -0
- package/dist/internal/c4/fleet-arrival.d.ts.map +1 -0
- package/dist/internal/c4/fleet-arrival.js +39 -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-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 +10 -5
- package/dist/internal/c4/fleet.d.ts.map +1 -1
- package/dist/internal/c4/fleet.js.map +1 -1
- package/dist/internal/c4/game.d.ts +20 -6
- package/dist/internal/c4/game.d.ts.map +1 -1
- package/dist/internal/c4/game.js +39 -9
- package/dist/internal/c4/game.js.map +1 -1
- package/dist/internal/c4/identity.d.ts +2 -7
- package/dist/internal/c4/identity.d.ts.map +1 -1
- package/dist/internal/c4/identity.js +2 -23
- package/dist/internal/c4/identity.js.map +1 -1
- package/dist/internal/c4/legacy-cargo-config.d.ts +6 -0
- package/dist/internal/c4/legacy-cargo-config.d.ts.map +1 -0
- package/dist/internal/c4/legacy-cargo-config.js +26 -0
- package/dist/internal/c4/legacy-cargo-config.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 +1 -37
- package/dist/internal/c4/market.d.ts.map +1 -1
- package/dist/internal/c4/market.js +11 -49
- 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/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-faction.d.ts.map +1 -1
- package/dist/internal/c4/profile-faction.js +2 -0
- package/dist/internal/c4/profile-faction.js.map +1 -1
- 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/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/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 +11 -7
- 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/wallet-cargo-cache.d.ts +3 -0
- package/dist/internal/c4/wallet-cargo-cache.d.ts.map +1 -0
- package/dist/internal/c4/wallet-cargo-cache.js +24 -0
- package/dist/internal/c4/wallet-cargo-cache.js.map +1 -0
- package/dist/internal/c4/world.js +2 -1
- package/dist/internal/c4/world.js.map +1 -1
- package/dist/internal/fleet.d.ts.map +1 -1
- package/dist/internal/fleet.js +3 -1
- package/dist/internal/fleet.js.map +1 -1
- package/dist/internal/loyalty-atlas-bank-state.d.ts +16 -0
- package/dist/internal/loyalty-atlas-bank-state.d.ts.map +1 -0
- package/dist/internal/loyalty-atlas-bank-state.js +10 -0
- package/dist/internal/loyalty-atlas-bank-state.js.map +1 -0
- package/dist/internal/planning/account-state.d.ts +4 -0
- package/dist/internal/planning/account-state.d.ts.map +1 -0
- package/dist/internal/planning/account-state.js +11 -0
- package/dist/internal/planning/account-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 +231 -0
- package/dist/internal/planning/arrival-guards.js.map +1 -0
- package/dist/internal/planning/authorization-adapter.d.ts +19 -0
- package/dist/internal/planning/authorization-adapter.d.ts.map +1 -1
- package/dist/internal/planning/authorization-adapter.js +99 -0
- package/dist/internal/planning/authorization-adapter.js.map +1 -1
- 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 +12 -0
- package/dist/internal/planning/faction-enrollment.d.ts.map +1 -0
- package/dist/internal/planning/faction-enrollment.js +67 -0
- package/dist/internal/planning/faction-enrollment.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 +18 -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 +49 -0
- package/dist/internal/planning/fleet-arrival.d.ts.map +1 -0
- package/dist/internal/planning/fleet-arrival.js +135 -0
- package/dist/internal/planning/fleet-arrival.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-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/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/runtime-guards.d.ts +43 -0
- package/dist/internal/planning/runtime-guards.d.ts.map +1 -0
- package/dist/internal/planning/runtime-guards.js +552 -0
- package/dist/internal/planning/runtime-guards.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 +10 -0
- package/dist/internal/planning/ship-token.d.ts.map +1 -0
- package/dist/internal/planning/ship-token.js +47 -0
- package/dist/internal/planning/ship-token.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 +20 -0
- package/dist/internal/planning/xp-runtime.d.ts.map +1 -0
- package/dist/internal/planning/xp-runtime.js +96 -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 +1 -0
- package/dist/markets/actions/index.d.ts.map +1 -1
- package/dist/markets/actions/index.js +42 -16
- 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/mining/actions/index.d.ts +87 -0
- package/dist/mining/actions/index.d.ts.map +1 -0
- package/dist/mining/actions/index.js +317 -0
- package/dist/mining/actions/index.js.map +1 -0
- package/dist/planning/assembly.d.ts.map +1 -1
- package/dist/planning/assembly.js +6 -0
- package/dist/planning/assembly.js.map +1 -1
- package/dist/planning/execution.d.ts.map +1 -1
- package/dist/planning/execution.js +294 -17
- package/dist/planning/execution.js.map +1 -1
- package/dist/planning/index.d.ts +465 -5
- package/dist/planning/index.d.ts.map +1 -1
- package/dist/planning/index.js +649 -14
- package/dist/planning/index.js.map +1 -1
- package/dist/planning/simulation.d.ts +18 -1
- package/dist/planning/simulation.d.ts.map +1 -1
- package/dist/planning/simulation.js +56 -10
- package/dist/planning/simulation.js.map +1 -1
- package/dist/registry/cargo.d.ts +9 -6
- package/dist/registry/cargo.d.ts.map +1 -1
- package/dist/registry/cargo.js +30 -4
- package/dist/registry/cargo.js.map +1 -1
- package/dist/registry/onboarding.d.ts +2 -0
- package/dist/registry/onboarding.d.ts.map +1 -1
- package/dist/registry/onboarding.js +11 -6
- package/dist/registry/onboarding.js.map +1 -1
- package/dist/registry/ship-stats-snapshot.js +5 -5
- package/dist/registry/ship-stats-snapshot.js.map +1 -1
- package/dist/registry/ships.d.ts +28 -0
- package/dist/registry/ships.d.ts.map +1 -0
- package/dist/registry/ships.js +51 -0
- package/dist/registry/ships.js.map +1 -0
- 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/index.d.ts +1 -1
- package/dist/scanning/index.d.ts.map +1 -1
- package/dist/scanning/index.js +2 -2
- package/dist/scanning/index.js.map +1 -1
- package/package.json +10 -2
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { Address, SageContext } from '../../client/contracts.js';
|
|
2
|
+
import { type FleetArrivalJourney } from '../c4/fleet-arrival.js';
|
|
3
|
+
import type { PlanAuthorization } from './authorization-adapter.js';
|
|
4
|
+
export type FleetArrivalOptions = {
|
|
5
|
+
readonly funder: Address;
|
|
6
|
+
readonly authorization?: never;
|
|
7
|
+
} | {
|
|
8
|
+
readonly authorization: PlanAuthorization;
|
|
9
|
+
readonly funder?: never;
|
|
10
|
+
};
|
|
11
|
+
type ArrivalBase = {
|
|
12
|
+
readonly fleet: Address;
|
|
13
|
+
readonly game: Address;
|
|
14
|
+
readonly profile: Address;
|
|
15
|
+
readonly journey: FleetArrivalJourney;
|
|
16
|
+
};
|
|
17
|
+
export type FleetArrivalIntent = ArrivalBase & ({
|
|
18
|
+
readonly route: 'legacy';
|
|
19
|
+
readonly funder: Address;
|
|
20
|
+
readonly authorization?: never;
|
|
21
|
+
} | {
|
|
22
|
+
readonly route: 'authorized';
|
|
23
|
+
readonly authorization: Omit<PlanAuthorization, 'certificate'>;
|
|
24
|
+
readonly funder?: never;
|
|
25
|
+
});
|
|
26
|
+
/** Read fresh movement, chain time and direct authority without retaining signer data. */
|
|
27
|
+
export declare function resolveFleetArrival(ctx: SageContext, fleetAddress: Address, options: FleetArrivalOptions): Promise<{
|
|
28
|
+
intent: FleetArrivalIntent;
|
|
29
|
+
character: Address;
|
|
30
|
+
regionTracker: Address | undefined;
|
|
31
|
+
xp: {
|
|
32
|
+
readonly gameVersion: 0 | 2;
|
|
33
|
+
readonly intent: import("./xp-runtime.js").XpRuntimeIntent;
|
|
34
|
+
readonly accounts: import("./xp-runtime.js").XpRuntimeAccounts;
|
|
35
|
+
};
|
|
36
|
+
}>;
|
|
37
|
+
/** Recheck only the selected journey/authority, permitting unrelated Fleet and XP changes. */
|
|
38
|
+
export declare function validateFleetArrivalIntent(ctx: SageContext, intent: FleetArrivalIntent): Promise<{
|
|
39
|
+
intent: FleetArrivalIntent;
|
|
40
|
+
character: Address;
|
|
41
|
+
regionTracker: Address | undefined;
|
|
42
|
+
xp: {
|
|
43
|
+
readonly gameVersion: 0 | 2;
|
|
44
|
+
readonly intent: import("./xp-runtime.js").XpRuntimeIntent;
|
|
45
|
+
readonly accounts: import("./xp-runtime.js").XpRuntimeAccounts;
|
|
46
|
+
};
|
|
47
|
+
}>;
|
|
48
|
+
export {};
|
|
49
|
+
//# sourceMappingURL=fleet-arrival.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fleet-arrival.d.ts","sourceRoot":"","sources":["../../../src/internal/planning/fleet-arrival.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EAEP,WAAW,EACZ,MAAM,2BAA2B,CAAC;AAGnC,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,wBAAwB,CAAC;AAahC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAGpE,MAAM,MAAM,mBAAmB,GAC3B;IAAE,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,aAAa,CAAC,EAAE,KAAK,CAAA;CAAE,GAC5D;IAAE,QAAQ,CAAC,aAAa,EAAE,iBAAiB,CAAC;IAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC;AAC3E,KAAK,WAAW,GAAG;IACjB,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,OAAO,EAAE,mBAAmB,CAAC;CACvC,CAAC;AACF,MAAM,MAAM,kBAAkB,GAAG,WAAW,GAC1C,CACI;IACE,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,aAAa,CAAC,EAAE,KAAK,CAAC;CAChC,GACD;IACE,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC;IAC7B,QAAQ,CAAC,aAAa,EAAE,IAAI,CAAC,iBAAiB,EAAE,aAAa,CAAC,CAAC;IAC/D,QAAQ,CAAC,MAAM,CAAC,EAAE,KAAK,CAAC;CACzB,CACJ,CAAC;AAaJ,0FAA0F;AAC1F,wBAAsB,mBAAmB,CACvC,GAAG,EAAE,WAAW,EAChB,YAAY,EAAE,OAAO,EACrB,OAAO,EAAE,mBAAmB;;;;;;;;;GAiJ7B;AACD,8FAA8F;AAC9F,wBAAsB,0BAA0B,CAC9C,GAAG,EAAE,WAAW,EAChB,MAAM,EAAE,kBAAkB;;;;;;;;;GA2B3B"}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { SageSdkError } from '../../client/errors.js';
|
|
2
|
+
import { readContextRawAccounts } from '../../client/reconciliation.js';
|
|
3
|
+
import { decodeFleetArrival, } from '../c4/fleet-arrival.js';
|
|
4
|
+
import { findCharacterPda, characterAccountDefinition, profileAccountDefinition, } from '../c4/identity.js';
|
|
5
|
+
import { deriveRegionTrackerAddress, regionTrackerAccountDefinition, } from '../c4/factions.js';
|
|
6
|
+
import { PROFILE_SCOPE, SAGE_SCOPE } from '../c4/profile-permissions.js';
|
|
7
|
+
import { requireGameAddress } from '../game-context.js';
|
|
8
|
+
import { CLOCK_ADDRESS, readClock } from './faction-enrollment.js';
|
|
9
|
+
import { resolveXpRuntime } from './xp-runtime.js';
|
|
10
|
+
function fail(address, reason) {
|
|
11
|
+
throw new SageSdkError('ACTION_PRECONDITION_FAILED', `Arrival settlement ${reason}. Refresh the Fleet and prepare a new arrival Plan after completed travel.`, { address });
|
|
12
|
+
}
|
|
13
|
+
function required(raw, address) {
|
|
14
|
+
if (!raw || raw.address !== address || raw.executable)
|
|
15
|
+
fail(address, `requires the existing non-executable account ${address}`);
|
|
16
|
+
return raw;
|
|
17
|
+
}
|
|
18
|
+
/** Read fresh movement, chain time and direct authority without retaining signer data. */
|
|
19
|
+
export async function resolveFleetArrival(ctx, fleetAddress, options) {
|
|
20
|
+
const game = requireGameAddress(ctx);
|
|
21
|
+
const [fleetRaw, clockRaw] = await readContextRawAccounts(ctx, [
|
|
22
|
+
fleetAddress,
|
|
23
|
+
CLOCK_ADDRESS,
|
|
24
|
+
]);
|
|
25
|
+
const fleet = await decodeFleetArrival(required(fleetRaw, fleetAddress));
|
|
26
|
+
if (fleet.game !== game || fleet.canonical !== fleetAddress)
|
|
27
|
+
fail(fleetAddress, 'requires the canonical Fleet for the configured Game');
|
|
28
|
+
const journey = fleet.journey;
|
|
29
|
+
if (!journey)
|
|
30
|
+
fail(fleetAddress, 'requires a travelling Fleet; Idle and other non-travel states have no arrival to settle');
|
|
31
|
+
const now = readClock(required(clockRaw, CLOCK_ADDRESS));
|
|
32
|
+
if (journey.kind === 'subwarp'
|
|
33
|
+
? journey.duration < 0n
|
|
34
|
+
: journey.arrival < journey.departure)
|
|
35
|
+
fail(fleetAddress, 'found invalid journey timing');
|
|
36
|
+
if (now < journey.departure ||
|
|
37
|
+
(journey.kind === 'subwarp'
|
|
38
|
+
? (now - journey.departure) * (1n << 56n) < journey.duration
|
|
39
|
+
: now < journey.arrival))
|
|
40
|
+
fail(fleetAddress, 'cannot stop an unfinished journey that has not yet arrived; wait for chain time to reach the destination or choose the separate intentional early-stop action');
|
|
41
|
+
const character = await findCharacterPda(fleet.profile, game);
|
|
42
|
+
// Only the authorized route consumes Character XP. Legacy funders must receive
|
|
43
|
+
// an authorization remedy even when the XP budget is missing.
|
|
44
|
+
const xp = await resolveXpRuntime(ctx, {
|
|
45
|
+
game,
|
|
46
|
+
...(options.authorization ? { character } : {}),
|
|
47
|
+
});
|
|
48
|
+
if (xp.gameVersion === 2 && journey.kind === 'warp')
|
|
49
|
+
fail(fleetAddress, 'for Game version 2 warp is unsupported; wait for a separately supported warp settlement route');
|
|
50
|
+
if (xp.gameVersion === 2 && !options.authorization)
|
|
51
|
+
fail(fleetAddress, 'for this XP-era subwarp requires explicit Profile authorization; supply { authorization } rather than a funder');
|
|
52
|
+
if (xp.gameVersion === 0 && options.authorization)
|
|
53
|
+
fail(fleetAddress, 'on legacy Game version 0 requires an explicit funder; use the legacy { funder } route');
|
|
54
|
+
const regionTracker = options.authorization
|
|
55
|
+
? await deriveRegionTrackerAddress(game)
|
|
56
|
+
: undefined;
|
|
57
|
+
const addresses = [
|
|
58
|
+
character,
|
|
59
|
+
...(options.authorization ? [fleet.profile, regionTracker] : []),
|
|
60
|
+
];
|
|
61
|
+
const accounts = await readContextRawAccounts(ctx, addresses);
|
|
62
|
+
const characterData = characterAccountDefinition.decode(required(accounts[0], character));
|
|
63
|
+
if (characterData.game !== game ||
|
|
64
|
+
characterData.playerProfile !== fleet.profile)
|
|
65
|
+
fail(character, 'requires the canonical Character for this Game and owning Profile');
|
|
66
|
+
let intent;
|
|
67
|
+
if (options.authorization) {
|
|
68
|
+
const authorization = options.authorization;
|
|
69
|
+
if (authorization.certificate !== undefined ||
|
|
70
|
+
authorization.profile !== fleet.profile ||
|
|
71
|
+
// Fleet absence uses the zero/System address, not a Profile key scope.
|
|
72
|
+
fleet.subProfile !== '11111111111111111111111111111111')
|
|
73
|
+
fail(fleetAddress, 'supports only the owning Profile and its direct key, without a certificate or delegated sub-Profile');
|
|
74
|
+
if (!Number.isInteger(authorization.keyIndex) ||
|
|
75
|
+
authorization.keyIndex < 0 ||
|
|
76
|
+
authorization.keyIndex > 65535)
|
|
77
|
+
fail(fleet.profile, 'requires a valid direct Profile key index');
|
|
78
|
+
const profile = profileAccountDefinition.decode(required(accounts[1], fleet.profile));
|
|
79
|
+
const key = profile.keys[authorization.keyIndex];
|
|
80
|
+
if (!key || key.address !== authorization.authority)
|
|
81
|
+
fail(fleet.profile, 'requires the current direct key index for the selected authority');
|
|
82
|
+
if (key.expiresAtRaw >= 0n && key.expiresAtRaw < now)
|
|
83
|
+
fail(fleet.profile, 'cannot use an expired Profile key; renew it or select an unexpired direct key');
|
|
84
|
+
if (!((key.scope === PROFILE_SCOPE && (key.permissionsRaw & 1n) !== 0n) ||
|
|
85
|
+
(key.scope === SAGE_SCOPE && (key.permissionsRaw & (1n << 10n)) !== 0n)))
|
|
86
|
+
fail(fleet.profile, 'requires direct Profile AUTH or SAGE moveFleet permission; select an appropriately scoped key');
|
|
87
|
+
const tracker = regionTrackerAccountDefinition.decode(required(accounts[2], regionTracker));
|
|
88
|
+
if (tracker.game !== game)
|
|
89
|
+
fail(regionTracker, 'requires the canonical RegionTracker bound to this Game');
|
|
90
|
+
intent = {
|
|
91
|
+
fleet: fleetAddress,
|
|
92
|
+
game,
|
|
93
|
+
profile: fleet.profile,
|
|
94
|
+
journey,
|
|
95
|
+
route: 'authorized',
|
|
96
|
+
authorization: {
|
|
97
|
+
profile: authorization.profile,
|
|
98
|
+
authority: authorization.authority,
|
|
99
|
+
keyIndex: authorization.keyIndex,
|
|
100
|
+
},
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
else
|
|
104
|
+
intent = {
|
|
105
|
+
fleet: fleetAddress,
|
|
106
|
+
game,
|
|
107
|
+
profile: fleet.profile,
|
|
108
|
+
journey,
|
|
109
|
+
route: 'legacy',
|
|
110
|
+
funder: options.funder,
|
|
111
|
+
};
|
|
112
|
+
return { intent, character, regionTracker, xp };
|
|
113
|
+
}
|
|
114
|
+
/** Recheck only the selected journey/authority, permitting unrelated Fleet and XP changes. */
|
|
115
|
+
export async function validateFleetArrivalIntent(ctx, intent) {
|
|
116
|
+
const current = await resolveFleetArrival(ctx, intent.fleet, intent.route === 'authorized'
|
|
117
|
+
? { authorization: intent.authorization }
|
|
118
|
+
: { funder: intent.funder });
|
|
119
|
+
const a = intent.journey, b = current.intent.journey;
|
|
120
|
+
if (current.intent.game !== intent.game ||
|
|
121
|
+
current.intent.profile !== intent.profile ||
|
|
122
|
+
a.kind !== b.kind ||
|
|
123
|
+
a.departure !== b.departure ||
|
|
124
|
+
a.from.x !== b.from.x ||
|
|
125
|
+
a.from.y !== b.from.y ||
|
|
126
|
+
a.to.x !== b.to.x ||
|
|
127
|
+
a.to.y !== b.to.y ||
|
|
128
|
+
(a.kind === 'subwarp' &&
|
|
129
|
+
b.kind === 'subwarp' &&
|
|
130
|
+
a.duration !== b.duration) ||
|
|
131
|
+
(a.kind === 'warp' && b.kind === 'warp' && a.arrival !== b.arrival))
|
|
132
|
+
fail(intent.fleet, 'journey or ownership changed after planning');
|
|
133
|
+
return current;
|
|
134
|
+
}
|
|
135
|
+
//# sourceMappingURL=fleet-arrival.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fleet-arrival.js","sourceRoot":"","sources":["../../../src/internal/planning/fleet-arrival.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EACL,kBAAkB,GAEnB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,gBAAgB,EAChB,0BAA0B,EAC1B,wBAAwB,GACzB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,0BAA0B,EAC1B,8BAA8B,GAC/B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AACzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAwBnD,SAAS,IAAI,CAAC,OAAgB,EAAE,MAAc;IAC5C,MAAM,IAAI,YAAY,CACpB,4BAA4B,EAC5B,sBAAsB,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O,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { Address } from '@solana/kit';
|
|
2
|
+
import type { RawAccount } from '../../client/contracts.js';
|
|
3
|
+
export interface FleetCreationIntent {
|
|
4
|
+
readonly game: Address;
|
|
5
|
+
readonly profile: Address;
|
|
6
|
+
readonly authority: Address;
|
|
7
|
+
readonly system: Address;
|
|
8
|
+
readonly keyIndex: number;
|
|
9
|
+
readonly label: string;
|
|
10
|
+
}
|
|
11
|
+
export interface FleetCreationAccounts {
|
|
12
|
+
readonly game: Address;
|
|
13
|
+
readonly profile: Address;
|
|
14
|
+
readonly authority: Address;
|
|
15
|
+
readonly system: Address;
|
|
16
|
+
readonly character: Address;
|
|
17
|
+
readonly profileFaction: Address;
|
|
18
|
+
readonly starbasePlayer: Address;
|
|
19
|
+
readonly fleet: Address;
|
|
20
|
+
readonly rent: Address;
|
|
21
|
+
readonly clock: Address;
|
|
22
|
+
}
|
|
23
|
+
export declare function validateFleetCreationLabel(label: unknown): asserts label is string;
|
|
24
|
+
export declare function resolveFleetCreation(input: FleetCreationIntent): Promise<FleetCreationAccounts>;
|
|
25
|
+
export declare function validateFleetCreation(input: FleetCreationIntent, resolved: FleetCreationAccounts, accounts: ReadonlyMap<Address, RawAccount | undefined>, maximumProfileDebit?: bigint): Promise<{
|
|
26
|
+
profileDebit: bigint;
|
|
27
|
+
profileReserve: bigint;
|
|
28
|
+
fleetRent: bigint;
|
|
29
|
+
}>;
|
|
30
|
+
//# sourceMappingURL=fleet-creation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fleet-creation.d.ts","sourceRoot":"","sources":["../../../src/internal/planning/fleet-creation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AA8B5D,MAAM,WAAW,mBAAmB;IAClC,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+1,107 @@
|
|
|
1
|
+
import { InvalidActionInputError, SageSdkError } from '../../client/errors.js';
|
|
2
|
+
import { deriveFleetCreationAddress, emptyDockedFleetSize, } from '../c4/fleet-creation.js';
|
|
3
|
+
import { profileAccountDefinition, characterAccountDefinition, findCharacterPda, } from '../c4/identity.js';
|
|
4
|
+
import { profileFactionAccountDefinition, deriveProfileFactionAddress, } from '../c4/profile-faction.js';
|
|
5
|
+
import { starbasePlayerAccountDefinition, deriveStarbasePlayerAddress, } from '../c4/starbase.js';
|
|
6
|
+
import { starSystemAccountDefinition, deriveStarSystemAddress, } from '../c4/world.js';
|
|
7
|
+
import { PROFILE_SCOPE, SAGE_SCOPE } from '../c4/profile-permissions.js';
|
|
8
|
+
import { CLOCK_ADDRESS, RENT_ADDRESS, readClock, readRent, } from './faction-enrollment.js';
|
|
9
|
+
export function validateFleetCreationLabel(label) {
|
|
10
|
+
if (typeof label !== 'string' ||
|
|
11
|
+
label.trim().length === 0 ||
|
|
12
|
+
label.includes('\0') ||
|
|
13
|
+
new TextDecoder('utf-8', { ignoreBOM: true }).decode(new TextEncoder().encode(label)) !== label ||
|
|
14
|
+
new TextEncoder().encode(label).length > 64)
|
|
15
|
+
throw new InvalidActionInputError('options.label', label, 'a nonblank, valid UTF-8 Fleet label of at most 64 bytes without NUL', 'Choose a valid Fleet label. Accepted whitespace is preserved in the canonical Fleet address.');
|
|
16
|
+
}
|
|
17
|
+
export async function resolveFleetCreation(input) {
|
|
18
|
+
const intent = { ...input };
|
|
19
|
+
validateFleetCreationLabel(intent.label);
|
|
20
|
+
const [character, profileFaction, fleet] = await Promise.all([
|
|
21
|
+
findCharacterPda(intent.profile, intent.game),
|
|
22
|
+
deriveProfileFactionAddress(intent.profile),
|
|
23
|
+
deriveFleetCreationAddress(intent.game, intent.profile, intent.label),
|
|
24
|
+
]);
|
|
25
|
+
return {
|
|
26
|
+
game: intent.game,
|
|
27
|
+
profile: intent.profile,
|
|
28
|
+
authority: intent.authority,
|
|
29
|
+
system: intent.system,
|
|
30
|
+
character,
|
|
31
|
+
profileFaction,
|
|
32
|
+
fleet,
|
|
33
|
+
starbasePlayer: await deriveStarbasePlayerAddress(intent.system, character),
|
|
34
|
+
rent: RENT_ADDRESS,
|
|
35
|
+
clock: CLOCK_ADDRESS,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
function fail(address, message) {
|
|
39
|
+
throw new SageSdkError('ACTION_PRECONDITION_FAILED', message, { address });
|
|
40
|
+
}
|
|
41
|
+
export async function validateFleetCreation(input, resolved, accounts, maximumProfileDebit) {
|
|
42
|
+
const intent = { ...input };
|
|
43
|
+
const required = (address, name) => {
|
|
44
|
+
const raw = accounts.get(address);
|
|
45
|
+
if (!raw)
|
|
46
|
+
fail(address, `${name} ${address} is missing. Create or select the required account, then replan Fleet creation.`);
|
|
47
|
+
if (raw.address !== address || raw.executable)
|
|
48
|
+
fail(address, `${name} ${address} has a contradictory address or is executable. Refresh valid account state before creating a Fleet.`);
|
|
49
|
+
return raw;
|
|
50
|
+
};
|
|
51
|
+
const profileRaw = required(resolved.profile, 'Profile');
|
|
52
|
+
const profile = profileAccountDefinition.decode(profileRaw);
|
|
53
|
+
const character = characterAccountDefinition.decode(required(resolved.character, 'Character'));
|
|
54
|
+
const faction = profileFactionAccountDefinition.decode(required(resolved.profileFaction, 'ProfileFaction'));
|
|
55
|
+
const system = starSystemAccountDefinition.decode(required(resolved.system, 'Star System'));
|
|
56
|
+
const player = starbasePlayerAccountDefinition.decode(required(resolved.starbasePlayer, 'StarbasePlayer'));
|
|
57
|
+
if (character.game !== intent.game ||
|
|
58
|
+
character.playerProfile !== intent.profile)
|
|
59
|
+
fail(resolved.character, 'The Character belongs to a different Game or Profile. Refresh the canonical Character and replan Fleet creation.');
|
|
60
|
+
if (faction.profile !== intent.profile)
|
|
61
|
+
fail(resolved.profileFaction, 'The faction membership belongs to a different Profile. Refresh the canonical membership before creating a Fleet.');
|
|
62
|
+
if (system.game !== intent.game ||
|
|
63
|
+
(await deriveStarSystemAddress(system.game, system.systemId)) !==
|
|
64
|
+
intent.system ||
|
|
65
|
+
!system.starbase)
|
|
66
|
+
fail(resolved.system, 'The selected System is not canonical for this Game or has no Starbase. Choose a valid Starbase System and replan.');
|
|
67
|
+
if (player.playerProfile !== intent.profile ||
|
|
68
|
+
player.character !== resolved.character ||
|
|
69
|
+
player.system !== intent.system ||
|
|
70
|
+
player.faction !== faction.faction)
|
|
71
|
+
fail(resolved.starbasePlayer, 'The StarbasePlayer has a different Profile, Character, System or faction relationship. Refresh the canonical StarbasePlayer and replan.');
|
|
72
|
+
if (faction.faction === 'unaligned' ||
|
|
73
|
+
system.starbase.owner !== faction.faction)
|
|
74
|
+
fail(resolved.system, 'This planner supports an existing own-faction StarbasePlayer only. Select an own-faction Starbase; other diplomacy or access routes require separate supported planning.');
|
|
75
|
+
if (character.counts.fleets >= character.modifiers.values.fleetConcurrency)
|
|
76
|
+
fail(resolved.character, 'The Character has no available Fleet slots in its current stored capacity. Free a Fleet slot or refresh changed Character modifiers, then replan.');
|
|
77
|
+
const target = accounts.get(resolved.fleet);
|
|
78
|
+
if (target &&
|
|
79
|
+
(target.address !== resolved.fleet ||
|
|
80
|
+
target.executable ||
|
|
81
|
+
target.owner !== '11111111111111111111111111111111' ||
|
|
82
|
+
target.data.length !== 0))
|
|
83
|
+
fail(resolved.fleet, 'The canonical Fleet target already contains state or has a conflicting owner. Reuse the existing Fleet or choose a different label and replan.');
|
|
84
|
+
const rent = readRent(required(resolved.rent, 'Rent sysvar'));
|
|
85
|
+
const now = readClock(required(resolved.clock, 'Clock sysvar'));
|
|
86
|
+
const fleetRent = rent(emptyDockedFleetSize());
|
|
87
|
+
const balance = target?.lamports ?? 0n;
|
|
88
|
+
const profileDebit = balance < fleetRent ? fleetRent - balance : 0n;
|
|
89
|
+
if (maximumProfileDebit !== undefined && profileDebit > maximumProfileDebit)
|
|
90
|
+
fail(resolved.profile, 'Fleet creation now requires a larger Profile debit than this Plan approved. Replan and inspect the updated rent shortfall before signing.');
|
|
91
|
+
const profileReserve = rent(profileRaw.data.length);
|
|
92
|
+
if (profileRaw.lamports < profileReserve + profileDebit)
|
|
93
|
+
fail(resolved.profile, 'The Profile lacks the Fleet rent shortfall while preserving its own rent reserve. Fund the Profile or Fleet target explicitly, then replan.');
|
|
94
|
+
const key = profile.keys[intent.keyIndex];
|
|
95
|
+
if (!key || key.address !== intent.authority)
|
|
96
|
+
fail(resolved.profile, 'The selected direct Profile key is absent or belongs to another authority. Select the current key index for this authority and replan.');
|
|
97
|
+
if (key.expiresAtRaw >= 0n && key.expiresAtRaw < now)
|
|
98
|
+
fail(resolved.profile, 'The selected Profile key has expired. Renew it or select a current direct key and replan Fleet creation.');
|
|
99
|
+
const auth = key.scope === PROFILE_SCOPE && (key.permissionsRaw & 1n) !== 0n;
|
|
100
|
+
const manages = key.scope === SAGE_SCOPE && (key.permissionsRaw & (1n << 18n)) !== 0n;
|
|
101
|
+
if (!auth && !manages)
|
|
102
|
+
fail(resolved.profile, 'The selected key cannot manage Fleets. Use a direct Profile AUTH key or a SAGE manageFleet key and replan.');
|
|
103
|
+
if (profileDebit > 0n && !auth && (key.permissionsRaw & (1n << 63n)) === 0n)
|
|
104
|
+
fail(resolved.profile, 'The selected manageFleet key cannot fund the Fleet from the Profile vault. Explicitly prefund the target or choose an authorized vault-funding key, then replan; drainSolVault grants vault withdrawal authority.');
|
|
105
|
+
return { profileDebit, profileReserve, fleetRent };
|
|
106
|
+
}
|
|
107
|
+
//# sourceMappingURL=fleet-creation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fleet-creation.js","sourceRoot":"","sources":["../../../src/internal/planning/fleet-creation.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,uBAAuB,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC/E,OAAO,EACL,0BAA0B,EAC1B,oBAAoB,GACrB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,wBAAwB,EACxB,0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ACpN,CAAC;IACJ,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,SAAS,EAAE,CAAC;AACrD,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { type ShipAssemblyCatalog } from '../../registry/ships.js';
|
|
2
|
+
import { type Address } from '@solana/kit';
|
|
3
|
+
import type { RawAccount } from '../../client/contracts.js';
|
|
4
|
+
export interface FleetShipAssemblyIntent {
|
|
5
|
+
readonly address: Address;
|
|
6
|
+
readonly game: Address;
|
|
7
|
+
readonly profile: Address;
|
|
8
|
+
readonly authority: Address;
|
|
9
|
+
readonly system: Address;
|
|
10
|
+
readonly keyIndex: number;
|
|
11
|
+
readonly shipId: number;
|
|
12
|
+
readonly amount: bigint;
|
|
13
|
+
}
|
|
14
|
+
export interface FleetShipAssemblyAccounts {
|
|
15
|
+
readonly game: Address;
|
|
16
|
+
readonly profile: Address;
|
|
17
|
+
readonly authority: Address;
|
|
18
|
+
readonly system: Address;
|
|
19
|
+
readonly character: Address;
|
|
20
|
+
readonly profileFaction: Address;
|
|
21
|
+
readonly starbasePlayer: Address;
|
|
22
|
+
readonly fleet: Address;
|
|
23
|
+
readonly rent: Address;
|
|
24
|
+
readonly clock: Address;
|
|
25
|
+
}
|
|
26
|
+
export declare function resolveFleetShipAssembly(input: FleetShipAssemblyIntent): Promise<FleetShipAssemblyAccounts>;
|
|
27
|
+
export declare function validateFleetShipAssembly(input: FleetShipAssemblyIntent, resolved: FleetShipAssemblyAccounts, accounts: ReadonlyMap<Address, RawAccount | undefined>, expected?: {
|
|
28
|
+
readonly configHash: string;
|
|
29
|
+
readonly maximumProfileDebit: bigint;
|
|
30
|
+
}, catalog?: ShipAssemblyCatalog): Promise<{
|
|
31
|
+
profileDebit: bigint;
|
|
32
|
+
profileReserve: bigint;
|
|
33
|
+
fleetRent: bigint;
|
|
34
|
+
configHash: string;
|
|
35
|
+
}>;
|
|
36
|
+
//# sourceMappingURL=fleet-ship-assembly.d.ts.map
|
|
@@ -0,0 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AAID,wBAAsB,yBAAyB,CAC7C,KAAK,EAAE,uBAAuB,EAC9B,QAAQ,EAAE,yBAAyB,EACnC,QAAQ,EAAE,WAAW,CAAC,OAAO,EAAE,UAAU,GAAG,SAAS,CAAC,EACtD,QAAQ,CAAC,EAAE;IACT,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,mBAAmB,EAAE,MAAM,CAAC;CACtC,EACD,OAAO,CAAC,EAAE,mBAAmB,GAC5B,OAAO,CAAC;IACT,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC,CA0MD"}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { fleetAccountDefinition, deriveFleetAddress } from '../c4/fleet.js';
|
|
2
|
+
import { fleetShipAssemblySize, isBasicFleetAssemblyShip, } from '../c4/fleet-ship-assembly.js';
|
|
3
|
+
import { decodeGameShipAssemblyCatalog, hashShipAssemblyConfiguration, } from '../../registry/ships.js';
|
|
4
|
+
import { isOffCurveAddress } from '@solana/kit';
|
|
5
|
+
import { SageSdkError } from '../../client/errors.js';
|
|
6
|
+
import { profileAccountDefinition, characterAccountDefinition, findCharacterPda, } from '../c4/identity.js';
|
|
7
|
+
import { profileFactionAccountDefinition, deriveProfileFactionAddress, } from '../c4/profile-faction.js';
|
|
8
|
+
import { starbasePlayerAccountDefinition, deriveStarbasePlayerAddress, } from '../c4/starbase.js';
|
|
9
|
+
import { starSystemAccountDefinition, deriveStarSystemAddress, } from '../c4/world.js';
|
|
10
|
+
import { PROFILE_SCOPE, SAGE_SCOPE } from '../c4/profile-permissions.js';
|
|
11
|
+
import { CLOCK_ADDRESS, RENT_ADDRESS, readClock, readRent, } from './faction-enrollment.js';
|
|
12
|
+
export async function resolveFleetShipAssembly(input) {
|
|
13
|
+
const intent = { ...input };
|
|
14
|
+
const [character, profileFaction] = await Promise.all([
|
|
15
|
+
findCharacterPda(intent.profile, intent.game),
|
|
16
|
+
deriveProfileFactionAddress(intent.profile),
|
|
17
|
+
]);
|
|
18
|
+
return {
|
|
19
|
+
game: intent.game,
|
|
20
|
+
profile: intent.profile,
|
|
21
|
+
authority: intent.authority,
|
|
22
|
+
system: intent.system,
|
|
23
|
+
character,
|
|
24
|
+
profileFaction,
|
|
25
|
+
fleet: intent.address,
|
|
26
|
+
starbasePlayer: await deriveStarbasePlayerAddress(intent.system, character),
|
|
27
|
+
rent: RENT_ADDRESS,
|
|
28
|
+
clock: CLOCK_ADDRESS,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
function fail(address, message) {
|
|
32
|
+
throw new SageSdkError('ACTION_PRECONDITION_FAILED', message, { address });
|
|
33
|
+
}
|
|
34
|
+
export async function validateFleetShipAssembly(input, resolved, accounts, expected, catalog) {
|
|
35
|
+
const intent = { ...input };
|
|
36
|
+
if (isOffCurveAddress(intent.authority))
|
|
37
|
+
fail(intent.profile, 'Ship assembly requires an on-curve direct Profile authority. Select a current direct key and replan.');
|
|
38
|
+
const required = (address, name) => {
|
|
39
|
+
const raw = accounts.get(address);
|
|
40
|
+
if (!raw)
|
|
41
|
+
fail(address, `${name} ${address} is missing. Create or select the required account, then replan ship assembly.`);
|
|
42
|
+
if (raw.address !== address || raw.executable)
|
|
43
|
+
fail(address, `${name} ${address} has a contradictory address or is executable. Refresh valid account state before assembling ships.`);
|
|
44
|
+
return raw;
|
|
45
|
+
};
|
|
46
|
+
const profileRaw = required(resolved.profile, 'Profile');
|
|
47
|
+
const profile = profileAccountDefinition.decode(profileRaw);
|
|
48
|
+
const character = characterAccountDefinition.decode(required(resolved.character, 'Character'));
|
|
49
|
+
const faction = profileFactionAccountDefinition.decode(required(resolved.profileFaction, 'ProfileFaction'));
|
|
50
|
+
const system = starSystemAccountDefinition.decode(required(resolved.system, 'Star System'));
|
|
51
|
+
const player = starbasePlayerAccountDefinition.decode(required(resolved.starbasePlayer, 'StarbasePlayer'));
|
|
52
|
+
if (character.game !== intent.game ||
|
|
53
|
+
character.playerProfile !== intent.profile)
|
|
54
|
+
fail(resolved.character, 'The Character belongs to a different Game or Profile. Refresh the canonical Character and replan ship assembly.');
|
|
55
|
+
if (faction.profile !== intent.profile)
|
|
56
|
+
fail(resolved.profileFaction, 'The faction membership belongs to a different Profile. Refresh the canonical membership before assembling ships.');
|
|
57
|
+
if (system.game !== intent.game ||
|
|
58
|
+
(await deriveStarSystemAddress(system.game, system.systemId)) !==
|
|
59
|
+
intent.system ||
|
|
60
|
+
!system.starbase)
|
|
61
|
+
fail(resolved.system, 'The selected System is not canonical for this Game or has no Starbase. Choose a valid Starbase System and replan.');
|
|
62
|
+
if (player.playerProfile !== intent.profile ||
|
|
63
|
+
player.character !== resolved.character ||
|
|
64
|
+
player.system !== intent.system ||
|
|
65
|
+
player.faction !== faction.faction)
|
|
66
|
+
fail(resolved.starbasePlayer, 'The StarbasePlayer has a different Profile, Character, System or faction relationship. Refresh the canonical StarbasePlayer and replan.');
|
|
67
|
+
if (faction.faction === 'unaligned' ||
|
|
68
|
+
system.starbase.owner !== faction.faction)
|
|
69
|
+
fail(resolved.system, 'This planner supports an existing own-faction StarbasePlayer only. Select an own-faction Starbase; other diplomacy or access routes require separate supported planning.');
|
|
70
|
+
if (system.starbase.level !== 'css')
|
|
71
|
+
fail(resolved.system, 'Ship assembly currently supports own-faction CSS Starbases only. Dock at an own-faction CSS Starbase and replan; other access routes need separate support.');
|
|
72
|
+
const fleetRaw = required(resolved.fleet, 'Fleet');
|
|
73
|
+
const fleet = fleetAccountDefinition.decode(fleetRaw);
|
|
74
|
+
if ((await deriveFleetAddress(fleet)) !== intent.address ||
|
|
75
|
+
fleet.game !== intent.game ||
|
|
76
|
+
fleet.ownerProfile !== intent.profile ||
|
|
77
|
+
fleet.faction !== faction.faction ||
|
|
78
|
+
fleet.npcFactionId !== 0)
|
|
79
|
+
fail(resolved.fleet, 'The Fleet has a noncanonical address or different Game, Profile, faction or NPC affiliation. Select a canonical owned player Fleet and replan ship assembly.');
|
|
80
|
+
if (fleet.state.kind !== 'docked' || fleet.state.system !== intent.system)
|
|
81
|
+
fail(resolved.fleet, 'Ship assembly requires the Fleet to remain Docked at the selected System. Dock at an own-faction CSS Starbase and replan.');
|
|
82
|
+
const gameRaw = required(resolved.game, 'Game');
|
|
83
|
+
const definitions = catalog ?? decodeGameShipAssemblyCatalog(gameRaw);
|
|
84
|
+
if (fleet.shipDefinitionsSeqId !== definitions.sequenceId)
|
|
85
|
+
fail(resolved.fleet, 'This SDK route supports current ship-definition sequences only. Refresh the Fleet definitions through a supported game client, then replan; stale-sequence refresh behavior remains chain-authoritative.');
|
|
86
|
+
const selected = definitions.rows.find((row) => row.id === intent.shipId);
|
|
87
|
+
if (!isBasicFleetAssemblyShip(selected))
|
|
88
|
+
fail(resolved.game, 'The selected ship ID is unresolved or is not a requirements-free XXS configuration. Select a defined requirements-free XXS configuration; research, component and other size routes need separate support.');
|
|
89
|
+
// Every validated stored maxShipSize enum permits XXS, the smallest pinned size.
|
|
90
|
+
let quantity = 0n;
|
|
91
|
+
for (const entry of fleet.fleetShips) {
|
|
92
|
+
if (entry.quantity === 0n)
|
|
93
|
+
continue;
|
|
94
|
+
if (!isBasicFleetAssemblyShip(definitions.rows.find((row) => row.id === entry.shipId)))
|
|
95
|
+
fail(resolved.fleet, 'The Fleet already contains a positive unresolved or unsupported ship configuration. Use a Fleet containing only resolved requirements-free XXS ships; mixed-size capacity needs separate support.');
|
|
96
|
+
quantity += entry.quantity;
|
|
97
|
+
}
|
|
98
|
+
const current = fleet.fleetShips.find((entry) => entry.shipId === intent.shipId)
|
|
99
|
+
?.quantity ?? 0n;
|
|
100
|
+
if (current + intent.amount > 18446744073709551615n)
|
|
101
|
+
fail(resolved.fleet, 'The resulting Fleet ship quantity exceeds the stored u64 limit. Select a smaller valid quantity and replan.');
|
|
102
|
+
if (quantity + intent.amount > BigInt(character.modifiers.values.fleetSize))
|
|
103
|
+
fail(resolved.character, 'The requested ships exceed the Character stored Fleet-size capacity. Reduce the amount or refresh changed Character modifiers, then replan.');
|
|
104
|
+
if (quantity + intent.amount > BigInt(definitions.maxFleetSize))
|
|
105
|
+
fail(resolved.game, 'The requested ships exceed the Game ship-assembly capacity. Reduce the resulting Fleet composition to fit the current Game limit, then replan; a larger Character allowance does not override it.');
|
|
106
|
+
const entitlement = player.shipsInEscrow.find((entry) => entry.shipId === intent.shipId)
|
|
107
|
+
?.quantityRaw ?? 0n;
|
|
108
|
+
if (entitlement < intent.amount)
|
|
109
|
+
fail(resolved.starbasePlayer, 'The StarbasePlayer has insufficient entitlement for this exact ship configuration. Explicitly import that configuration or reduce the amount, then replan.');
|
|
110
|
+
const configHash = await hashShipAssemblyConfiguration(definitions, selected);
|
|
111
|
+
if (expected && expected.configHash !== configHash)
|
|
112
|
+
fail(resolved.game, 'The selected ship configuration has changed. Replan and inspect its current configuration before signing.');
|
|
113
|
+
const rent = readRent(required(resolved.rent, 'Rent sysvar'));
|
|
114
|
+
const now = readClock(required(resolved.clock, 'Clock sysvar'));
|
|
115
|
+
const fleetRent = rent(fleetShipAssemblySize(fleetRaw, intent.shipId, intent.amount));
|
|
116
|
+
const balance = fleetRaw.lamports;
|
|
117
|
+
const profileDebit = balance < fleetRent ? fleetRent - balance : 0n;
|
|
118
|
+
if (expected !== undefined && profileDebit > expected.maximumProfileDebit)
|
|
119
|
+
fail(resolved.profile, 'Ship assembly now requires a larger Profile debit than this Plan approved. Replan and inspect the updated rent shortfall before signing.');
|
|
120
|
+
const profileReserve = rent(profileRaw.data.length);
|
|
121
|
+
if (profileRaw.lamports < profileReserve + profileDebit)
|
|
122
|
+
fail(resolved.profile, 'The Profile lacks the Fleet rent shortfall while preserving its own rent reserve. Fund the Profile or Fleet target explicitly, then replan.');
|
|
123
|
+
const key = profile.keys[intent.keyIndex];
|
|
124
|
+
if (!key || key.address !== intent.authority)
|
|
125
|
+
fail(resolved.profile, 'The selected direct Profile key is absent or belongs to another authority. Select the current key index for this authority and replan.');
|
|
126
|
+
if (key.expiresAtRaw >= 0n && key.expiresAtRaw < now)
|
|
127
|
+
fail(resolved.profile, 'The selected Profile key has expired. Renew it or select a current direct key and replan ship assembly.');
|
|
128
|
+
const auth = key.scope === PROFILE_SCOPE && (key.permissionsRaw & 1n) !== 0n;
|
|
129
|
+
const manages = key.scope === SAGE_SCOPE && (key.permissionsRaw & (1n << 18n)) !== 0n;
|
|
130
|
+
if (!auth && !manages)
|
|
131
|
+
fail(resolved.profile, 'The selected key cannot manage Fleets. Use a direct Profile AUTH key or a SAGE manageFleet key and replan.');
|
|
132
|
+
if (profileDebit > 0n && !auth && (key.permissionsRaw & (1n << 63n)) === 0n)
|
|
133
|
+
fail(resolved.profile, 'The selected manageFleet key cannot fund the Fleet from the Profile vault. Explicitly prefund the target or choose an authorized vault-funding key, then replan; drainSolVault grants vault withdrawal authority.');
|
|
134
|
+
return { profileDebit, profileReserve, fleetRent, configHash };
|
|
135
|
+
}
|
|
136
|
+
//# sourceMappingURL=fleet-ship-assembly.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fleet-ship-assembly.js","sourceRoot":"","sources":["../../../src/internal/planning/fleet-ship-assembly.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EACL,qBAAqB,EACrB,wBAAwB,GACzB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,6BAA6B,EAC7B,6BAA6B,GAE9B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAgB,MAAM,aAAa,CAAC;AAE9D,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEtD,OAAO,EACL,wBAAwB,EACxB,0BAA0B,EAC1B,gBAAgB,GACjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,+BAA+B,EAC/B,2BAA2B,GAC5B,MAAM,0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GAAG,GAAG,CAAC,KAAK,KAAK,aAAa,IAAI,CAAC,GAAG,CAAC,cAAc,GAAG,EAAE,CAAC,KAAK,EAAE,CAAC;IAC7E,MAAM,OAAO,GACX,GAAG,CAAC,KAAK,KAAK,UAAU,IAAI,CAAC,GAAG,CAAC,cAAc,GAAG,CAAC,EAAE,IAAI,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC;IACxE,IAAI,CAAC,IAAI,IAAI,CAAC,OAAO;QACnB,IAAI,CACF,QAAQ,CAAC,OAAO,EAChB,4GAA4G,CAC7G,CAAC;IACJ,IAAI,YAAY,GAAG,EAAE,IAAI,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,cAAc,GAAG,CAAC,EAAE,IAAI,GAAG,CAAC,CAAC,KAAK,EAAE;QACzE,IAAI,CACF,QAAQ,CAAC,OAAO,EAChB,mNAAmN,CACpN,CAAC;IACJ,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC;AACjE,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { Address, SageContext } from '../../client/contracts.js';
|
|
2
|
+
import { type CraftingProcessAccountData } from '../c4/crafting.js';
|
|
3
|
+
import type { ResolvedDemocracyHistory } from './democracy-history.js';
|
|
4
|
+
export interface FeeRequest {
|
|
5
|
+
readonly game: Address;
|
|
6
|
+
readonly system: Address;
|
|
7
|
+
readonly starbaseSeqId: bigint;
|
|
8
|
+
readonly mode: 'market' | 'crafting-start' | 'crafting-complete';
|
|
9
|
+
readonly hasHab?: boolean;
|
|
10
|
+
readonly process?: Address;
|
|
11
|
+
}
|
|
12
|
+
export interface FeeParams {
|
|
13
|
+
readonly craftingFeeBps: number;
|
|
14
|
+
readonly localMarketFeeBps: number;
|
|
15
|
+
readonly localTreasuryShareBps: number;
|
|
16
|
+
readonly treasuryDistributionBps?: number;
|
|
17
|
+
}
|
|
18
|
+
export interface FeeIntent {
|
|
19
|
+
readonly request: FeeRequest;
|
|
20
|
+
readonly governance?: {
|
|
21
|
+
readonly address: Address;
|
|
22
|
+
readonly state: 'absent' | 'initialized';
|
|
23
|
+
readonly version?: number;
|
|
24
|
+
readonly enabled?: number;
|
|
25
|
+
readonly controllerFaction?: number;
|
|
26
|
+
readonly starbaseSeqId?: bigint;
|
|
27
|
+
readonly activeParams?: FeeParams;
|
|
28
|
+
};
|
|
29
|
+
readonly currencyCache?: {
|
|
30
|
+
readonly address: Address;
|
|
31
|
+
readonly version: number;
|
|
32
|
+
};
|
|
33
|
+
readonly treasury?: {
|
|
34
|
+
readonly address: Address;
|
|
35
|
+
readonly state: 'absent' | 'initialized';
|
|
36
|
+
readonly version?: number;
|
|
37
|
+
readonly governance?: Address;
|
|
38
|
+
};
|
|
39
|
+
readonly process?: {
|
|
40
|
+
readonly address: Address;
|
|
41
|
+
readonly version: number;
|
|
42
|
+
readonly feeRecipient?: 'atlas' | 'dao-atlas';
|
|
43
|
+
readonly feeGovernance?: Address;
|
|
44
|
+
readonly feeSnapshot?: CraftingProcessAccountData['feeSnapshot'];
|
|
45
|
+
};
|
|
46
|
+
readonly quote: {
|
|
47
|
+
readonly source: 'default' | 'governance' | 'history-policy' | 'history-generation' | 'history-disabled' | 'process-snapshot' | 'legacy-process';
|
|
48
|
+
readonly params?: FeeParams;
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
export interface ResolvedGovernanceFees {
|
|
52
|
+
readonly intent: FeeIntent;
|
|
53
|
+
readonly accounts: {
|
|
54
|
+
readonly starbaseGovernance?: Address;
|
|
55
|
+
readonly currencyCache?: Address;
|
|
56
|
+
readonly starbaseTreasury?: Address;
|
|
57
|
+
};
|
|
58
|
+
readonly description: string;
|
|
59
|
+
}
|
|
60
|
+
/** Resolve current fee accounts and a finite quote without creating or funding anything. */
|
|
61
|
+
export declare function resolveGovernanceFees(ctx: SageContext, request: FeeRequest, history: ResolvedDemocracyHistory): Promise<ResolvedGovernanceFees>;
|
|
62
|
+
/** Compare finite serialized fields; mutable shared balances are deliberately absent. */
|
|
63
|
+
export declare function matchGovernanceFeesIntent(expected: FeeIntent, actual: FeeIntent): boolean;
|
|
64
|
+
//# sourceMappingURL=governance-fees.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"governance-fees.d.ts","sourceRoot":"","sources":["../../../src/internal/planning/governance-fees.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,OAAO,EAEP,WAAW,EACZ,MAAM,2BAA2B,CAAC;AAiBnC,OAAO,EAEL,KAAK,0BAA0B,EAChC,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAEvE,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,IAAI,EAAE,QAAQ,GAAG,gBAAgB,GAAG,mBAAmB,CAAC;IACjE,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;CAC5B;AACD,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,qBAAqB,EAAE,MAAM,CAAC;IACvC,QAAQ,CAAC,uBAAuB,CAAC,EAAE,MAAM,CAAC;CAC3C;AACD,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAC;IAC7B,QAAQ,CAAC,UAAU,CAAC,EAAE;QACpB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;QAC1B,QAAQ,CAAC,KAAK,EAAE,QAAQ,GAAG,aAAa,CAAC;QACzC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,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