@aephia/atlas-kit 0.6.0-next.134 → 0.6.0-next.136

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.
Files changed (79) hide show
  1. package/dist/cargo/actions/deposit.d.ts.map +1 -1
  2. package/dist/cargo/actions/deposit.js +15 -15
  3. package/dist/cargo/actions/deposit.js.map +1 -1
  4. package/dist/cargo/actions/index.d.ts.map +1 -1
  5. package/dist/cargo/actions/index.js +20 -15
  6. package/dist/cargo/actions/index.js.map +1 -1
  7. package/dist/crafting/actions/index.d.ts +12 -13
  8. package/dist/crafting/actions/index.d.ts.map +1 -1
  9. package/dist/crafting/actions/index.js +29 -17
  10. package/dist/crafting/actions/index.js.map +1 -1
  11. package/dist/fleets/actions/crew-transfer.d.ts +4 -3
  12. package/dist/fleets/actions/crew-transfer.d.ts.map +1 -1
  13. package/dist/fleets/actions/crew-transfer.js +4 -3
  14. package/dist/fleets/actions/crew-transfer.js.map +1 -1
  15. package/dist/fleets/actions/index.d.ts +8 -0
  16. package/dist/fleets/actions/index.d.ts.map +1 -1
  17. package/dist/fleets/actions/index.js +37 -11
  18. package/dist/fleets/actions/index.js.map +1 -1
  19. package/dist/internal/c4/discriminators.d.ts +1 -0
  20. package/dist/internal/c4/discriminators.d.ts.map +1 -1
  21. package/dist/internal/c4/discriminators.js +3 -1
  22. package/dist/internal/c4/discriminators.js.map +1 -1
  23. package/dist/internal/c4/fleet-storage.d.ts +36 -0
  24. package/dist/internal/c4/fleet-storage.d.ts.map +1 -0
  25. package/dist/internal/c4/fleet-storage.js +72 -0
  26. package/dist/internal/c4/fleet-storage.js.map +1 -0
  27. package/dist/internal/planning/cargo-storage-actions.d.ts +8 -0
  28. package/dist/internal/planning/cargo-storage-actions.d.ts.map +1 -0
  29. package/dist/internal/planning/cargo-storage-actions.js +97 -0
  30. package/dist/internal/planning/cargo-storage-actions.js.map +1 -0
  31. package/dist/internal/planning/fleet-crew-transfer.d.ts.map +1 -1
  32. package/dist/internal/planning/fleet-crew-transfer.js +9 -3
  33. package/dist/internal/planning/fleet-crew-transfer.js.map +1 -1
  34. package/dist/internal/planning/fleet-dock-funding.d.ts.map +1 -1
  35. package/dist/internal/planning/fleet-dock-funding.js +10 -0
  36. package/dist/internal/planning/fleet-dock-funding.js.map +1 -1
  37. package/dist/internal/planning/mining-storage-actions.d.ts +11 -0
  38. package/dist/internal/planning/mining-storage-actions.d.ts.map +1 -0
  39. package/dist/internal/planning/mining-storage-actions.js +66 -0
  40. package/dist/internal/planning/mining-storage-actions.js.map +1 -0
  41. package/dist/internal/planning/open-signal.d.ts.map +1 -1
  42. package/dist/internal/planning/open-signal.js +9 -0
  43. package/dist/internal/planning/open-signal.js.map +1 -1
  44. package/dist/internal/planning/profile-storage-funding-guard.d.ts +17 -10
  45. package/dist/internal/planning/profile-storage-funding-guard.d.ts.map +1 -1
  46. package/dist/internal/planning/profile-storage-funding-guard.js +32 -64
  47. package/dist/internal/planning/profile-storage-funding-guard.js.map +1 -1
  48. package/dist/internal/planning/profile-storage-funding.d.ts +13 -13
  49. package/dist/internal/planning/profile-storage-funding.d.ts.map +1 -1
  50. package/dist/internal/planning/profile-storage-funding.js +19 -23
  51. package/dist/internal/planning/profile-storage-funding.js.map +1 -1
  52. package/dist/internal/planning/storage-action-readers.d.ts +10 -0
  53. package/dist/internal/planning/storage-action-readers.d.ts.map +1 -0
  54. package/dist/internal/planning/storage-action-readers.js +25 -0
  55. package/dist/internal/planning/storage-action-readers.js.map +1 -0
  56. package/dist/internal/planning/storage-actions.d.ts +81 -0
  57. package/dist/internal/planning/storage-actions.d.ts.map +1 -0
  58. package/dist/internal/planning/storage-actions.js +177 -0
  59. package/dist/internal/planning/storage-actions.js.map +1 -0
  60. package/dist/markets/actions/trade-faction-market.d.ts +2 -0
  61. package/dist/markets/actions/trade-faction-market.d.ts.map +1 -1
  62. package/dist/markets/actions/trade-faction-market.js +10 -0
  63. package/dist/markets/actions/trade-faction-market.js.map +1 -1
  64. package/dist/mining/actions/index.d.ts.map +1 -1
  65. package/dist/mining/actions/index.js +71 -25
  66. package/dist/mining/actions/index.js.map +1 -1
  67. package/dist/planning/execution.d.ts.map +1 -1
  68. package/dist/planning/execution.js +11 -10
  69. package/dist/planning/execution.js.map +1 -1
  70. package/dist/planning/index.d.ts +2 -12
  71. package/dist/planning/index.d.ts.map +1 -1
  72. package/dist/planning/index.js +2 -2
  73. package/dist/planning/index.js.map +1 -1
  74. package/dist/planning/plan-construction.js +1 -1
  75. package/package.json +1 -1
  76. package/dist/internal/planning/cargo-storage.d.ts +0 -71
  77. package/dist/internal/planning/cargo-storage.d.ts.map +0 -1
  78. package/dist/internal/planning/cargo-storage.js +0 -274
  79. package/dist/internal/planning/cargo-storage.js.map +0 -1
@@ -1,20 +1,22 @@
1
1
  import type { Address } from '@solana/kit';
2
2
  import type { RawAccount } from '../../client/contracts.js';
3
3
  import type { ProfileStorageFundingGuard } from './profile-storage-funding-guard.js';
4
- /** One resized account: its observed data length and the action's byte change. */
5
- export interface StorageResize {
6
- readonly raw: RawAccount;
7
- readonly growthBytes: number;
8
- }
9
- /** The one or two accounts an action resizes. */
10
- export type StorageResizes = readonly [StorageResize] | readonly [StorageResize, StorageResize];
11
- /** How the program settles the accounts: each normalized on its own, or one
12
- * net shortfall for the pair, where one account's surplus funds the other. */
13
- export type StorageSettlement = 'each' | 'pair';
14
4
  export interface ProfileStorageFunding {
15
5
  readonly profileDebit: bigint;
16
6
  readonly profileReserve: bigint;
17
7
  }
8
+ /** Refuses a direct Profile key that can fund none of an action's positive
9
+ * storage debit: the program withdraws it from the Profile vault with the
10
+ * signing key, which must be Profile AUTH or also hold `drainSolVault` (any
11
+ * scope). A delegated or certificate key is left to the program. Returns
12
+ * whether the key is a direct Profile key. */
13
+ export declare function requireStorageFundingKey(input: {
14
+ readonly profileRaw: RawAccount;
15
+ readonly authority: Address;
16
+ readonly keyIndex: number;
17
+ readonly profileDebit: bigint;
18
+ readonly action: string;
19
+ }): boolean;
18
20
  /** Checks that the signing key and the Profile can fund one action's storage
19
21
  * debit. A zero debit withdraws nothing, so it needs neither `drainSolVault`
20
22
  * nor Profile excess lamports. */
@@ -31,11 +33,9 @@ export declare function checkProfileStorageFunding(input: {
31
33
  };
32
34
  /** Builds the guard and the summary sentence for one action's storage funding. */
33
35
  export declare function profileStorageFundingGuard(input: {
36
+ readonly address: Address;
34
37
  readonly profile: Address;
35
38
  readonly authority: Address;
36
- readonly keyIndex: number;
37
- readonly resizes: StorageResizes;
38
- readonly settlement: StorageSettlement;
39
39
  readonly funding: ProfileStorageFunding & {
40
40
  readonly direct: boolean;
41
41
  };
@@ -1 +1 @@
1
- {"version":3,"file":"profile-storage-funding.d.ts","sourceRoot":"","sources":["../../../src/internal/planning/profile-storage-funding.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAE3C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAS5D,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AAMrF,kFAAkF;AAClF,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,GAAG,EAAE,UAAU,CAAC;IACzB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AAED,iDAAiD;AACjD,MAAM,MAAM,cAAc,GACxB,SAAS,CAAC,aAAa,CAAC,GAAG,SAAS,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC;AAErE;8EAC8E;AAC9E,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,MAAM,CAAC;AAEhD,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;CACjC;AAMD;;kCAEkC;AAClC,wBAAgB,0BAA0B,CAAC,KAAK,EAAE;IAChD,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;IAChC,QAAQ,CAAC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w new SageSdkError('ACTION_PRECONDITION_FAILED', message, { address });
10
10
  }
11
+ /** Refuses a direct Profile key that can fund none of an action's positive
12
+ * storage debit: the program withdraws it from the Profile vault with the
13
+ * signing key, which must be Profile AUTH or also hold `drainSolVault` (any
14
+ * scope). A delegated or certificate key is left to the program. Returns
15
+ * whether the key is a direct Profile key. */
16
+ export function requireStorageFundingKey(input) {
17
+ const key = directProfileKey(profileAccountDefinition.decode(input.profileRaw).keys, input.keyIndex, input.authority);
18
+ if (input.profileDebit > 0n &&
19
+ key &&
20
+ !grantsPermission(key, PROFILE_SCOPE, 0n) &&
21
+ !hasPermissionBit(key, DRAIN_SOL_VAULT))
22
+ fail(input.profileRaw.address, `The ${input.action} needs ${input.profileDebit} Profile lamports for account storage, which the program withdraws from the Profile vault with the signing key; this key lacks drainSolVault. Use a direct Profile AUTH key or a key that also holds drainSolVault, then replan.`);
23
+ return key !== undefined;
24
+ }
11
25
  /** Checks that the signing key and the Profile can fund one action's storage
12
26
  * debit. A zero debit withdraws nothing, so it needs neither `drainSolVault`
13
27
  * nor Profile excess lamports. */
@@ -18,20 +32,13 @@ export function checkProfileStorageFunding(input) {
18
32
  profileDebit > input.maximumProfileDebit)
19
33
  fail(profileRaw.address, `The ${action} now needs ${profileDebit} Profile lamports for account storage, above the ${input.maximumProfileDebit} this Plan approved. An earlier action in the same Plan may use storage it was planned against: execute the actions as separate Plans, or refresh the accounts and replan, then review the storage funding before signing.`);
20
34
  const profileReserve = rent(profileRaw.data.length);
21
- const key = directProfileKey(profileAccountDefinition.decode(profileRaw).keys, input.keyIndex, input.authority);
22
- if (profileDebit > 0n) {
23
- if (key &&
24
- !grantsPermission(key, PROFILE_SCOPE, 0n) &&
25
- !hasPermissionBit(key, DRAIN_SOL_VAULT))
26
- fail(profileRaw.address, `The ${action} needs ${profileDebit} Profile lamports for account storage, which the program withdraws from the Profile vault with the signing key; this key lacks drainSolVault. Use a direct Profile AUTH key or a key that also holds drainSolVault, then replan.`);
27
- if (profileRaw.lamports < profileReserve + profileDebit)
28
- fail(profileRaw.address, `The ${action} needs ${profileDebit} Profile lamports for account storage above the Profile's own ${profileReserve}-lamport rent reserve; the Profile holds ${profileRaw.lamports}. Add ${profileReserve + profileDebit - profileRaw.lamports} lamports to the Profile, then replan.`);
29
- }
30
- return { profileDebit, profileReserve, direct: key !== undefined };
35
+ const direct = requireStorageFundingKey(input);
36
+ if (profileDebit > 0n && profileRaw.lamports < profileReserve + profileDebit)
37
+ fail(profileRaw.address, `The ${action} needs ${profileDebit} Profile lamports for account storage above the Profile's own ${profileReserve}-lamport rent reserve; the Profile holds ${profileRaw.lamports}. Add ${profileReserve + profileDebit - profileRaw.lamports} lamports to the Profile, then replan.`);
38
+ return { profileDebit, profileReserve, direct };
31
39
  }
32
40
  /** Builds the guard and the summary sentence for one action's storage funding. */
33
41
  export function profileStorageFundingGuard(input) {
34
- const [first, second] = input.resizes;
35
42
  const { profileDebit } = input.funding;
36
43
  const disclosure = profileDebit > 0n
37
44
  ? `The program funds ${profileDebit} lamports of account storage from Profile ${input.profile}'s vault with the signing key (a locked rent deposit, separate from transaction fees).${input.funding.direct ? '' : ' The selected key is not a direct Profile key, so its drainSolVault permission is checked by the program, not locally.'}`
@@ -40,20 +47,9 @@ export function profileStorageFundingGuard(input) {
40
47
  disclosure,
41
48
  guard: {
42
49
  kind: 'profile-storage-funding',
43
- address: first.raw.address,
50
+ address: input.address,
44
51
  profile: input.profile,
45
52
  authority: input.authority,
46
- keyIndex: input.keyIndex,
47
- settlement: input.settlement,
48
- length: first.raw.data.length,
49
- growth: first.growthBytes,
50
- ...(second
51
- ? {
52
- paired: second.raw.address,
53
- pairedLength: second.raw.data.length,
54
- pairedGrowth: second.growthBytes,
55
- }
56
- : {}),
57
53
  maximumProfileDebit: profileDebit,
58
54
  describes: `Account storage funding from the Profile vault stays at most ${profileDebit} lamports, and the signing key and Profile balance can fund it.`,
59
55
  },
@@ -1 +1 @@
1
- {"version":3,"file":"profile-storage-funding.js","sourceR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,CAAC,IAAI,CAAC,MAAM;YAC7B,MAAM,EAAE,KAAK,CAAC,WAAW;YACzB,GAAG,CAAC,MAAM;gBACR,CAAC,CAAC;oBACE,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,OAAO;oBAC1B,YAAY,EAAE,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM;oBACpC,YAAY,EAAE,MAAM,CAAC,WAAW;iBACjC;gBACH,CAAC,CAAC,EAAE,CAAC;YACP,mBAAmB,EAAE,YAAY;YACjC,SAAS,EAAE,gEAAgE,YAAY,iEAAiE;SACzJ;KACF,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"profile-storage-funding.js","sourceRoot":"","sources":["../../../src/internal/planning/profile-storage-funding.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAErC,mDAAmD;AACnD,MAAM,eAAe,GAAG,GAAG,CAAC;AAO5B,SAAS,IAAI,CAAC,OAAgB,EAAE,OAAe;IAC7C,MAAM,IAAI,YAAY,CAAC,4BAA4B,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;AAC7E,CAAC;AAED;;;;8CAI8C;AAC9C,MAAM,UAAU,wBAAwB,CAAC,KAMxC;IACC,MAAM,GAAG,GAAG,gBAAgB,CAC1B,wBAAwB,CAAC,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,IAAI,EACtD,KAAK,CAAC,QAAQ,EACd,KAAK,CAAC,SAAS,CAChB,CAAC;IACF,IACE,KAAK,CAAC,YAAY,GAAG,EAAE;QACvB,GAAG;Q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,CAAC,OAAO,CAAC;IACvC,MAAM,UAAU,GACd,YAAY,GAAG,EAAE;QACf,CAAC,CAAC,qBAAqB,YAAY,6CAA6C,KAAK,CAAC,OAAO,yFAAyF,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,wHAAwH,EAAE;QAC5U,CAAC,CAAC,0FAA0F,CAAC;IACjG,OAAO;QACL,UAAU;QACV,KAAK,EAAE;YACL,IAAI,EAAE,yBAAyB;YAC/B,OAAO,EAAE,KAAK,CAAC,OAAO;YACtB,OAAO,EAAE,KAAK,CAAC,OAAO;YACtB,SAAS,EAAE,KAAK,CAAC,SAAS;YAC1B,mBAAmB,EAAE,YAAY;YACjC,SAAS,EAAE,gEAAgE,YAAY,iEAAiE;SACzJ;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { Address, Instruction } from '@solana/kit';
2
+ import type { RawAccount } from '../../client/contracts.js';
3
+ import { type StorageInstruction } from './profile-storage-funding-guard.js';
4
+ import type { StorageAction } from './storage-actions.js';
5
+ /** Fresh accounts an instruction's storage reads, besides the Profile, Rent
6
+ * sysvar and Game. */
7
+ export declare function storageActionAccounts(kind: StorageInstruction, instruction: Instruction): readonly Address[];
8
+ /** Reads any Profile-funded instruction's storage effect, for execution. */
9
+ export declare function readStorageAction(instruction: Instruction, accounts: ReadonlyMap<Address, RawAccount | undefined>, cargoIdForMint: (mint: Address) => number | undefined): StorageAction;
10
+ //# sourceMappingURL=storage-action-readers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storage-action-readers.d.ts","sourceRoot":"","sources":["../../../src/internal/planning/storage-action-readers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAExD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAG5D,OAAO,EAEL,KAAK,kBAAkB,EACxB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE1D;sBACsB;AACtB,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,kBAAkB,EACxB,WAAW,EAAE,WAAW,GACvB,SAAS,OAAO,EAAE,CAMpB;AAED,4EAA4E;AAC5E,wBAAgB,iBAAiB,CAC/B,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,WAAW,CAAC,OAAO,EAAE,UAAU,GAAG,SAAS,CAAC,EACtD,cAAc,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,MAAM,GAAG,SAAS,GACpD,aAAa,CAOf"}
@@ -0,0 +1,25 @@
1
+ import { readCargoStorageAction } from './cargo-storage-actions.js';
2
+ import { readMiningStorageAction } from './mining-storage-actions.js';
3
+ import { storageInstruction, } from './profile-storage-funding-guard.js';
4
+ /** Fresh accounts an instruction's storage reads, besides the Profile, Rent
5
+ * sysvar and Game. */
6
+ export function storageActionAccounts(kind, instruction) {
7
+ const at = (index) => instruction.accounts[index].address;
8
+ if (kind === 'deposit')
9
+ return [at(5), at(10)];
10
+ if (kind === 'starbase-transfer')
11
+ return [at(4), at(8)];
12
+ if (kind === 'stop-mining' || kind === 'stop-subwarp')
13
+ return [at(5)];
14
+ return [at(4)];
15
+ }
16
+ /** Reads any Profile-funded instruction's storage effect, for execution. */
17
+ export function readStorageAction(instruction, accounts, cargoIdForMint) {
18
+ const { kind } = storageInstruction(instruction);
19
+ return kind === 'start-mining' ||
20
+ kind === 'stop-mining' ||
21
+ kind === 'stop-subwarp'
22
+ ? readMiningStorageAction(instruction, accounts)
23
+ : readCargoStorageAction(instruction, accounts, cargoIdForMint);
24
+ }
25
+ //# sourceMappingURL=storage-action-readers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storage-action-readers.js","sourceRoot":"","sources":["../../../src/internal/planning/storage-action-readers.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,EACL,kBAAkB,GAEnB,MAAM,oCAAoC,CAAC;AAG5C;sBACsB;AACtB,MAAM,UAAU,qBAAqB,CACnC,IAAwB,EACxB,WAAwB;IAExB,MAAM,EAAE,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,WAAW,CAAC,QAAS,CAAC,KAAK,CAAE,CAAC,OAAO,CAAC;IACpE,IAAI,IAAI,KAAK,SAAS;QAAE,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAC/C,IAAI,IAAI,KAAK,mBAAmB;QAAE,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IACxD,IAAI,IAAI,KAAK,aAAa,IAAI,IAAI,KAAK,cAAc;QAAE,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IACtE,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;AACjB,CAAC;AAED,4EAA4E;AAC5E,MAAM,UAAU,iBAAiB,CAC/B,WAAwB,EACxB,QAAsD,EACtD,cAAqD;IAErD,MAAM,EAAE,IAAI,EAAE,GAAG,kBAAkB,CAAC,WAAW,CAAE,CAAC;IAClD,OAAO,IAAI,KAAK,cAAc;QAC5B,IAAI,KAAK,aAAa;QACtB,IAAI,KAAK,cAAc;QACvB,CAAC,CAAC,uBAAuB,CAAC,WAAW,EAAE,QAAQ,CAAC;QAChD,CAAC,CAAC,sBAAsB,CAAC,WAAW,EAAE,QAAQ,EAAE,cAAc,CAAC,CAAC;AACpE,CAAC"}
@@ -0,0 +1,81 @@
1
+ import { type Address, type Instruction } from '@solana/kit';
2
+ import type { RawAccount } from '../../client/contracts.js';
3
+ import type { PlanStep } from '../../planning/index.js';
4
+ import { type ProfileStorageFundingGuard, type StorageInstruction } from './profile-storage-funding-guard.js';
5
+ import { type ProfileStorageFunding } from './profile-storage-funding.js';
6
+ export type CargoLines = ReadonlyMap<number, bigint>;
7
+ /** The encoded size of a Fleet's state in the fresh account and after the
8
+ * action. A Plan tracks each Fleet's state across its actions, so a change is
9
+ * measured from the state the earlier actions left, not the fresh one. */
10
+ export interface StateChange {
11
+ readonly fresh: number;
12
+ readonly after: number;
13
+ }
14
+ /** One account an action resizes: a Fleet state change, and, when it changes
15
+ * a cargo pod, the lines the fresh pod holds and those the action adds to and
16
+ * consumes from. */
17
+ export type StorageAccount = {
18
+ readonly address: Address;
19
+ readonly state?: StateChange;
20
+ } & ({
21
+ readonly held?: undefined;
22
+ } | {
23
+ readonly held: CargoLines;
24
+ readonly added: CargoLines;
25
+ readonly removed?: CargoLines;
26
+ });
27
+ /** How the program settles the resized accounts: each normalized on its own,
28
+ * or one net shortfall across them, where one account's surplus funds another. */
29
+ export type StorageSettlement = 'each' | 'net';
30
+ /** What one instruction does to Profile-funded storage, read from its bytes. */
31
+ export interface StorageAction {
32
+ readonly profile: Address;
33
+ readonly authority: Address;
34
+ readonly keyIndex: number;
35
+ readonly settlement: StorageSettlement;
36
+ readonly accounts: readonly [StorageAccount, ...StorageAccount[]];
37
+ }
38
+ /** One evaluated action's Profile debit. */
39
+ export interface StorageEvaluation {
40
+ readonly profileDebit: bigint;
41
+ }
42
+ export declare const NONE: CargoLines;
43
+ export declare function totals(entries: readonly (readonly [number, bigint | undefined])[]): CargoLines;
44
+ export declare function present(accounts: ReadonlyMap<Address, RawAccount | undefined>, address: Address): RawAccount;
45
+ /** Evaluates actions in order, as the program runs them: each resized account
46
+ * changes by its state change plus a line per cargo id a pod gains and minus a
47
+ * line its consumption empties, and after each action every resized account
48
+ * holds exactly the rent minimum of its new size. Later actions therefore see
49
+ * the state, storage and surplus earlier ones left. */
50
+ export declare function evaluateStorage(actions: readonly StorageAction[], accounts: ReadonlyMap<Address, RawAccount | undefined>): readonly StorageEvaluation[];
51
+ /** The Profile-funded steps of a Plan, in order. */
52
+ export declare function storageSteps(steps: readonly PlanStep[]): readonly (PlanStep & {
53
+ readonly kind: StorageInstruction;
54
+ })[];
55
+ /** One guard's rechecked funding, or the failure to report for it. */
56
+ export type StorageResult = {
57
+ readonly funding: ProfileStorageFunding;
58
+ } | {
59
+ readonly error: unknown;
60
+ };
61
+ /** Rechecks every Profile-funded action's storage before signing. Each
62
+ * action's effect is rederived from its instruction bytes and the fresh
63
+ * accounts, never taken from its guard, and the actions are evaluated in order
64
+ * so each meets the state, storage and surplus the earlier ones left. Each
65
+ * debit must stay within its guard's ceiling and pass the key and balance
66
+ * checks. A Fleet whose state an earlier, unevaluated action writes is refused,
67
+ * since its state change could not be measured. */
68
+ export declare function validateStorageFunding(steps: readonly PlanStep[], guards: readonly ProfileStorageFundingGuard[], accounts: ReadonlyMap<Address, RawAccount | undefined>, readAction: (instruction: Instruction) => StorageAction): ReadonlyMap<ProfileStorageFundingGuard, StorageResult>;
69
+ /** Plans one action's storage funding from the same derivation execution
70
+ * repeats: its guard and the Plan summary sentence. */
71
+ export declare function planStorageFunding(input: {
72
+ readonly action: StorageAction;
73
+ readonly accounts: ReadonlyMap<Address, RawAccount | undefined>;
74
+ readonly label: string;
75
+ /** Actions the Plan is meant to run first, such as a subwarp settlement. */
76
+ readonly preceding?: readonly StorageAction[];
77
+ }): {
78
+ readonly guard: ProfileStorageFundingGuard;
79
+ readonly disclosure: string;
80
+ };
81
+ //# sourceMappingURL=storage-actions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storage-actions.d.ts","sourceRoot":"","sources":["../../../src/internal/planning/storage-actions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AAE7E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAE5D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAGL,KAA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,CAAC;IAChE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,4EAA4E;IAC5E,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,aAAa,EAAE,CAAC;CAC/C;;;EAmBA"}
@@ -0,0 +1,177 @@
1
+ import { isWritableRole } from '@solana/kit';
2
+ import { SageSdkError } from '../../client/errors.js';
3
+ import { CARGO_LINE_BYTES, storageInstruction, } from './profile-storage-funding-guard.js';
4
+ import { checkProfileStorageFunding, profileStorageFundingGuard, } from './profile-storage-funding.js';
5
+ import { RENT_ADDRESS, readRent } from './rent.js';
6
+ export const NONE = new Map();
7
+ function fail(address, message) {
8
+ throw new SageSdkError('ACTION_PRECONDITION_FAILED', message, { address });
9
+ }
10
+ export function totals(entries) {
11
+ const sums = new Map();
12
+ for (const [cargoId, amount] of entries)
13
+ if (amount !== undefined && amount > 0n)
14
+ sums.set(cargoId, (sums.get(cargoId) ?? 0n) + amount);
15
+ return sums;
16
+ }
17
+ export function present(accounts, address) {
18
+ const raw = accounts.get(address);
19
+ if (!raw || raw.executable)
20
+ fail(address, `Account ${address} is missing or executable, so the action's storage funding cannot be checked. Refresh it and replan the action.`);
21
+ return raw;
22
+ }
23
+ /** Evaluates actions in order, as the program runs them: each resized account
24
+ * changes by its state change plus a line per cargo id a pod gains and minus a
25
+ * line its consumption empties, and after each action every resized account
26
+ * holds exactly the rent minimum of its new size. Later actions therefore see
27
+ * the state, storage and surplus earlier ones left. */
28
+ export function evaluateStorage(actions, accounts) {
29
+ const rent = readRent(present(accounts, RENT_ADDRESS));
30
+ const state = new Map();
31
+ return actions.map((action) => {
32
+ let deficit = 0n;
33
+ let excess = 0n;
34
+ for (const account of action.accounts) {
35
+ let current = state.get(account.address);
36
+ if (!current) {
37
+ const raw = present(accounts, account.address);
38
+ current = { lamports: raw.lamports, length: raw.data.length };
39
+ state.set(account.address, current);
40
+ }
41
+ if (account.state) {
42
+ current.length +=
43
+ account.state.after - (current.state ?? account.state.fresh);
44
+ current.state = account.state.after;
45
+ }
46
+ let lines = 0;
47
+ if (account.held !== undefined) {
48
+ current.lines ??= new Map(account.held);
49
+ const { added } = account;
50
+ const removed = account.removed ?? NONE;
51
+ for (const cargoId of new Set([...added.keys(), ...removed.keys()])) {
52
+ const held = current.lines.get(cargoId);
53
+ const after = (held ?? 0n) +
54
+ (added.get(cargoId) ?? 0n) -
55
+ (removed.get(cargoId) ?? 0n);
56
+ if (held === undefined && after > 0n)
57
+ lines += 1;
58
+ else if (held !== undefined && after <= 0n)
59
+ lines -= 1;
60
+ // Only consumption can empty a line; an added line stays positive.
61
+ if (after > 0n)
62
+ current.lines.set(cargoId, after);
63
+ else
64
+ current.lines.delete(cargoId);
65
+ }
66
+ }
67
+ current.length += lines * CARGO_LINE_BYTES;
68
+ // The program leaves a zero-lamport account unchanged.
69
+ if (current.lamports === 0n)
70
+ continue;
71
+ const minimum = rent(current.length);
72
+ if (current.lamports < minimum)
73
+ deficit += minimum - current.lamports;
74
+ else
75
+ excess += current.lamports - minimum;
76
+ current.lamports = minimum;
77
+ }
78
+ const profileDebit = action.settlement === 'each'
79
+ ? deficit
80
+ : deficit > excess
81
+ ? deficit - excess
82
+ : 0n;
83
+ return { profileDebit };
84
+ });
85
+ }
86
+ /** The Profile-funded steps of a Plan, in order. */
87
+ export function storageSteps(steps) {
88
+ return steps.flatMap((step) => {
89
+ const known = storageInstruction(step.instruction);
90
+ return known ? [{ ...step, kind: known.kind }] : [];
91
+ });
92
+ }
93
+ /** Rechecks every Profile-funded action's storage before signing. Each
94
+ * action's effect is rederived from its instruction bytes and the fresh
95
+ * accounts, never taken from its guard, and the actions are evaluated in order
96
+ * so each meets the state, storage and surplus the earlier ones left. Each
97
+ * debit must stay within its guard's ceiling and pass the key and balance
98
+ * checks. A Fleet whose state an earlier, unevaluated action writes is refused,
99
+ * since its state change could not be measured. */
100
+ export function validateStorageFunding(steps, guards, accounts, readAction) {
101
+ const results = new Map();
102
+ const remaining = [...guards];
103
+ const unevaluated = new Set();
104
+ const bound = [];
105
+ for (const { instruction } of steps) {
106
+ const known = storageInstruction(instruction);
107
+ if (!known) {
108
+ for (const meta of instruction.accounts ?? [])
109
+ if (isWritableRole(meta.role))
110
+ unevaluated.add(meta.address);
111
+ continue;
112
+ }
113
+ const action = readAction(instruction);
114
+ for (const account of action.accounts)
115
+ if (account.state && unevaluated.has(account.address))
116
+ fail(account.address, `An earlier action in this Plan changes Fleet ${account.address} before an action whose storage depends on the Fleet's state, so that storage cannot be bounded. Execute the earlier action as its own Plan, refresh the Fleet and replan.`);
117
+ if (!known.guarded) {
118
+ bound.push({ guard: undefined, action });
119
+ continue;
120
+ }
121
+ // Plan validation already bound each guarded instruction to exactly one
122
+ // guard.
123
+ const index = remaining.findIndex((guard) => guard.profile === action.profile &&
124
+ guard.authority === action.authority &&
125
+ guard.address === action.accounts[0].address);
126
+ const [guard] = remaining.splice(index, 1);
127
+ bound.push({ guard: guard, action });
128
+ }
129
+ const ordered = evaluateStorage(bound.map(({ action }) => action), accounts);
130
+ bound.forEach(({ guard, action }, index) => {
131
+ const { profileDebit } = ordered[index];
132
+ if (!guard) {
133
+ // A subwarp stop only shrinks a rent-exact Fleet. Anything else
134
+ // would be a draw no guard bounds.
135
+ if (profileDebit > 0n)
136
+ fail(action.accounts[0].address, `Stopping Fleet ${action.accounts[0].address}'s subwarp now needs ${profileDebit} Profile lamports for storage, which this Plan does not bound. Settle the subwarp as its own Plan, refresh the Fleet and replan.`);
137
+ return;
138
+ }
139
+ try {
140
+ results.set(guard, {
141
+ funding: checkProfileStorageFunding({
142
+ profileRaw: present(accounts, guard.profile),
143
+ rentRaw: present(accounts, RENT_ADDRESS),
144
+ authority: action.authority,
145
+ keyIndex: action.keyIndex,
146
+ profileDebit,
147
+ action: 'action',
148
+ maximumProfileDebit: guard.maximumProfileDebit,
149
+ }),
150
+ });
151
+ }
152
+ catch (error) {
153
+ results.set(guard, { error });
154
+ }
155
+ });
156
+ return results;
157
+ }
158
+ /** Plans one action's storage funding from the same derivation execution
159
+ * repeats: its guard and the Plan summary sentence. */
160
+ export function planStorageFunding(input) {
161
+ const { action } = input;
162
+ const evaluated = evaluateStorage([...(input.preceding ?? []), action], input.accounts).at(-1);
163
+ return profileStorageFundingGuard({
164
+ address: action.accounts[0].address,
165
+ profile: action.profile,
166
+ authority: action.authority,
167
+ funding: checkProfileStorageFunding({
168
+ profileRaw: present(input.accounts, action.profile),
169
+ rentRaw: present(input.accounts, RENT_ADDRESS),
170
+ authority: action.authority,
171
+ keyIndex: action.keyIndex,
172
+ profileDebit: evaluated.profileDebit,
173
+ action: input.label,
174
+ }),
175
+ });
176
+ }
177
+ //# sourceMappingURL=storage-actions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storage-actions.js","sourceRoot":"","sources":["../../../src/internal/planning/storage-actions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAkC,MAAM,aAAa,CAAC;AAG7E,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEtD,OAAO,EACL,gBAAgB,EAChB,kBAAkB,GAGnB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACL,0BAA0B,EAC1B,0BAA0B,GAE3B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AA6CnD,MAAM,CAAC,MAAM,IAAI,GAAe,IAAI,GAAG,EAAE,CAAC;AAE1C,SAAS,IAAI,CAAC,OAAgB,EAAE,OAAe;IAC7C,MAAM,IAAI,YAAY,CAAC,4BAA4B,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;AAC7E,CAAC;AAED,MAAM,UAAU,MAAM,CACpB,OAA2D;IAE3D,MAAM,IAAI,GAAG,IAAI,GAAG,EAAkB,CAAC;IACvC,KAAK,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,IAAI,OAAO;QACrC,IAAI,MAAM,KAAK,SAAS,IAAI,MAAM,GAAG,EAAE;YACr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OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;QAChC,CAAC;IACH,CAAC,CAAC,CAAC;IACH,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;uDACuD;AACvD,MAAM,UAAU,kBAAkB,CAAC,KAMlC;IACC,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IACzB,MAAM,SAAS,GAAG,eAAe,CAC/B,CAAC,GAAG,CAAC,KAAK,CAAC,SAAS,IAAI,EAAE,CAAC,EAAE,MAAM,CAAC,EACpC,KAAK,CAAC,QAAQ,CACf,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IACT,OAAO,0BAA0B,CAAC;QAChC,OAAO,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,OAAO;QACnC,OAAO,EAAE,MAAM,CAAC,OAAO;QACvB,SAAS,EAAE,MAAM,CAAC,SAAS;QAC3B,OAAO,EAAE,0BAA0B,CAAC;YAClC,UAAU,EAAE,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE,MAAM,CAAC,OAAO,CAAC;YACnD,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE,YAAY,CAAC;YAC9C,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,QAAQ,EAAE,MAAM,CAAC,QAAQ;YACzB,YAAY,EAAE,SAAU,CAAC,YAAY;YACrC,MAAM,EAAE,KAAK,CAAC,KAAK;SACpB,CAAC;KACH,CAAC,CAAC;AACL,CAAC"}
@@ -25,6 +25,8 @@ export interface PlanTradeFactionMarketOptions {
25
25
  }
26
26
  /** Plans one explicit buy or sell using fresh canonical prerequisites, without simulation or writes.
27
27
  * Buy moves cargo Treasury→Fleet and ATLAS Character→Treasury; sell reverses both.
28
+ * Selling into a Market whose faucet is disabled, and a quantity above what the
29
+ * offer has left and that no restock could reach, are refused before signing.
28
30
  * Partial fills, stock, floors, faucet caps/burn, fees, restock and final arithmetic
29
31
  * remain chain-authoritative. Standing gates access and is credited on selling;
30
32
  * it is not a local price adjustment. Offline construction is not live trade evidence.
@@ -1 +1 @@
1
- {"version":3,"file":"trade-faction-market.d.ts","sourceRoot":"","sources":["../../../src/markets/actions/trade-faction-market.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,KAAK,EAAc,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAGzE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AA8BxE,OAAO,EAEL,KAAK,iBAAiB,EACvB,MAAM,kDAAkD,CAAC;AAC1D,OAAO,KAAK,EAAE,IAAI,EAAoB,MAAM,yBAAyB,CAAC;AAEtE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAEzD,UAAU,aAAc,SAAQ,IAAI,CAAC,wBAAwB,EAAE,cAAc,CAAC;IAC5E,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,YAAY,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC7C;AAED;;;;;;GAMG;AACH,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,CAAC,aAAa,EAAE,iBAAiB,CAAC;IAC1C,QAAQ,CAAC,SAAS,EAAE,KAAK,GAAG,MAAM,CAAC;IACnC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AAkFD;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,sBAAsB,CAC1C,GAAG,EAAE,WAAW,EAChB,KAAK,EAAE,aAAa,EACpB,MAAM,EAAE,qBAAqB,EAC7B,KAAK,EAAE,6BAA6B,GACnC,OAAO,CAAC,IAAI,CAAC,CAoQf"}
1
+ {"version":3,"file":"trade-faction-market.d.ts","sourceRoot":"","sources":["../../../src/markets/actions/trade-faction-market.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,KAAK,EAAc,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAGzE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AA8BxE,OAAO,EAEL,KAAK,iBAAiB,EACvB,MAAM,kDAAkD,CAAC;AAC1D,OAAO,KAAK,EAAE,IAAI,EAAoB,MAAM,yBAAyB,CAAC;AAEtE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAEzD,UAAU,aAAc,SAAQ,IAAI,CAAC,wBAAwB,EAAE,cAAc,CAAC;IAC5E,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,YAAY,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC7C;AAED;;;;;;GAMG;AACH,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,CAAC,aAAa,EAAE,iBAAiB,CAAC;IAC1C,QAAQ,CAAC,SAAS,EAAE,KAAK,GAAG,MAAM,CAAC;IACnC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AAkFD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,sBAAsB,CAC1C,GAAG,EAAE,WAAW,EAChB,KAAK,EAAE,aAAa,EACpB,MAAM,EAAE,qBAAqB,EAC7B,KAAK,EAAE,6BAA6B,GACnC,OAAO,CAAC,IAAI,CAAC,CAkRf"}
@@ -65,6 +65,8 @@ function required(raw, address) {
65
65
  }
66
66
  /** Plans one explicit buy or sell using fresh canonical prerequisites, without simulation or writes.
67
67
  * Buy moves cargo Treasury→Fleet and ATLAS Character→Treasury; sell reverses both.
68
+ * Selling into a Market whose faucet is disabled, and a quantity above what the
69
+ * offer has left and that no restock could reach, are refused before signing.
68
70
  * Partial fills, stock, floors, faucet caps/burn, fees, restock and final arithmetic
69
71
  * remain chain-authoritative. Standing gates access and is credited on selling;
70
72
  * it is not a local price adjustment. Offline construction is not live trade evidence.
@@ -159,6 +161,14 @@ export async function planTradeFactionMarket(ctx, fleet, market, input) {
159
161
  fail('Selected Faction Market trade intent changed; select the refreshed offer explicitly.');
160
162
  if (!(direction === 'buy' ? offer.canBuyFromFaction : offer.canSellToFaction))
161
163
  fail('Selected offer does not support this trade direction.');
164
+ if (direction === 'sell' && !m.faucetEnabled)
165
+ fail('This Faction Market is not buying cargo: its faucet is disabled. Sell at another Faction Market or wait until the faction enables buying.');
166
+ // A due restock refills an offer the faction sells to its authored target
167
+ // before the program bounds the quantity, so only a quantity no restock
168
+ // could reach is refused here.
169
+ if (quantityRaw > offer.remainingQuantityRaw &&
170
+ (!offer.canBuyFromFaction || quantityRaw > m.authoredTargetQuantityRaw))
171
+ fail(`quantityRaw ${String(quantityRaw)} exceeds offer ${String(offerIndex)}'s remaining ${String(offer.remainingQuantityRaw)} raw units${offer.canBuyFromFaction ? ` and its ${String(m.authoredTargetQuantityRaw)}-unit restock target` : ''}. Trade at most the remaining quantity.`);
162
172
  const identity = { game, factionId: m.factionId };
163
173
  const t = await readTradeTreasury(treasuryRaw, identity);
164
174
  const finite = [
@@ -1 +1 @@
1
- {"version":3,"file":"trade-faction-market.js","sourceRoot":"","sources":["../../../src/markets/actions/trade-faction-market.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,0CAA0C,CAAC;AACxF,OAAO,EACL,iBAAiB,EACjB,uBAAuB,GACxB,MAAM,gDAAgD,CAAC;AACxD,OAAO,EAAE,kCAAkC,EAAE,MAAM,iDAAiD,CAAC;AAGrG,OAAO,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EAAE,OAAO;gBAClB,OAAO,EAAE,CAAC,aAAa,CAAC,SAAS,CAAC;gBAClC,SAAS,EAAE;oBACT;wBACE,IAAI,EAAE,UAAU;wBAChB,QAAQ,EAAE,kBAAkB,MAAM,CAAC,OAAO,EAAE;wBAC5C,IAAI,EAAE,gBAAgB;qBACvB;oBACD;wBACE,IAAI,EAAE,aAAa;wBACnB,QAAQ,EAAE,kBAAkB,MAAM,CAAC,OAAO,EAAE;wBAC5C,IAAI,EAAE,gBAAgB;qBACvB;iBACF;gBACD,WAAW,EAAE,kCAAkC,CAAC;oBAC9C,aAAa;oBACb,SAAS;oBACT,IAAI;oBACJ,MAAM;oBACN,cAAc,EAAE,MAAM;oBACtB,KAAK,EAAE,KAAK,CAAC,OAAO;oBACpB,aAAa,EAAE,MAAM,CAAC,OAAO;oBAC7B,QAAQ;oBACR,UAAU;oBACV,QAAQ,EAAE,WAAW;oBACrB,UAAU,EAAE,SAAS,KAAK,KAAK;oBAC/B,GAAG,MAAM;iBACV,CAAC;aACH;SACF;KACF,CAAC,CAAC;AACL,CAAC"}
1
+ {"version":3,"file":"trade-faction-market.js","sourceRoot":"","sources":["../../../src/markets/actions/trade-faction-market.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,0CAA0C,CAAC;AACxF,OAAO,EACL,iBAAiB,EACjB,uBAAuB,GACxB,MAAM,gDAAgD,CAAC;AACxD,OAAO,EAAE,kCAAkC,EAAE,MAAM,iDAAiD,CAAC;AAGrG,OAAO,EAAE,uBAAuB,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC/E,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAGxE,OAAO,EACL,kBAAkB,EAClB,sBAAsB,GACvB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,0BAA0B,EAC1B,gBAAgB,GACjB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,0BAA0B,EAC1B,8BAA8B,GAC/B,M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