@shipload/sdk 2.0.0-rc1 → 2.0.0-rc3

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 (52) hide show
  1. package/README.md +349 -1
  2. package/lib/shipload.d.ts +809 -314
  3. package/lib/shipload.js +2745 -1740
  4. package/lib/shipload.js.map +1 -1
  5. package/lib/shipload.m.js +2158 -1154
  6. package/lib/shipload.m.js.map +1 -1
  7. package/package.json +1 -2
  8. package/src/capabilities/extraction.ts +30 -0
  9. package/src/capabilities/guards.ts +43 -0
  10. package/src/capabilities/index.ts +5 -0
  11. package/src/capabilities/loading.ts +8 -0
  12. package/src/capabilities/movement.ts +29 -0
  13. package/src/capabilities/storage.ts +67 -0
  14. package/src/contracts/server.ts +506 -183
  15. package/src/data/items.json +16 -0
  16. package/src/derivation/index.ts +25 -0
  17. package/src/derivation/location-size.ts +15 -0
  18. package/src/derivation/resources.ts +141 -0
  19. package/src/derivation/stratum.ts +116 -0
  20. package/src/entities/cargo-utils.ts +98 -3
  21. package/src/entities/container.ts +70 -0
  22. package/src/entities/entity-inventory.ts +13 -9
  23. package/src/entities/inventory-accessor.ts +46 -0
  24. package/src/entities/location.ts +31 -17
  25. package/src/entities/makers.ts +69 -0
  26. package/src/entities/player.ts +2 -1
  27. package/src/entities/ship.ts +93 -440
  28. package/src/entities/warehouse.ts +29 -145
  29. package/src/errors.ts +4 -4
  30. package/src/index-module.ts +62 -4
  31. package/src/managers/actions.ts +75 -31
  32. package/src/managers/entities.ts +22 -5
  33. package/src/managers/locations.ts +34 -15
  34. package/src/managers/trades.ts +7 -7
  35. package/src/market/items.ts +31 -0
  36. package/src/market/market.ts +12 -13
  37. package/src/scheduling/accessor.ts +82 -0
  38. package/src/scheduling/projection.ts +126 -54
  39. package/src/scheduling/schedule.ts +24 -0
  40. package/src/trading/collect.ts +25 -26
  41. package/src/trading/deal.ts +8 -9
  42. package/src/trading/trade.ts +9 -9
  43. package/src/travel/travel.ts +69 -8
  44. package/src/types/capabilities.ts +79 -0
  45. package/src/types/entity-traits.ts +70 -0
  46. package/src/types/entity.ts +36 -0
  47. package/src/types/index.ts +3 -0
  48. package/src/types.ts +92 -15
  49. package/src/utils/hash.ts +1 -1
  50. package/src/utils/system.ts +97 -4
  51. package/src/data/goods.json +0 -23
  52. package/src/market/goods.ts +0 -31
package/lib/shipload.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as _wharfkit_antelope from '@wharfkit/antelope';
2
- import { Blob, ABI, Struct, Name, UInt64, Checksum256, UInt32, TimePointSec, Checksum256Type, UInt32Type, NameType, UInt64Type, Action, UInt16, Int64, UInt8, TimePoint, UInt8Type, TimePointType, Int64Type, UInt16Type, Checksum512, APIClient } from '@wharfkit/antelope';
2
+ import { Blob, ABI, Struct, Name, UInt64, Checksum256, UInt32, TimePointSec, Checksum256Type, UInt32Type, NameType, UInt64Type, Action, UInt16, UInt8, TimePoint, Int64, UInt16Type, UInt8Type, TimePointType, Int64Type, Checksum512, APIClient } from '@wharfkit/antelope';
3
3
  import * as _wharfkit_contract from '@wharfkit/contract';
4
4
  import { Contract as Contract$2, PartialBy, ContractArgs, ActionOptions, Table } from '@wharfkit/contract';
5
5
  import { ChainDefinition } from '@wharfkit/session';
@@ -162,9 +162,15 @@ declare namespace Types {
162
162
  reveal: string;
163
163
  commit: Checksum256;
164
164
  }
165
- class buygoods extends Struct {
165
+ class buycontainer extends Struct {
166
+ account: Name;
166
167
  ship_id: UInt64;
167
- good_id: UInt16;
168
+ name: string;
169
+ }
170
+ class buyitems extends Struct {
171
+ entity_type: Name;
172
+ id: UInt64;
173
+ item_id: UInt16;
168
174
  quantity: UInt32;
169
175
  }
170
176
  class buyship extends Struct {
@@ -181,45 +187,35 @@ declare namespace Types {
181
187
  id: UInt64;
182
188
  count: UInt64;
183
189
  }
184
- class coordinates extends Struct {
185
- x: Int64;
186
- y: Int64;
187
- z?: UInt16;
188
- }
189
- class cargo_item extends Struct {
190
- good_id: UInt16;
191
- quantity: UInt32;
192
- unit_cost: UInt64;
193
- }
194
- class task extends Struct {
195
- type: UInt8;
196
- duration: UInt32;
197
- cancelable: UInt8;
198
- location?: coordinates;
199
- cargo: cargo_item[];
200
- entity?: UInt64;
201
- credits?: Int64;
202
- }
203
- class cancel_log extends Struct {
204
- owner: Name;
190
+ class entity_ref extends Struct {
205
191
  entity_type: Name;
206
192
  entity_id: UInt64;
207
- task_index: UInt8;
208
- task: task;
209
- started_at: TimePoint;
210
193
  }
211
194
  class cancel_results extends Struct {
212
195
  entity_id: UInt64;
213
196
  entity_type: Name;
214
197
  cancelled_count: UInt8;
215
198
  schedule_started?: TimePoint;
199
+ entitygroup?: UInt64;
200
+ group_members?: entity_ref[];
201
+ }
202
+ class cargo_item extends Struct {
203
+ item_id: UInt16;
204
+ quantity: UInt32;
205
+ unit_cost: UInt64;
206
+ seed?: UInt64;
216
207
  }
217
208
  class cargo_row extends Struct {
218
209
  id: UInt64;
219
210
  entity_id: UInt64;
220
- good_id: UInt64;
211
+ item_id: UInt64;
221
212
  quantity: UInt64;
222
213
  unit_cost: UInt64;
214
+ seed: UInt64;
215
+ }
216
+ class cleanrsvp extends Struct {
217
+ epoch: UInt64;
218
+ max_rows: UInt64;
223
219
  }
224
220
  class cleartable extends Struct {
225
221
  table_name: Name;
@@ -229,8 +225,9 @@ declare namespace Types {
229
225
  class commit extends Struct {
230
226
  commit: Checksum256;
231
227
  }
232
- class enable extends Struct {
233
- enabled: boolean;
228
+ class movement_stats extends Struct {
229
+ thrust: UInt32;
230
+ drain: UInt16;
234
231
  }
235
232
  class energy_stats extends Struct {
236
233
  capacity: UInt16;
@@ -241,28 +238,102 @@ declare namespace Types {
241
238
  thrust: UInt16;
242
239
  quantity: UInt8;
243
240
  }
244
- class movement_stats extends Struct {
245
- thrust: UInt32;
241
+ class trade_stats extends Struct {
242
+ margin: UInt16;
243
+ }
244
+ class extractor_stats extends Struct {
245
+ rate: UInt16;
246
246
  drain: UInt16;
247
+ efficiency: UInt16;
248
+ depth: UInt16;
249
+ drill: UInt16;
250
+ }
251
+ class warp_stats extends Struct {
252
+ range: UInt32;
253
+ }
254
+ class entity_defaults extends Struct {
255
+ ship_hullmass: UInt32;
256
+ ship_capacity: UInt32;
257
+ ship_energy: UInt16;
258
+ ship_z: UInt16;
259
+ ship_engines: movement_stats;
260
+ ship_generator: energy_stats;
261
+ ship_loaders: loader_stats;
262
+ ship_trade: trade_stats;
263
+ ship_extractor: extractor_stats;
264
+ warehouse_capacity: UInt32;
265
+ warehouse_z: UInt16;
266
+ warehouse_loaders: loader_stats;
267
+ container_hullmass: UInt32;
268
+ container_capacity: UInt32;
269
+ container_z: UInt16;
270
+ }
271
+ class item_def extends Struct {
272
+ id: UInt16;
273
+ base_price: UInt32;
274
+ mass: UInt32;
275
+ }
276
+ class game_config extends Struct {
277
+ version: UInt32;
278
+ defaults: entity_defaults;
279
+ items: item_def[];
280
+ }
281
+ class configlog extends Struct {
282
+ config: game_config;
283
+ }
284
+ class coordinates extends Struct {
285
+ x: Int64;
286
+ y: Int64;
287
+ z?: UInt16;
288
+ }
289
+ class task extends Struct {
290
+ type: UInt8;
291
+ duration: UInt32;
292
+ cancelable: UInt8;
293
+ coordinates?: coordinates;
294
+ cargo: cargo_item[];
295
+ entitytarget?: entity_ref;
296
+ entitygroup?: UInt64;
297
+ credits?: Int64;
298
+ energy_cost?: UInt16;
247
299
  }
248
300
  class schedule extends Struct {
249
301
  started: TimePoint;
250
302
  tasks: task[];
251
303
  }
304
+ class container_row extends Struct {
305
+ id: UInt64;
306
+ owner: Name;
307
+ name: string;
308
+ coordinates: coordinates;
309
+ hullmass: UInt32;
310
+ capacity: UInt32;
311
+ cargomass: UInt32;
312
+ schedule?: schedule;
313
+ }
314
+ class enable extends Struct {
315
+ enabled: boolean;
316
+ }
317
+ class entity_current_state extends Struct {
318
+ coordinates: coordinates;
319
+ energy: UInt16;
320
+ }
252
321
  class entity_info extends Struct {
253
322
  type: Name;
254
323
  id: UInt64;
255
324
  owner: Name;
256
325
  entity_name: string;
257
- location: coordinates;
326
+ coordinates: coordinates;
258
327
  cargomass: UInt32;
259
328
  cargo: cargo_item[];
260
329
  loaders?: loader_stats;
261
330
  energy?: UInt16;
262
- mass?: UInt32;
331
+ hullmass?: UInt32;
263
332
  engines?: movement_stats;
264
333
  generator?: energy_stats;
265
334
  capacity?: UInt32;
335
+ extractor?: extractor_stats;
336
+ warp?: warp_stats;
266
337
  is_idle: boolean;
267
338
  current_task?: task;
268
339
  current_task_elapsed: UInt32;
@@ -271,16 +342,12 @@ declare namespace Types {
271
342
  idle_at?: TimePoint;
272
343
  schedule?: schedule;
273
344
  }
274
- class entity_state extends Struct {
275
- location: coordinates;
276
- energy: UInt16;
277
- }
278
345
  class entity_summary extends Struct {
279
346
  type: Name;
280
347
  id: UInt64;
281
348
  owner: Name;
282
349
  entity_name: string;
283
- location: coordinates;
350
+ coordinates: coordinates;
284
351
  is_idle: boolean;
285
352
  resolved_count: UInt32;
286
353
  pending_count: UInt32;
@@ -291,6 +358,18 @@ declare namespace Types {
291
358
  task_count: UInt8;
292
359
  schedule_started: TimePoint;
293
360
  }
361
+ class entitygroup_row extends Struct {
362
+ id: UInt64;
363
+ participants: entity_ref[];
364
+ }
365
+ class extract extends Struct {
366
+ entity_type: Name;
367
+ id: UInt64;
368
+ stratum: UInt16;
369
+ quantity: UInt32;
370
+ }
371
+ class getconfig extends Struct {
372
+ }
294
373
  class getentities extends Struct {
295
374
  owner: Name;
296
375
  entity_type?: Name;
@@ -299,12 +378,16 @@ declare namespace Types {
299
378
  entity_type: Name;
300
379
  entity_id: UInt64;
301
380
  }
302
- class getgoods extends Struct {
381
+ class getitems extends Struct {
303
382
  }
304
383
  class getlocation extends Struct {
305
384
  x: Int64;
306
385
  y: Int64;
307
386
  }
387
+ class getlocdata extends Struct {
388
+ x: Int64;
389
+ y: Int64;
390
+ }
308
391
  class getnearby extends Struct {
309
392
  entity_type: Name;
310
393
  entity_id: UInt64;
@@ -313,17 +396,17 @@ declare namespace Types {
313
396
  class getplayer extends Struct {
314
397
  account: Name;
315
398
  }
399
+ class getstarter extends Struct {
400
+ }
316
401
  class getsummaries extends Struct {
317
402
  owner: Name;
318
403
  entity_type?: Name;
319
404
  }
320
- class good extends Struct {
321
- id: UInt16;
322
- base_price: UInt32;
323
- mass: UInt32;
324
- }
325
- class goods_info extends Struct {
326
- goods: good[];
405
+ class grouptravel extends Struct {
406
+ entities: entity_ref[];
407
+ x: Int64;
408
+ y: Int64;
409
+ recharge: boolean;
327
410
  }
328
411
  class hash extends Struct {
329
412
  value: string;
@@ -334,10 +417,29 @@ declare namespace Types {
334
417
  class init extends Struct {
335
418
  seed: Checksum256;
336
419
  }
420
+ class items_info extends Struct {
421
+ items: item_def[];
422
+ }
337
423
  class join extends Struct {
338
424
  account: Name;
339
425
  }
340
- class location_good extends Struct {
426
+ class location_static extends Struct {
427
+ coords: coordinates;
428
+ type: UInt8;
429
+ subtype: UInt8;
430
+ seed0: UInt8;
431
+ seed1: UInt8;
432
+ }
433
+ class location_epoch extends Struct {
434
+ active: boolean;
435
+ seed0: UInt8;
436
+ seed1: UInt8;
437
+ }
438
+ class location_derived extends Struct {
439
+ static_props: location_static;
440
+ epoch_props: location_epoch;
441
+ }
442
+ class location_item extends Struct {
341
443
  id: UInt16;
342
444
  price: UInt32;
343
445
  supply: UInt16;
@@ -347,35 +449,15 @@ declare namespace Types {
347
449
  class location_info extends Struct {
348
450
  coords: coordinates;
349
451
  is_system: boolean;
350
- goods: location_good[];
452
+ items: location_item[];
351
453
  }
352
454
  class location_row extends Struct {
353
455
  id: UInt64;
354
- coordinates: coordinates;
355
- epoch: UInt64;
356
- good_id: UInt16;
357
- supply: UInt16;
358
- }
359
- class logcancel extends Struct {
360
- log: cancel_log;
361
- }
362
- class resolve_log extends Struct {
363
456
  owner: Name;
364
- entity_type: Name;
365
- entity_id: UInt64;
366
- task_index: UInt8;
367
- task: task;
368
- started_at: TimePoint;
369
- completed_at: TimePoint;
370
- new_energy?: UInt16;
371
- new_location?: coordinates;
372
- cargomass_delta: Int64;
373
- cargo_added: cargo_item[];
374
- cargo_removed: cargo_item[];
375
- credits?: Int64;
376
- }
377
- class logresolve extends Struct {
378
- log: resolve_log;
457
+ coordinates: coordinates;
458
+ cargomass: UInt32;
459
+ cargo: cargo_item[];
460
+ schedule?: schedule;
379
461
  }
380
462
  class nearby_system extends Struct {
381
463
  distance: UInt64;
@@ -385,11 +467,25 @@ declare namespace Types {
385
467
  }
386
468
  class nearby_info extends Struct {
387
469
  can_travel: boolean;
388
- current: entity_state;
389
- projected: entity_state;
470
+ current: entity_current_state;
471
+ projected: entity_current_state;
390
472
  max_energy: UInt16;
391
473
  systems: nearby_system[];
392
474
  }
475
+ class task_event extends Struct {
476
+ event_type: UInt8;
477
+ owner: Name;
478
+ entity_type: Name;
479
+ entity_id: UInt64;
480
+ task_index: UInt8;
481
+ task: task;
482
+ starts_at: TimePoint;
483
+ completes_at: TimePoint;
484
+ new_energy?: UInt16;
485
+ }
486
+ class notify extends Struct {
487
+ event: task_event;
488
+ }
393
489
  class payloan extends Struct {
394
490
  account: Name;
395
491
  amount: UInt64;
@@ -404,8 +500,10 @@ declare namespace Types {
404
500
  available_loan: UInt64;
405
501
  next_ship_price: UInt64;
406
502
  next_warehouse_price: UInt64;
503
+ next_container_price: UInt64;
407
504
  ship_count: UInt64;
408
505
  warehouse_count: UInt64;
506
+ container_count: UInt64;
409
507
  }
410
508
  class player_row extends Struct {
411
509
  owner: Name;
@@ -420,22 +518,30 @@ declare namespace Types {
420
518
  entity_type: Name;
421
519
  id: UInt64;
422
520
  }
521
+ class reserve_row extends Struct {
522
+ id: UInt64;
523
+ remaining: UInt32;
524
+ }
423
525
  class resolve extends Struct {
424
526
  entity_type: Name;
425
527
  id: UInt64;
528
+ count?: UInt64;
426
529
  }
427
530
  class resolve_results extends Struct {
428
531
  entity_id: UInt64;
429
532
  entity_type: Name;
430
533
  resolved_count: UInt8;
431
534
  new_schedule_started?: TimePoint;
535
+ entitygroup?: UInt64;
536
+ group_members?: entity_ref[];
432
537
  }
433
538
  class salt extends Struct {
434
539
  salt: UInt64;
435
540
  }
436
- class sellgoods extends Struct {
437
- ship_id: UInt64;
438
- good_id: UInt16;
541
+ class sellitems extends Struct {
542
+ entity_type: Name;
543
+ id: UInt64;
544
+ item_id: UInt16;
439
545
  quantity: UInt32;
440
546
  }
441
547
  class sequence_row extends Struct {
@@ -446,15 +552,24 @@ declare namespace Types {
446
552
  id: UInt64;
447
553
  owner: Name;
448
554
  name: string;
449
- location: coordinates;
450
- mass: UInt32;
555
+ coordinates: coordinates;
556
+ hullmass: UInt32;
451
557
  capacity: UInt32;
452
558
  energy: UInt16;
559
+ cargomass: UInt32;
453
560
  engines: movement_stats;
454
561
  generator: energy_stats;
455
562
  loaders: loader_stats;
563
+ trade?: trade_stats;
564
+ extractor?: extractor_stats;
565
+ warp?: warp_stats;
456
566
  schedule?: schedule;
457
567
  }
568
+ class starter_info extends Struct {
569
+ balance: UInt64;
570
+ debt: UInt64;
571
+ ship: entity_info;
572
+ }
458
573
  class state_row extends Struct {
459
574
  enabled: boolean;
460
575
  epoch: UInt32;
@@ -463,6 +578,13 @@ declare namespace Types {
463
578
  seed: Checksum256;
464
579
  commit: Checksum256;
465
580
  }
581
+ class supply_row extends Struct {
582
+ id: UInt64;
583
+ coordinates: coordinates;
584
+ epoch: UInt64;
585
+ item_id: UInt16;
586
+ supply: UInt16;
587
+ }
466
588
  class takeloan extends Struct {
467
589
  account: Name;
468
590
  amount: UInt64;
@@ -475,7 +597,7 @@ declare namespace Types {
475
597
  source_id: UInt64;
476
598
  dest_type: Name;
477
599
  dest_id: UInt64;
478
- good_id: UInt16;
600
+ item_id: UInt16;
479
601
  quantity: UInt32;
480
602
  }
481
603
  class travel extends Struct {
@@ -488,6 +610,8 @@ declare namespace Types {
488
610
  class types_row extends Struct {
489
611
  id: UInt64;
490
612
  entity_summary_type: entity_summary;
613
+ starter_info_type: starter_info;
614
+ game_config_type: game_config;
491
615
  }
492
616
  class updatecredit extends Struct {
493
617
  account: Name;
@@ -501,8 +625,9 @@ declare namespace Types {
501
625
  id: UInt64;
502
626
  owner: Name;
503
627
  name: string;
504
- location: coordinates;
628
+ coordinates: coordinates;
505
629
  capacity: UInt32;
630
+ cargomass: UInt32;
506
631
  loaders: loader_stats;
507
632
  schedule?: schedule;
508
633
  }
@@ -513,21 +638,29 @@ declare namespace Types {
513
638
  }
514
639
  declare const TableMap: {
515
640
  cargo: typeof Types.cargo_row;
641
+ container: typeof Types.container_row;
642
+ entitygroup: typeof Types.entitygroup_row;
516
643
  location: typeof Types.location_row;
517
644
  player: typeof Types.player_row;
645
+ reserve: typeof Types.reserve_row;
518
646
  sequence: typeof Types.sequence_row;
519
647
  ship: typeof Types.ship_row;
520
648
  state: typeof Types.state_row;
649
+ supply: typeof Types.supply_row;
521
650
  types: typeof Types.types_row;
522
651
  warehouse: typeof Types.warehouse_row;
523
652
  };
524
653
  interface TableTypes {
525
654
  cargo: Types.cargo_row;
655
+ container: Types.container_row;
656
+ entitygroup: Types.entitygroup_row;
526
657
  location: Types.location_row;
527
658
  player: Types.player_row;
659
+ reserve: Types.reserve_row;
528
660
  sequence: Types.sequence_row;
529
661
  ship: Types.ship_row;
530
662
  state: Types.state_row;
663
+ supply: Types.supply_row;
531
664
  types: Types.types_row;
532
665
  warehouse: Types.warehouse_row;
533
666
  }
@@ -535,22 +668,81 @@ type RowType<T> = T extends keyof TableTypes ? TableTypes[T] : any;
535
668
  type TableNames = keyof TableTypes;
536
669
  declare namespace ActionParams {
537
670
  namespace Type {
538
- interface cancel_log {
671
+ interface game_config {
672
+ version: UInt32Type;
673
+ defaults: Type.entity_defaults;
674
+ items: Type.item_def[];
675
+ }
676
+ interface entity_defaults {
677
+ ship_hullmass: UInt32Type;
678
+ ship_capacity: UInt32Type;
679
+ ship_energy: UInt16Type;
680
+ ship_z: UInt16Type;
681
+ ship_engines: Type.movement_stats;
682
+ ship_generator: Type.energy_stats;
683
+ ship_loaders: Type.loader_stats;
684
+ ship_trade: Type.trade_stats;
685
+ ship_extractor: Type.extractor_stats;
686
+ warehouse_capacity: UInt32Type;
687
+ warehouse_z: UInt16Type;
688
+ warehouse_loaders: Type.loader_stats;
689
+ container_hullmass: UInt32Type;
690
+ container_capacity: UInt32Type;
691
+ container_z: UInt16Type;
692
+ }
693
+ interface movement_stats {
694
+ thrust: UInt32Type;
695
+ drain: UInt16Type;
696
+ }
697
+ interface energy_stats {
698
+ capacity: UInt16Type;
699
+ recharge: UInt16Type;
700
+ }
701
+ interface loader_stats {
702
+ mass: UInt32Type;
703
+ thrust: UInt16Type;
704
+ quantity: UInt8Type;
705
+ }
706
+ interface trade_stats {
707
+ margin: UInt16Type;
708
+ }
709
+ interface extractor_stats {
710
+ rate: UInt16Type;
711
+ drain: UInt16Type;
712
+ efficiency: UInt16Type;
713
+ depth: UInt16Type;
714
+ drill: UInt16Type;
715
+ }
716
+ interface item_def {
717
+ id: UInt16Type;
718
+ base_price: UInt32Type;
719
+ mass: UInt32Type;
720
+ }
721
+ interface entity_ref {
722
+ entity_type: NameType;
723
+ entity_id: UInt64Type;
724
+ }
725
+ interface task_event {
726
+ event_type: UInt8Type;
539
727
  owner: NameType;
540
728
  entity_type: NameType;
541
729
  entity_id: UInt64Type;
542
730
  task_index: UInt8Type;
543
731
  task: Type.task;
544
- started_at: TimePointType;
732
+ starts_at: TimePointType;
733
+ completes_at: TimePointType;
734
+ new_energy?: UInt16Type;
545
735
  }
546
736
  interface task {
547
737
  type: UInt8Type;
548
738
  duration: UInt32Type;
549
739
  cancelable: UInt8Type;
550
- location?: Type.coordinates;
740
+ coordinates?: Type.coordinates;
551
741
  cargo: Type.cargo_item[];
552
- entity?: UInt64Type;
742
+ entitytarget?: Type.entity_ref;
743
+ entitygroup?: UInt64Type;
553
744
  credits?: Int64Type;
745
+ energy_cost?: UInt16Type;
554
746
  }
555
747
  interface coordinates {
556
748
  x: Int64Type;
@@ -558,33 +750,25 @@ declare namespace ActionParams {
558
750
  z?: UInt16Type;
559
751
  }
560
752
  interface cargo_item {
561
- good_id: UInt16Type;
753
+ item_id: UInt16Type;
562
754
  quantity: UInt32Type;
563
755
  unit_cost: UInt64Type;
564
- }
565
- interface resolve_log {
566
- owner: NameType;
567
- entity_type: NameType;
568
- entity_id: UInt64Type;
569
- task_index: UInt8Type;
570
- task: Type.task;
571
- started_at: TimePointType;
572
- completed_at: TimePointType;
573
- new_energy?: UInt16Type;
574
- new_location?: Type.coordinates;
575
- cargomass_delta: Int64Type;
576
- cargo_added: Type.cargo_item[];
577
- cargo_removed: Type.cargo_item[];
578
- credits?: Int64Type;
756
+ seed?: UInt64Type;
579
757
  }
580
758
  }
581
759
  interface advance {
582
760
  reveal: string;
583
761
  commit: Checksum256Type;
584
762
  }
585
- interface buygoods {
763
+ interface buycontainer {
764
+ account: NameType;
586
765
  ship_id: UInt64Type;
587
- good_id: UInt16Type;
766
+ name: string;
767
+ }
768
+ interface buyitems {
769
+ entity_type: NameType;
770
+ id: UInt64Type;
771
+ item_id: UInt16Type;
588
772
  quantity: UInt32Type;
589
773
  }
590
774
  interface buyship {
@@ -601,6 +785,10 @@ declare namespace ActionParams {
601
785
  id: UInt64Type;
602
786
  count: UInt64Type;
603
787
  }
788
+ interface cleanrsvp {
789
+ epoch: UInt64Type;
790
+ max_rows: UInt64Type;
791
+ }
604
792
  interface cleartable {
605
793
  table_name: NameType;
606
794
  scope?: NameType;
@@ -609,9 +797,20 @@ declare namespace ActionParams {
609
797
  interface commit {
610
798
  commit: Checksum256Type;
611
799
  }
800
+ interface configlog {
801
+ config: Type.game_config;
802
+ }
612
803
  interface enable {
613
804
  enabled: boolean;
614
805
  }
806
+ interface extract {
807
+ entity_type: NameType;
808
+ id: UInt64Type;
809
+ stratum: UInt16Type;
810
+ quantity: UInt32Type;
811
+ }
812
+ interface getconfig {
813
+ }
615
814
  interface getentities {
616
815
  owner: NameType;
617
816
  entity_type?: NameType;
@@ -620,12 +819,16 @@ declare namespace ActionParams {
620
819
  entity_type: NameType;
621
820
  entity_id: UInt64Type;
622
821
  }
623
- interface getgoods {
822
+ interface getitems {
624
823
  }
625
824
  interface getlocation {
626
825
  x: Int64Type;
627
826
  y: Int64Type;
628
827
  }
828
+ interface getlocdata {
829
+ x: Int64Type;
830
+ y: Int64Type;
831
+ }
629
832
  interface getnearby {
630
833
  entity_type: NameType;
631
834
  entity_id: UInt64Type;
@@ -634,10 +837,18 @@ declare namespace ActionParams {
634
837
  interface getplayer {
635
838
  account: NameType;
636
839
  }
840
+ interface getstarter {
841
+ }
637
842
  interface getsummaries {
638
843
  owner: NameType;
639
844
  entity_type?: NameType;
640
845
  }
846
+ interface grouptravel {
847
+ entities: Type.entity_ref[];
848
+ x: Int64Type;
849
+ y: Int64Type;
850
+ recharge: boolean;
851
+ }
641
852
  interface hash {
642
853
  value: string;
643
854
  }
@@ -650,11 +861,8 @@ declare namespace ActionParams {
650
861
  interface join {
651
862
  account: NameType;
652
863
  }
653
- interface logcancel {
654
- log: Type.cancel_log;
655
- }
656
- interface logresolve {
657
- log: Type.resolve_log;
864
+ interface notify {
865
+ event: Type.task_event;
658
866
  }
659
867
  interface payloan {
660
868
  account: NameType;
@@ -670,13 +878,15 @@ declare namespace ActionParams {
670
878
  interface resolve {
671
879
  entity_type: NameType;
672
880
  id: UInt64Type;
881
+ count?: UInt64Type;
673
882
  }
674
883
  interface salt {
675
884
  salt: UInt64Type;
676
885
  }
677
- interface sellgoods {
678
- ship_id: UInt64Type;
679
- good_id: UInt16Type;
886
+ interface sellitems {
887
+ entity_type: NameType;
888
+ id: UInt64Type;
889
+ item_id: UInt16Type;
680
890
  quantity: UInt32Type;
681
891
  }
682
892
  interface takeloan {
@@ -688,7 +898,7 @@ declare namespace ActionParams {
688
898
  source_id: UInt64Type;
689
899
  dest_type: NameType;
690
900
  dest_id: UInt64Type;
691
- good_id: UInt16Type;
901
+ item_id: UInt16Type;
692
902
  quantity: UInt32Type;
693
903
  }
694
904
  interface travel {
@@ -713,32 +923,39 @@ declare namespace ActionParams {
713
923
  }
714
924
  interface ActionNameParams {
715
925
  advance: ActionParams.advance;
716
- buygoods: ActionParams.buygoods;
926
+ buycontainer: ActionParams.buycontainer;
927
+ buyitems: ActionParams.buyitems;
717
928
  buyship: ActionParams.buyship;
718
929
  buywarehouse: ActionParams.buywarehouse;
719
930
  cancel: ActionParams.cancel;
931
+ cleanrsvp: ActionParams.cleanrsvp;
720
932
  cleartable: ActionParams.cleartable;
721
933
  commit: ActionParams.commit;
934
+ configlog: ActionParams.configlog;
722
935
  enable: ActionParams.enable;
936
+ extract: ActionParams.extract;
937
+ getconfig: ActionParams.getconfig;
723
938
  getentities: ActionParams.getentities;
724
939
  getentity: ActionParams.getentity;
725
- getgoods: ActionParams.getgoods;
940
+ getitems: ActionParams.getitems;
726
941
  getlocation: ActionParams.getlocation;
942
+ getlocdata: ActionParams.getlocdata;
727
943
  getnearby: ActionParams.getnearby;
728
944
  getplayer: ActionParams.getplayer;
945
+ getstarter: ActionParams.getstarter;
729
946
  getsummaries: ActionParams.getsummaries;
947
+ grouptravel: ActionParams.grouptravel;
730
948
  hash: ActionParams.hash;
731
949
  hash512: ActionParams.hash512;
732
950
  init: ActionParams.init;
733
951
  join: ActionParams.join;
734
- logcancel: ActionParams.logcancel;
735
- logresolve: ActionParams.logresolve;
952
+ notify: ActionParams.notify;
736
953
  payloan: ActionParams.payloan;
737
954
  purgesupply: ActionParams.purgesupply;
738
955
  recharge: ActionParams.recharge;
739
956
  resolve: ActionParams.resolve;
740
957
  salt: ActionParams.salt;
741
- sellgoods: ActionParams.sellgoods;
958
+ sellitems: ActionParams.sellitems;
742
959
  takeloan: ActionParams.takeloan;
743
960
  transfer: ActionParams.transfer;
744
961
  travel: ActionParams.travel;
@@ -749,20 +966,25 @@ interface ActionNameParams {
749
966
  }
750
967
  type ActionNames = keyof ActionNameParams;
751
968
  interface ActionReturnValues {
752
- buygoods: Types.task_results;
969
+ buyitems: Types.task_results;
753
970
  cancel: Types.cancel_results;
971
+ extract: Types.task_results;
972
+ getconfig: Types.game_config;
754
973
  getentities: Types.entity_info[];
755
974
  getentity: Types.entity_info;
756
- getgoods: Types.goods_info;
975
+ getitems: Types.items_info;
757
976
  getlocation: Types.location_info;
977
+ getlocdata: Types.location_derived;
758
978
  getnearby: Types.nearby_info;
759
979
  getplayer: Types.player_info;
980
+ getstarter: Types.starter_info;
760
981
  getsummaries: Types.entity_summary[];
982
+ grouptravel: Types.task_results;
761
983
  hash: Checksum256;
762
984
  hash512: Checksum512;
763
985
  recharge: Types.task_results;
764
986
  resolve: Types.resolve_results;
765
- sellgoods: Types.task_results;
987
+ sellitems: Types.task_results;
766
988
  transfer: Types.task_results;
767
989
  travel: Types.task_results;
768
990
  }
@@ -817,11 +1039,11 @@ declare const ERROR_SYSTEM_DISABLED = "This game is currently disabled.";
817
1039
  declare const ERROR_SYSTEM_NOT_INITIALIZED = "This game has not been initialized.";
818
1040
  declare const GAME_NOT_FOUND = "Cannot find game for given account name.";
819
1041
  declare const GAME_SEED_NOT_SET = "This game has not initialized an epoch seed value.";
820
- declare const GOOD_DOES_NOT_EXIST = "Good does not exist.";
821
- declare const GOOD_NOT_AVAILABLE_AT_LOCATION = "Good is not tradeable at ship location.";
1042
+ declare const ITEM_DOES_NOT_EXIST = "Item does not exist.";
1043
+ declare const ITEM_NOT_AVAILABLE_AT_LOCATION = "Item is not tradeable at ship location.";
822
1044
  declare const INSUFFICIENT_BALANCE = "Insufficient balance.";
823
- declare const INSUFFICIENT_GOOD_QUANTITY = "Insufficient quantity in cargo.";
824
- declare const INSUFFICIENT_GOOD_SUPPLY = "Insufficient supply of good at location.";
1045
+ declare const INSUFFICIENT_ITEM_QUANTITY = "Insufficient quantity in cargo.";
1046
+ declare const INSUFFICIENT_ITEM_SUPPLY = "Insufficient supply of item at location.";
825
1047
  declare const INVALID_AMOUNT = "Invalid amount.";
826
1048
  declare const REQUIRES_MORE_THAN_ONE = "A value greater than one is required.";
827
1049
  declare const REQUIRES_POSITIVE_VALUE = "Value must be greater than zero.";
@@ -851,12 +1073,32 @@ declare const WAREHOUSE_ALREADY_AT_LOCATION = "Warehouse already exists at this
851
1073
  declare const WAREHOUSE_CAPACITY_EXCEEDED = "Warehouse capacity would be exceeded.";
852
1074
 
853
1075
  declare const PRECISION = 10000;
854
- declare const INITIAL_SHIP_MASS = 500000;
1076
+ declare const INITIAL_SHIP_GENERATOR_CAPACITY = 350;
1077
+ declare const INITIAL_SHIP_DRAIN = 25;
1078
+ declare const INITIAL_SHIP_ENERGY = 350;
1079
+ declare const INITIAL_SHIP_HULLMASS = 100000;
1080
+ declare const INITIAL_SHIP_CAPACITY = 500000;
1081
+ declare const INITIAL_SHIP_Z = 800;
1082
+ declare const INITIAL_SHIP_RECHARGE = 10;
1083
+ declare const INITIAL_SHIP_THRUST = 250;
1084
+ declare const INITIAL_LOADER_MASS = 1000;
1085
+ declare const INITIAL_LOADER_QUANTITY = 1;
1086
+ declare const INITIAL_LOADER_THRUST = 1;
1087
+ declare const WAREHOUSE_Z = 500;
1088
+ declare const INITIAL_WAREHOUSE_CAPACITY = 10000000;
1089
+ declare const CONTAINER_Z = 300;
1090
+ declare const INITIAL_CONTAINER_HULLMASS = 50000;
1091
+ declare const INITIAL_CONTAINER_CAPACITY = 2000000;
1092
+ declare const TRAVEL_MAX_DURATION = 86400;
855
1093
  declare const MIN_ORBITAL_ALTITUDE = 800;
856
1094
  declare const MAX_ORBITAL_ALTITUDE = 3000;
1095
+ declare const INITIAL_SHIP_MASS = 500000;
1096
+ declare const INITIAL_EXTRACTOR_RATE = 700;
1097
+ declare const INITIAL_EXTRACTOR_DRAIN = 2500;
1098
+ declare const INITIAL_EXTRACTOR_EFFICIENCY = 5000;
857
1099
  interface ShipLike {
858
- location: Types.coordinates;
859
- mass: UInt32;
1100
+ coordinates: Types.coordinates;
1101
+ hullmass: UInt32;
860
1102
  energy: UInt16;
861
1103
  engines: Types.movement_stats;
862
1104
  generator: Types.energy_stats;
@@ -864,14 +1106,23 @@ interface ShipLike {
864
1106
  capacity: UInt32;
865
1107
  }
866
1108
  interface CargoMassInfo {
867
- good_id: UInt16Type;
1109
+ item_id: UInt16Type;
868
1110
  quantity: UInt32Type;
869
1111
  }
870
1112
  declare enum TaskType {
871
- RECHARGE = 0,
872
- LOAD = 1,
873
- UNLOAD = 2,
874
- FLIGHT = 3
1113
+ IDLE = 0,
1114
+ TRAVEL = 1,
1115
+ RECHARGE = 2,
1116
+ LOAD = 3,
1117
+ UNLOAD = 4,
1118
+ EXTRACT = 5,
1119
+ WARP = 6
1120
+ }
1121
+ declare enum LocationType {
1122
+ EMPTY = 0,
1123
+ PLANET = 1,
1124
+ ASTEROID = 2,
1125
+ NEBULA = 3
875
1126
  }
876
1127
  declare enum TaskCancelable {
877
1128
  NEVER = 0,
@@ -881,6 +1132,7 @@ declare enum TaskCancelable {
881
1132
  declare const EntityType$1: {
882
1133
  readonly SHIP: Name;
883
1134
  readonly WAREHOUSE: Name;
1135
+ readonly CONTAINER: Name;
884
1136
  };
885
1137
  type EntityTypeName = (typeof EntityType$1)[keyof typeof EntityType$1];
886
1138
  type CoordinatesType = Coordinates | Types.coordinates | {
@@ -890,22 +1142,29 @@ type CoordinatesType = Coordinates | Types.coordinates | {
890
1142
  declare class Coordinates extends Types.coordinates {
891
1143
  static from(value: CoordinatesType): Coordinates;
892
1144
  equals(other: CoordinatesType): boolean;
1145
+ toLocationId(): UInt64;
893
1146
  }
1147
+ declare function coordsToLocationId(coords: CoordinatesType): UInt64;
894
1148
  interface Distance {
895
1149
  origin: ActionParams.Type.coordinates;
896
1150
  destination: ActionParams.Type.coordinates;
897
1151
  distance: UInt16;
898
1152
  }
899
- declare class Good extends Struct {
1153
+ type ResourceCategory = 'metal' | 'gas' | 'mineral' | 'organic';
1154
+ type ResourceRarity = 'common' | 'uncommon' | 'rare' | 'epic' | 'legendary';
1155
+ declare class Item extends Struct {
900
1156
  id: UInt16;
901
1157
  name: string;
902
1158
  description: string;
903
1159
  base_price: UInt32;
904
1160
  mass: UInt32;
1161
+ category: ResourceCategory;
1162
+ rarity: ResourceRarity;
1163
+ color: string;
905
1164
  }
906
- declare class GoodPrice extends Struct {
1165
+ declare class ItemPrice extends Struct {
907
1166
  id: UInt16;
908
- good: Good;
1167
+ item: Item;
909
1168
  price: UInt32;
910
1169
  supply: UInt16;
911
1170
  }
@@ -1147,21 +1406,29 @@ declare class Location {
1147
1406
  */
1148
1407
  static from(coordinates: CoordinatesType): Location;
1149
1408
  /**
1150
- * Check if this location has a system (planet)
1409
+ * Check if this location has a system (planet, asteroid, or nebula)
1151
1410
  */
1152
1411
  hasSystemAt(gameSeed: Checksum256Type): boolean;
1412
+ /**
1413
+ * Get the location type (EMPTY, PLANET, ASTEROID, or NEBULA)
1414
+ */
1415
+ getLocationTypeAt(gameSeed: Checksum256Type): LocationType;
1416
+ /**
1417
+ * Check if this location is extractable (asteroid or nebula)
1418
+ */
1419
+ isExtractableAt(gameSeed: Checksum256Type): boolean;
1153
1420
  /**
1154
1421
  * Set cached market prices for this location
1155
1422
  */
1156
- setMarketPrices(prices: GoodPrice[]): void;
1423
+ setMarketPrices(prices: ItemPrice[]): void;
1157
1424
  /**
1158
1425
  * Get cached market prices (returns undefined if not cached)
1159
1426
  */
1160
- get marketPrices(): GoodPrice[] | undefined;
1427
+ get marketPrices(): ItemPrice[] | undefined;
1161
1428
  /**
1162
1429
  * Get price for a specific good (from cache)
1163
1430
  */
1164
- getPrice(goodId: UInt16Type): GoodPrice | undefined;
1431
+ getPrice(goodId: UInt16Type): ItemPrice | undefined;
1165
1432
  /**
1166
1433
  * Find nearby planets from this location
1167
1434
  */
@@ -1173,11 +1440,11 @@ declare class Location {
1173
1440
  /**
1174
1441
  * Set location rows (supply data) for this location
1175
1442
  */
1176
- setLocationRows(rows: Types.location_row[], epoch: UInt64): void;
1443
+ setLocationRows(rows: Types.supply_row[], epoch: UInt64): void;
1177
1444
  /**
1178
1445
  * Get cached location rows (supply data)
1179
1446
  */
1180
- get locationRows(): Types.location_row[] | undefined;
1447
+ get locationRows(): Types.supply_row[] | undefined;
1181
1448
  /**
1182
1449
  * Get supply for a specific good at this location
1183
1450
  * Returns undefined if location rows not cached or good not found
@@ -1187,7 +1454,7 @@ declare class Location {
1187
1454
  * Get all available goods at this location (goods with supply > 0)
1188
1455
  * Returns undefined if location rows not cached
1189
1456
  */
1190
- get availableGoods(): Types.location_row[] | undefined;
1457
+ get availableGoods(): Types.supply_row[] | undefined;
1191
1458
  /**
1192
1459
  * Check if a specific good is available (has supply)
1193
1460
  * Returns false if location rows not cached
@@ -1233,32 +1500,85 @@ declare class Location {
1233
1500
  declare function toLocation(coords: CoordinatesType | Location): Location;
1234
1501
 
1235
1502
  declare class LocationsManager extends BaseManager {
1236
- getMarketPrice(location: CoordinatesType, goodId: number): Promise<GoodPrice>;
1237
- getMarketPrices(location: CoordinatesType): Promise<GoodPrice[]>;
1238
- getMarketPricesWithSupply(location: CoordinatesType): Promise<GoodPrice[]>;
1503
+ getMarketPrice(location: CoordinatesType, goodId: number): Promise<ItemPrice>;
1504
+ getMarketPrices(location: CoordinatesType): Promise<ItemPrice[]>;
1505
+ getMarketPricesWithSupply(location: CoordinatesType): Promise<ItemPrice[]>;
1239
1506
  hasSystem(location: CoordinatesType): Promise<boolean>;
1240
1507
  findNearbyPlanets(origin: CoordinatesType, maxDistance?: UInt16Type): Promise<Distance[]>;
1241
- getLocation(location: CoordinatesType): Promise<any[]>;
1508
+ getSupplyRows(location: CoordinatesType): Promise<any[]>;
1242
1509
  getLocationWithPrices(coords: CoordinatesType): Promise<Location>;
1243
1510
  getLocationWithSupply(coords: CoordinatesType): Promise<Location>;
1244
1511
  getLocationComplete(coords: CoordinatesType): Promise<Location>;
1512
+ getLocationEntity(id: UInt64Type): Promise<Types.location_row | undefined>;
1513
+ getLocationEntityAt(coords: CoordinatesType): Promise<Types.location_row | undefined>;
1514
+ getAllLocationEntities(): Promise<Types.location_row[]>;
1515
+ }
1516
+
1517
+ interface MovementCapability {
1518
+ engines: Types.movement_stats;
1519
+ generator: Types.energy_stats;
1520
+ }
1521
+ interface EnergyCapability {
1522
+ energy: UInt16;
1523
+ }
1524
+ interface StorageCapability {
1525
+ capacity: UInt32;
1526
+ cargomass: UInt32;
1527
+ cargo: Types.cargo_item[];
1528
+ }
1529
+ interface LoaderCapability {
1530
+ loaders: Types.loader_stats;
1531
+ }
1532
+ interface TradeCapability {
1533
+ trade: Types.trade_stats;
1534
+ }
1535
+ interface ExtractorCapability {
1536
+ extractor: Types.extractor_stats;
1537
+ }
1538
+ interface MassCapability {
1539
+ hullmass: UInt32;
1540
+ }
1541
+ interface ScheduleCapability {
1542
+ schedule?: Types.schedule;
1245
1543
  }
1544
+ interface EntityCapabilities {
1545
+ hullmass?: UInt32;
1546
+ capacity?: UInt32;
1547
+ engines?: Types.movement_stats;
1548
+ generator?: Types.energy_stats;
1549
+ loaders?: Types.loader_stats;
1550
+ trade?: Types.trade_stats;
1551
+ extractor?: Types.extractor_stats;
1552
+ }
1553
+ interface EntityState {
1554
+ owner: Name;
1555
+ location: Types.coordinates;
1556
+ energy?: UInt16;
1557
+ cargomass: UInt32;
1558
+ cargo: Types.cargo_item[];
1559
+ }
1560
+ declare function capsHasMovement(caps: EntityCapabilities): boolean;
1561
+ declare function capsHasStorage(caps: EntityCapabilities): boolean;
1562
+ declare function capsHasLoaders(caps: EntityCapabilities): boolean;
1563
+ declare function capsHasTrade(caps: EntityCapabilities): boolean;
1564
+ declare function capsHasExtractor(caps: EntityCapabilities): boolean;
1565
+ declare function capsHasMass(caps: EntityCapabilities): boolean;
1246
1566
 
1247
1567
  type Schedule = Types.schedule;
1248
- type Task = Types.task;
1568
+ type Task$1 = Types.task;
1249
1569
  interface ScheduleData {
1250
1570
  schedule?: Schedule;
1251
1571
  }
1252
1572
  interface Scheduleable extends ScheduleData {
1253
1573
  hasSchedule: boolean;
1254
1574
  isIdle: boolean;
1255
- tasks: Task[];
1575
+ tasks: Task$1[];
1256
1576
  scheduleDuration(): number;
1257
1577
  scheduleElapsed(now: Date): number;
1258
1578
  scheduleRemaining(now: Date): number;
1259
1579
  scheduleComplete(now: Date): boolean;
1260
1580
  currentTaskIndex(now: Date): number;
1261
- currentTask(now: Date): Task | undefined;
1581
+ currentTask(now: Date): Task$1 | undefined;
1262
1582
  currentTaskType(now: Date): TaskType | undefined;
1263
1583
  getTaskStartTime(index: number): number;
1264
1584
  getTaskElapsed(index: number, now: Date): number;
@@ -1268,15 +1588,15 @@ interface Scheduleable extends ScheduleData {
1268
1588
  currentTaskProgress(now: Date): number;
1269
1589
  scheduleProgress(now: Date): number;
1270
1590
  }
1271
- declare function hasSchedule(entity: ScheduleData): boolean;
1591
+ declare function hasSchedule$1(entity: ScheduleData): boolean;
1272
1592
  declare function isIdle(entity: ScheduleData): boolean;
1273
- declare function getTasks(entity: ScheduleData): Task[];
1593
+ declare function getTasks(entity: ScheduleData): Task$1[];
1274
1594
  declare function scheduleDuration(entity: ScheduleData): number;
1275
1595
  declare function scheduleElapsed(entity: ScheduleData, now: Date): number;
1276
1596
  declare function scheduleRemaining(entity: ScheduleData, now: Date): number;
1277
1597
  declare function scheduleComplete(entity: ScheduleData, now: Date): boolean;
1278
1598
  declare function currentTaskIndex(entity: ScheduleData, now: Date): number;
1279
- declare function currentTask(entity: ScheduleData, now: Date): Task | undefined;
1599
+ declare function currentTask(entity: ScheduleData, now: Date): Task$1 | undefined;
1280
1600
  declare function currentTaskType(entity: ScheduleData, now: Date): TaskType | undefined;
1281
1601
  declare function getTaskStartTime(entity: ScheduleData, index: number): number;
1282
1602
  declare function getTaskElapsed(entity: ScheduleData, index: number, now: Date): number;
@@ -1285,10 +1605,15 @@ declare function isTaskComplete(entity: ScheduleData, index: number, now: Date):
1285
1605
  declare function isTaskInProgress(entity: ScheduleData, index: number, now: Date): boolean;
1286
1606
  declare function currentTaskProgress(entity: ScheduleData, now: Date): number;
1287
1607
  declare function scheduleProgress(entity: ScheduleData, now: Date): number;
1608
+ declare function isTaskType(entity: ScheduleData, taskType: TaskType, now: Date): boolean;
1609
+ declare function isInFlight(entity: ScheduleData, now: Date): boolean;
1610
+ declare function isRecharging(entity: ScheduleData, now: Date): boolean;
1611
+ declare function isLoading(entity: ScheduleData, now: Date): boolean;
1612
+ declare function isUnloading(entity: ScheduleData, now: Date): boolean;
1613
+ declare function isExtracting(entity: ScheduleData, now: Date): boolean;
1288
1614
 
1289
1615
  type schedule_ScheduleData = ScheduleData;
1290
1616
  type schedule_Scheduleable = Scheduleable;
1291
- declare const schedule_hasSchedule: typeof hasSchedule;
1292
1617
  declare const schedule_isIdle: typeof isIdle;
1293
1618
  declare const schedule_getTasks: typeof getTasks;
1294
1619
  declare const schedule_scheduleDuration: typeof scheduleDuration;
@@ -1305,11 +1630,17 @@ declare const schedule_isTaskComplete: typeof isTaskComplete;
1305
1630
  declare const schedule_isTaskInProgress: typeof isTaskInProgress;
1306
1631
  declare const schedule_currentTaskProgress: typeof currentTaskProgress;
1307
1632
  declare const schedule_scheduleProgress: typeof scheduleProgress;
1633
+ declare const schedule_isTaskType: typeof isTaskType;
1634
+ declare const schedule_isInFlight: typeof isInFlight;
1635
+ declare const schedule_isRecharging: typeof isRecharging;
1636
+ declare const schedule_isLoading: typeof isLoading;
1637
+ declare const schedule_isUnloading: typeof isUnloading;
1638
+ declare const schedule_isExtracting: typeof isExtracting;
1308
1639
  declare namespace schedule {
1309
1640
  export {
1310
1641
  schedule_ScheduleData as ScheduleData,
1311
1642
  schedule_Scheduleable as Scheduleable,
1312
- schedule_hasSchedule as hasSchedule,
1643
+ hasSchedule$1 as hasSchedule,
1313
1644
  schedule_isIdle as isIdle,
1314
1645
  schedule_getTasks as getTasks,
1315
1646
  schedule_scheduleDuration as scheduleDuration,
@@ -1326,24 +1657,15 @@ declare namespace schedule {
1326
1657
  schedule_isTaskInProgress as isTaskInProgress,
1327
1658
  schedule_currentTaskProgress as currentTaskProgress,
1328
1659
  schedule_scheduleProgress as scheduleProgress,
1660
+ schedule_isTaskType as isTaskType,
1661
+ schedule_isInFlight as isInFlight,
1662
+ schedule_isRecharging as isRecharging,
1663
+ schedule_isLoading as isLoading,
1664
+ schedule_isUnloading as isUnloading,
1665
+ schedule_isExtracting as isExtracting,
1329
1666
  };
1330
1667
  }
1331
1668
 
1332
- declare class EntityInventory extends Types.cargo_item {
1333
- private _good?;
1334
- get good(): Good;
1335
- get name(): string;
1336
- get unitMass(): UInt32;
1337
- get totalMass(): UInt64;
1338
- get totalCost(): UInt64;
1339
- get hasCargo(): boolean;
1340
- get isEmpty(): boolean;
1341
- }
1342
-
1343
- /**
1344
- * Projected state of an entity after scheduled tasks complete.
1345
- * Mirrors contract's projected_entity struct.
1346
- */
1347
1669
  interface ProjectedEntity {
1348
1670
  location: Coordinates;
1349
1671
  energy: UInt16;
@@ -1353,46 +1675,161 @@ interface ProjectedEntity {
1353
1675
  engines?: Types.movement_stats;
1354
1676
  loaders?: Types.loader_stats;
1355
1677
  generator?: Types.energy_stats;
1678
+ trade?: Types.trade_stats;
1356
1679
  readonly totalMass: UInt64;
1680
+ hasMovement(): boolean;
1681
+ hasStorage(): boolean;
1682
+ hasLoaders(): boolean;
1683
+ hasTrade(): boolean;
1684
+ capabilities(): EntityCapabilities;
1685
+ state(): EntityState;
1357
1686
  }
1358
- /**
1359
- * Interface for entities that can be projected.
1360
- * Ships and Warehouses both implement this.
1361
- */
1362
1687
  interface Projectable extends ScheduleData {
1363
- location: Coordinates;
1364
- energy: UInt16;
1365
- mass: UInt32;
1688
+ coordinates: Coordinates | Types.coordinates;
1689
+ energy?: UInt16;
1690
+ hullmass?: UInt32;
1366
1691
  generator?: Types.energy_stats;
1367
1692
  engines?: Types.movement_stats;
1368
1693
  loaders?: Types.loader_stats;
1369
- capacity?: UInt64;
1370
- calcCargoMass(): UInt64;
1694
+ trade?: Types.trade_stats;
1695
+ capacity?: UInt32;
1696
+ cargo: Types.cargo_item[];
1697
+ cargomass: UInt32;
1698
+ owner?: Name;
1371
1699
  }
1372
- /**
1373
- * Create initial projected entity state from a projectable entity.
1374
- */
1375
1700
  declare function createProjectedEntity(entity: Projectable): ProjectedEntity;
1376
- /**
1377
- * Project entity state after all scheduled tasks complete.
1378
- * Mirrors contract's project_ship/project_warehouse methods.
1379
- */
1380
1701
  declare function projectEntity(entity: Projectable): ProjectedEntity;
1381
- /**
1382
- * Project entity state at a specific time (partial task execution).
1383
- */
1384
1702
  declare function projectEntityAt(entity: Projectable, now: Date): ProjectedEntity;
1385
1703
 
1704
+ type Task = Types.task;
1705
+ declare class ScheduleAccessor {
1706
+ private entity;
1707
+ constructor(entity: ScheduleData);
1708
+ get hasSchedule(): boolean;
1709
+ get isIdle(): boolean;
1710
+ get tasks(): Task[];
1711
+ duration(): number;
1712
+ elapsed(now: Date): number;
1713
+ remaining(now: Date): number;
1714
+ complete(now: Date): boolean;
1715
+ currentTaskIndex(now: Date): number;
1716
+ currentTask(now: Date): Task | undefined;
1717
+ currentTaskType(now: Date): TaskType | undefined;
1718
+ taskStartTime(index: number): number;
1719
+ taskElapsed(index: number, now: Date): number;
1720
+ taskRemaining(index: number, now: Date): number;
1721
+ taskComplete(index: number, now: Date): boolean;
1722
+ taskInProgress(index: number, now: Date): boolean;
1723
+ currentTaskProgress(now: Date): number;
1724
+ progress(now: Date): number;
1725
+ }
1726
+ declare function createScheduleAccessor(entity: ScheduleData): ScheduleAccessor;
1727
+
1728
+ declare class EntityInventory extends Types.cargo_item {
1729
+ private _item?;
1730
+ get item(): Item;
1731
+ get good(): Item;
1732
+ get name(): string;
1733
+ get unitMass(): UInt32;
1734
+ get totalMass(): UInt64;
1735
+ get totalCost(): UInt64;
1736
+ get hasCargo(): boolean;
1737
+ get isEmpty(): boolean;
1738
+ }
1739
+
1740
+ interface HasCargo {
1741
+ cargo: Types.cargo_item[];
1742
+ }
1743
+ interface HasCapacity {
1744
+ capacity: UInt32;
1745
+ }
1746
+ interface HasCargomass {
1747
+ cargomass: UInt32;
1748
+ }
1749
+ declare function calcCargoMass(entity: HasCargo): UInt64;
1750
+ declare function calcCargoValue(entity: HasCargo): UInt64;
1751
+ declare function availableCapacity$1(entity: StorageCapability): UInt64;
1752
+ declare function availableCapacityFromMass(capacity: UInt64Type, cargoMass: UInt64Type): UInt64;
1753
+ declare function hasSpace$1(entity: StorageCapability, goodMass: UInt64, quantity: number): boolean;
1754
+ declare function hasSpaceForMass(capacity: UInt64Type, currentMass: UInt64Type, additionalMass: UInt64Type): boolean;
1755
+ declare function isFull$1(entity: HasCapacity & HasCargomass): boolean;
1756
+ declare function isFullFromMass(capacity: UInt64Type, cargoMass: UInt64Type): boolean;
1757
+
1758
+ declare class InventoryAccessor {
1759
+ private readonly entity;
1760
+ private _items?;
1761
+ constructor(entity: HasCargo);
1762
+ get items(): EntityInventory[];
1763
+ get totalMass(): UInt64;
1764
+ get totalValue(): UInt64;
1765
+ forItem(goodId: UInt64Type): EntityInventory | undefined;
1766
+ get sellable(): EntityInventory[];
1767
+ get hasSellable(): boolean;
1768
+ get sellableCount(): number;
1769
+ }
1770
+ declare function createInventoryAccessor(entity: HasCargo): InventoryAccessor;
1771
+
1772
+ interface CargoData {
1773
+ cargo: EntityInventory[];
1774
+ }
1775
+ declare function totalCargoMass(cargo: EntityInventory[]): UInt64;
1776
+ declare function cargoValue(cargo: EntityInventory[]): UInt64;
1777
+ declare function getCargoForItem(cargo: EntityInventory[], goodId: UInt64Type): EntityInventory | undefined;
1778
+ declare function hasSpace(currentMass: UInt64, maxCapacity: UInt64, goodMass: UInt64, quantity: number): boolean;
1779
+ declare function availableCapacity(currentMass: UInt64, maxCapacity: UInt64): UInt64;
1780
+ declare function isFull(currentMass: UInt64, maxCapacity: UInt64): boolean;
1781
+ interface SaleValue {
1782
+ revenue: UInt64;
1783
+ profit: UInt64;
1784
+ cost: UInt64;
1785
+ }
1786
+ declare function calculateSaleValue(cargo: Types.cargo_item[], prices: Map<number, UInt64>): SaleValue;
1787
+ declare function calculateSaleValueFromArray(cargo: Types.cargo_item[], prices: UInt64[]): SaleValue;
1788
+ declare function afterSellItems(cargo: Types.cargo_item[], goodsToSell: Array<{
1789
+ goodId: number;
1790
+ quantity: number;
1791
+ }>): EntityInventory[];
1792
+ declare function afterSellAllItems(cargo: Types.cargo_item[]): EntityInventory[];
1793
+
1794
+ type cargoUtils_CargoData = CargoData;
1795
+ declare const cargoUtils_totalCargoMass: typeof totalCargoMass;
1796
+ declare const cargoUtils_cargoValue: typeof cargoValue;
1797
+ declare const cargoUtils_getCargoForItem: typeof getCargoForItem;
1798
+ declare const cargoUtils_hasSpace: typeof hasSpace;
1799
+ declare const cargoUtils_availableCapacity: typeof availableCapacity;
1800
+ declare const cargoUtils_isFull: typeof isFull;
1801
+ type cargoUtils_SaleValue = SaleValue;
1802
+ declare const cargoUtils_calculateSaleValue: typeof calculateSaleValue;
1803
+ declare const cargoUtils_calculateSaleValueFromArray: typeof calculateSaleValueFromArray;
1804
+ declare const cargoUtils_afterSellItems: typeof afterSellItems;
1805
+ declare const cargoUtils_afterSellAllItems: typeof afterSellAllItems;
1806
+ declare namespace cargoUtils {
1807
+ export {
1808
+ cargoUtils_CargoData as CargoData,
1809
+ cargoUtils_totalCargoMass as totalCargoMass,
1810
+ cargoUtils_cargoValue as cargoValue,
1811
+ cargoUtils_getCargoForItem as getCargoForItem,
1812
+ cargoUtils_hasSpace as hasSpace,
1813
+ cargoUtils_availableCapacity as availableCapacity,
1814
+ cargoUtils_isFull as isFull,
1815
+ cargoUtils_SaleValue as SaleValue,
1816
+ cargoUtils_calculateSaleValue as calculateSaleValue,
1817
+ cargoUtils_calculateSaleValueFromArray as calculateSaleValueFromArray,
1818
+ cargoUtils_afterSellItems as afterSellItems,
1819
+ cargoUtils_afterSellAllItems as afterSellAllItems,
1820
+ };
1821
+ }
1822
+
1386
1823
  interface ShipStateInput {
1387
1824
  id: UInt64Type;
1388
- owner: NameType;
1825
+ owner: string;
1389
1826
  name: string;
1390
- location: CoordinatesType | {
1827
+ coordinates: CoordinatesType | {
1391
1828
  x: number;
1392
1829
  y: number;
1393
1830
  z?: number;
1394
1831
  };
1395
- mass: number;
1832
+ hullmass: number;
1396
1833
  capacity: number;
1397
1834
  energy: number;
1398
1835
  engines: Types.movement_stats;
@@ -1401,30 +1838,15 @@ interface ShipStateInput {
1401
1838
  schedule?: Types.schedule;
1402
1839
  cargo?: Types.cargo_item[];
1403
1840
  }
1404
- declare class Ship extends Types.entity_info implements Scheduleable {
1405
- static fromState(state: ShipStateInput): Ship;
1406
- private _location?;
1407
- private _inventory?;
1841
+ declare class Ship extends Types.entity_info {
1842
+ private _sched?;
1843
+ private _inv?;
1408
1844
  get name(): string;
1845
+ get inv(): InventoryAccessor;
1409
1846
  get inventory(): EntityInventory[];
1847
+ get sched(): ScheduleAccessor;
1410
1848
  get maxDistance(): UInt32;
1411
- get hasSchedule(): boolean;
1412
1849
  get isIdle(): boolean;
1413
- get tasks(): Types.task[];
1414
- scheduleDuration(): number;
1415
- scheduleElapsed(now: Date): number;
1416
- scheduleRemaining(now: Date): number;
1417
- scheduleComplete(now: Date): boolean;
1418
- currentTaskIndex(now: Date): number;
1419
- currentTask(now: Date): Types.task | undefined;
1420
- currentTaskType(now: Date): TaskType | undefined;
1421
- getTaskStartTime(index: number): number;
1422
- getTaskElapsed(index: number, now: Date): number;
1423
- getTaskRemaining(index: number, now: Date): number;
1424
- isTaskComplete(index: number, now: Date): boolean;
1425
- isTaskInProgress(index: number, now: Date): boolean;
1426
- currentTaskProgress(now: Date): number;
1427
- scheduleProgress(now: Date): number;
1428
1850
  getFlightOrigin(flightTaskIndex: number): Coordinates;
1429
1851
  destinationLocation(): Coordinates | undefined;
1430
1852
  positionAt(now: Date): Coordinates;
@@ -1432,20 +1854,19 @@ declare class Ship extends Types.entity_info implements Scheduleable {
1432
1854
  isRecharging(now: Date): boolean;
1433
1855
  isLoading(now: Date): boolean;
1434
1856
  isUnloading(now: Date): boolean;
1435
- calcCargoMass(): UInt64;
1436
- private createProjectedEntity;
1857
+ isExtracting(now: Date): boolean;
1858
+ get hasExtractor(): boolean;
1859
+ get hasWarp(): boolean;
1437
1860
  project(): ProjectedEntity;
1438
1861
  projectAt(now: Date): ProjectedEntity;
1439
- get currentLocation(): Coordinates;
1862
+ get location(): Location;
1440
1863
  get totalCargoMass(): UInt64;
1441
1864
  get cargoValue(): UInt64;
1442
1865
  get totalMass(): UInt64;
1443
1866
  get maxCapacity(): UInt64;
1444
1867
  hasSpace(goodMass: UInt64, quantity: number): boolean;
1445
1868
  get availableCapacity(): UInt64;
1446
- get locationObject(): Location;
1447
- setLocation(location: Location): void;
1448
- getCargoForGood(goodId: UInt64Type): EntityInventory | undefined;
1869
+ getCargoForItem(goodId: UInt64Type): EntityInventory | undefined;
1449
1870
  get sellableCargo(): EntityInventory[];
1450
1871
  get hasSellableCargo(): boolean;
1451
1872
  get sellableGoodsCount(): number;
@@ -1453,21 +1874,13 @@ declare class Ship extends Types.entity_info implements Scheduleable {
1453
1874
  get energyPercent(): number;
1454
1875
  get needsRecharge(): boolean;
1455
1876
  hasEnergyFor(distance: UInt64): boolean;
1456
- calculateSaleValue(prices: Map<number, UInt64>): {
1457
- revenue: UInt64;
1458
- profit: UInt64;
1459
- cost: UInt64;
1460
- };
1461
- calculateSaleValueFromArray(prices: UInt64[]): {
1462
- revenue: UInt64;
1463
- profit: UInt64;
1464
- cost: UInt64;
1465
- };
1466
- afterSellGoods(goodsToSell: Array<{
1877
+ calculateSaleValue(prices: Map<number, UInt64>): SaleValue;
1878
+ calculateSaleValueFromArray(prices: UInt64[]): SaleValue;
1879
+ afterSellItems(goodsToSell: Array<{
1467
1880
  goodId: number;
1468
1881
  quantity: number;
1469
1882
  }>): EntityInventory[];
1470
- afterSellAllGoods(): EntityInventory[];
1883
+ afterSellAllItems(): EntityInventory[];
1471
1884
  }
1472
1885
 
1473
1886
  /**
@@ -1542,6 +1955,13 @@ interface TransferEntity {
1542
1955
  } | number;
1543
1956
  };
1544
1957
  }
1958
+ interface HasScheduleAndLocation {
1959
+ coordinates: ActionParams.Type.coordinates;
1960
+ schedule?: Types.schedule;
1961
+ }
1962
+ declare function getFlightOrigin(entity: HasScheduleAndLocation, flightTaskIndex: number): ActionParams.Type.coordinates;
1963
+ declare function getDestinationLocation(entity: HasScheduleAndLocation): ActionParams.Type.coordinates | undefined;
1964
+ declare function getPositionAt(entity: HasScheduleAndLocation, taskIndex: number, taskProgress: number): ActionParams.Type.coordinates;
1545
1965
  declare function calc_transfer_duration(source: TransferEntity, dest: TransferEntity, cargoMass: number): number;
1546
1966
 
1547
1967
  /**
@@ -1552,8 +1972,8 @@ interface Deal {
1552
1972
  origin: Location;
1553
1973
  /** Destination location */
1554
1974
  destination: Location;
1555
- /** Good to trade */
1556
- good: GoodPrice;
1975
+ /** Item to trade */
1976
+ item: ItemPrice;
1557
1977
  /** Distance between origin and destination */
1558
1978
  distance: UInt64;
1559
1979
  /** Available supply at origin */
@@ -1597,11 +2017,11 @@ interface FindDealsOptions {
1597
2017
  /**
1598
2018
  * Calculate deals for a ship from a specific origin location
1599
2019
  */
1600
- declare function findDealsForShip(ship: Ship, originLocation: Coordinates, getNearbyLocations: (origin: Coordinates, maxDistance: number) => Promise<Location[]>, getMarketPrices: (location: Coordinates) => Promise<GoodPrice[]>, options?: FindDealsOptions): Promise<Deal[]>;
2020
+ declare function findDealsForShip(ship: Ship, originLocation: Coordinates, getNearbyLocations: (origin: Coordinates, maxDistance: number) => Promise<Location[]>, getMarketPrices: (location: Coordinates) => Promise<ItemPrice[]>, options?: FindDealsOptions): Promise<Deal[]>;
1601
2021
  /**
1602
2022
  * Find the single best deal for a ship from a specific origin location
1603
2023
  */
1604
- declare function findBestDeal(ship: Ship, originLocation: Coordinates, getNearbyLocations: (origin: Coordinates, maxDistance: number) => Promise<Location[]>, getMarketPrices: (location: Coordinates) => Promise<GoodPrice[]>, options?: FindDealsOptions): Promise<Deal | undefined>;
2024
+ declare function findBestDeal(ship: Ship, originLocation: Coordinates, getNearbyLocations: (origin: Coordinates, maxDistance: number) => Promise<Location[]>, getMarketPrices: (location: Coordinates) => Promise<ItemPrice[]>, options?: FindDealsOptions): Promise<Deal | undefined>;
1605
2025
 
1606
2026
  /**
1607
2027
  * Types of collect actions available to the player
@@ -1652,7 +2072,7 @@ interface CollectOption {
1652
2072
  /** Detailed breakdown of travel time components */
1653
2073
  travelTimeBreakdown?: EstimatedTravelTime;
1654
2074
  /** Info about a discounted good at the destination (for explore options) */
1655
- discountedGood?: DiscountedGoodInfo;
2075
+ discountedGood?: DiscountedItemInfo;
1656
2076
  /** Top potential deals available at destination (for explore options) */
1657
2077
  potentialDeals?: PotentialDeal[];
1658
2078
  /** Details of cargo being sold (if selling cargo) */
@@ -1765,7 +2185,7 @@ interface CargoSaleItem {
1765
2185
  /**
1766
2186
  * Info about a discounted good for explore options
1767
2187
  */
1768
- interface DiscountedGoodInfo {
2188
+ interface DiscountedItemInfo {
1769
2189
  goodId: number;
1770
2190
  name: string;
1771
2191
  rarity: string;
@@ -1784,13 +2204,13 @@ interface PotentialDeal {
1784
2204
  /**
1785
2205
  * Create an "Explore" option (travel to find opportunities)
1786
2206
  */
1787
- declare function createExploreOption(destination: Location, travelTime?: UInt32, discountedGood?: DiscountedGoodInfo, travelTimeBreakdown?: EstimatedTravelTime, potentialDeals?: PotentialDeal[]): CollectOption;
2207
+ declare function createExploreOption(destination: Location, travelTime?: UInt32, discountedGood?: DiscountedItemInfo, travelTimeBreakdown?: EstimatedTravelTime, potentialDeals?: PotentialDeal[]): CollectOption;
1788
2208
  /**
1789
2209
  * Callbacks for collect analysis (provided by manager)
1790
2210
  */
1791
2211
  interface CollectAnalysisCallbacks {
1792
2212
  getNearbyLocations: (origin: Coordinates, maxDistance: number) => Promise<Location[]>;
1793
- getMarketPrices: (location: Coordinates) => Promise<GoodPrice[]>;
2213
+ getMarketPrices: (location: Coordinates) => Promise<ItemPrice[]>;
1794
2214
  getGameSeed?: () => Checksum256Type;
1795
2215
  getState?: () => Types.state_row;
1796
2216
  }
@@ -1821,7 +2241,7 @@ declare class EpochsManager extends BaseManager {
1821
2241
  }
1822
2242
 
1823
2243
  interface SellableCargo {
1824
- good_id: {
2244
+ item_id: {
1825
2245
  toNumber(): number;
1826
2246
  } | number;
1827
2247
  quantity: {
@@ -1829,25 +2249,28 @@ interface SellableCargo {
1829
2249
  } | number;
1830
2250
  hasCargo: boolean;
1831
2251
  }
1832
- type CargoItemInput = {
1833
- goodId: UInt64Type;
1834
- quantity: UInt64Type;
1835
- unitCost?: UInt64Type;
2252
+ type EntityRefInput = {
2253
+ entityType: EntityTypeName;
2254
+ entityId: UInt64Type;
1836
2255
  };
1837
2256
  declare class ActionsManager extends BaseManager {
1838
2257
  travel(shipId: UInt64Type, destination: CoordinatesType, recharge?: boolean): Action;
2258
+ grouptravel(entities: EntityRefInput[], destination: CoordinatesType, recharge?: boolean): Action;
1839
2259
  resolve(entityId: UInt64Type, entityType?: EntityTypeName): Action;
1840
2260
  cancel(entityId: UInt64Type, count: UInt64Type, entityType?: EntityTypeName): Action;
1841
2261
  recharge(shipId: UInt64Type): Action;
1842
- transfer(sourceType: EntityTypeName, sourceId: UInt64Type, destType: EntityTypeName, destId: UInt64Type, cargo: CargoItemInput[]): Action;
1843
- buyGoods(shipId: UInt64Type, goodId: UInt64Type, quantity: UInt64Type): Action;
1844
- sellGoods(shipId: UInt64Type, goodId: UInt64Type, quantity: UInt64Type): Action;
2262
+ transfer(sourceType: EntityTypeName, sourceId: UInt64Type, destType: EntityTypeName, destId: UInt64Type, goodId: UInt64Type, quantity: UInt64Type): Action;
2263
+ buyItems(entityId: UInt64Type, goodId: UInt64Type, quantity: UInt64Type, entityType?: EntityTypeName): Action;
2264
+ sellItems(entityId: UInt64Type, goodId: UInt64Type, quantity: UInt64Type, entityType?: EntityTypeName): Action;
1845
2265
  buyShip(account: NameType, name: string): Action;
1846
2266
  buyWarehouse(account: NameType, shipId: UInt64Type, name: string): Action;
2267
+ buyContainer(account: NameType, shipId: UInt64Type, name: string): Action;
1847
2268
  takeLoan(account: NameType, amount: UInt64Type): Action;
1848
2269
  payLoan(account: NameType, amount: UInt64Type): Action;
1849
2270
  foundCompany(account: NameType, name: string): Action;
1850
2271
  join(account: NameType): Action;
2272
+ extract(shipId: UInt64Type): Action;
2273
+ warp(shipId: UInt64Type, destination: CoordinatesType): Action;
1851
2274
  joinGame(account: NameType, companyName: string): Action[];
1852
2275
  sellAllCargo(ship: Ship | UInt64Type, cargo?: SellableCargo[]): Action[];
1853
2276
  }
@@ -1889,9 +2312,9 @@ declare abstract class BaseManager {
1889
2312
 
1890
2313
  interface WarehouseStateInput {
1891
2314
  id: UInt64Type;
1892
- owner: NameType;
2315
+ owner: string;
1893
2316
  name: string;
1894
- location: CoordinatesType | {
2317
+ coordinates: CoordinatesType | {
1895
2318
  x: number;
1896
2319
  y: number;
1897
2320
  z?: number;
@@ -1901,56 +2324,71 @@ interface WarehouseStateInput {
1901
2324
  schedule?: Types.schedule;
1902
2325
  cargo?: Types.cargo_item[];
1903
2326
  }
1904
- declare class Warehouse extends Types.entity_info implements Scheduleable {
1905
- static fromState(state: WarehouseStateInput): Warehouse;
1906
- private _location?;
1907
- private _inventory?;
2327
+ declare class Warehouse extends Types.entity_info {
2328
+ private _sched?;
2329
+ private _inv?;
1908
2330
  get name(): string;
2331
+ get inv(): InventoryAccessor;
1909
2332
  get inventory(): EntityInventory[];
1910
- get hasSchedule(): boolean;
2333
+ get sched(): ScheduleAccessor;
1911
2334
  get isIdle(): boolean;
1912
- get tasks(): Types.task[];
1913
- scheduleDuration(): number;
1914
- scheduleElapsed(now: Date): number;
1915
- scheduleRemaining(now: Date): number;
1916
- scheduleComplete(now: Date): boolean;
1917
- currentTaskIndex(now: Date): number;
1918
- currentTask(now: Date): Types.task | undefined;
1919
- currentTaskType(now: Date): TaskType | undefined;
1920
- getTaskStartTime(index: number): number;
1921
- getTaskElapsed(index: number, now: Date): number;
1922
- getTaskRemaining(index: number, now: Date): number;
1923
- isTaskComplete(index: number, now: Date): boolean;
1924
- isTaskInProgress(index: number, now: Date): boolean;
1925
- currentTaskProgress(now: Date): number;
1926
- scheduleProgress(now: Date): number;
1927
2335
  isLoading(now: Date): boolean;
1928
2336
  isUnloading(now: Date): boolean;
1929
- calcCargoMass(): UInt64;
1930
- get currentLocation(): Coordinates;
2337
+ get location(): Location;
1931
2338
  get totalCargoMass(): UInt64;
1932
2339
  get cargoValue(): UInt64;
1933
2340
  get maxCapacity(): UInt64;
1934
2341
  get availableCapacity(): UInt64;
1935
2342
  hasSpace(goodMass: UInt64, quantity: number): boolean;
1936
2343
  get isFull(): boolean;
1937
- get locationObject(): Location;
1938
- setLocation(location: Location): void;
1939
- getCargoForGood(goodId: UInt64Type): EntityInventory | undefined;
2344
+ getCargoForItem(goodId: UInt64Type): EntityInventory | undefined;
1940
2345
  get orbitalAltitude(): number;
1941
2346
  }
1942
2347
 
1943
- type EntityType = 'ship' | 'warehouse';
2348
+ interface ContainerStateInput {
2349
+ id: UInt64Type;
2350
+ owner: string;
2351
+ name: string;
2352
+ coordinates: CoordinatesType | {
2353
+ x: number;
2354
+ y: number;
2355
+ z?: number;
2356
+ };
2357
+ hullmass: number;
2358
+ capacity: number;
2359
+ cargomass?: number;
2360
+ schedule?: Types.schedule;
2361
+ }
2362
+ declare class Container extends Types.entity_info {
2363
+ private _sched?;
2364
+ get name(): string;
2365
+ get sched(): ScheduleAccessor;
2366
+ get isIdle(): boolean;
2367
+ isLoading(now: Date): boolean;
2368
+ isUnloading(now: Date): boolean;
2369
+ get location(): Location;
2370
+ get totalMass(): UInt64;
2371
+ get maxCapacity(): UInt64;
2372
+ get availableCapacity(): UInt64;
2373
+ hasSpace(additionalMass: UInt64): boolean;
2374
+ get isFull(): boolean;
2375
+ get orbitalAltitude(): number;
2376
+ }
2377
+
2378
+ type EntityType = 'ship' | 'warehouse' | 'container' | 'location';
1944
2379
  declare class EntitiesManager extends BaseManager {
1945
- getEntity(type: EntityType, id: UInt64Type): Promise<Ship | Warehouse>;
1946
- getEntities(owner: NameType | Types.player_row, type?: EntityType): Promise<(Ship | Warehouse)[]>;
2380
+ getEntity(type: EntityType, id: UInt64Type): Promise<Ship | Warehouse | Container>;
2381
+ getEntities(owner: NameType | Types.player_row, type?: EntityType): Promise<(Ship | Warehouse | Container)[]>;
1947
2382
  getSummaries(owner: NameType | Types.player_row, type?: EntityType): Promise<Types.entity_summary[]>;
1948
2383
  getShip(id: UInt64Type): Promise<Ship>;
1949
2384
  getWarehouse(id: UInt64Type): Promise<Warehouse>;
2385
+ getContainer(id: UInt64Type): Promise<Container>;
1950
2386
  getShips(owner: NameType | Types.player_row): Promise<Ship[]>;
1951
2387
  getWarehouses(owner: NameType | Types.player_row): Promise<Warehouse[]>;
2388
+ getContainers(owner: NameType | Types.player_row): Promise<Container[]>;
1952
2389
  getShipSummaries(owner: NameType | Types.player_row): Promise<Types.entity_summary[]>;
1953
2390
  getWarehouseSummaries(owner: NameType | Types.player_row): Promise<Types.entity_summary[]>;
2391
+ getContainerSummaries(owner: NameType | Types.player_row): Promise<Types.entity_summary[]>;
1954
2392
  private wrapEntity;
1955
2393
  private resolveOwner;
1956
2394
  }
@@ -1981,9 +2419,13 @@ declare class Shipload {
1981
2419
  getState(reload?: boolean): Promise<GameState>;
1982
2420
  }
1983
2421
 
1984
- declare const goodIds: number[];
1985
- declare function getGood(goodId: UInt16Type): Good;
1986
- declare function getGoods(): Good[];
2422
+ declare function makeShip(state: ShipStateInput): Ship;
2423
+ declare function makeWarehouse(state: WarehouseStateInput): Warehouse;
2424
+ declare function makeContainer(state: ContainerStateInput): Container;
2425
+
2426
+ declare const itemIds: UInt16[];
2427
+ declare function getItem(itemId: UInt16Type): Item;
2428
+ declare function getItems(): Item[];
1987
2429
 
1988
2430
  declare enum Rarities {
1989
2431
  legendary = "LEGENDARY",
@@ -1999,13 +2441,55 @@ interface Rarity {
1999
2441
  maxMultiplier: number;
2000
2442
  }
2001
2443
  declare function getRarity(gameSeed: Checksum256Type, epochSeed: Checksum256Type, location: CoordinatesType, goodId: UInt16Type): Rarity;
2002
- declare function marketPrice(location: ActionParams.Type.coordinates, goodId: UInt16Type, gameSeed: Checksum256Type, state: Types.state_row): GoodPrice;
2003
- declare function marketPrices(location: ActionParams.Type.coordinates, gameSeed: Checksum256Type, state: Types.state_row): GoodPrice[];
2444
+ declare function marketPrice(location: ActionParams.Type.coordinates, goodId: UInt16Type, gameSeed: Checksum256Type, state: Types.state_row): ItemPrice;
2445
+ declare function marketPrices(location: ActionParams.Type.coordinates, gameSeed: Checksum256Type, state: Types.state_row): ItemPrice[];
2004
2446
 
2447
+ declare function getLocationType(gameSeed: Checksum256Type, coordinates: CoordinatesType): LocationType;
2448
+ declare function isExtractableLocation(locationType: LocationType): boolean;
2005
2449
  declare function getSystemName(gameSeed: Checksum256Type, location: CoordinatesType): string;
2006
2450
  declare function hasSystem(gameSeed: Checksum256Type, coordinates: CoordinatesType): boolean;
2451
+ declare function deriveLocationStatic(gameSeed: Checksum256Type, coordinates: CoordinatesType): Types.location_static;
2452
+ declare function deriveLocationEpoch(epochSeed: Checksum256Type, coordinates: CoordinatesType): Types.location_epoch;
2453
+ declare function deriveLocation(gameSeed: Checksum256Type, epochSeed: Checksum256Type, coordinates: CoordinatesType): Types.location_derived;
2454
+
2455
+ interface StratumInfo {
2456
+ itemId: number;
2457
+ seed: bigint;
2458
+ richness: number;
2459
+ reserve: number;
2460
+ }
2461
+ interface ResourceStats {
2462
+ purity: number;
2463
+ density: number;
2464
+ reactivity: number;
2465
+ resonance: number;
2466
+ }
2467
+ declare function deriveStratum(epochSeed: Checksum256Type, coords: CoordinatesType, stratum: number, locationType: number, subtype: number, _maxDepth: number): StratumInfo;
2468
+ declare function deriveResourceStats(seed: bigint): ResourceStats;
2469
+
2470
+ declare function deriveLocationSize(loc: Types.location_static): number;
2007
2471
 
2008
- declare function hash(seed: Checksum256Type, string: string): Checksum512;
2472
+ declare const DEPTH_THRESHOLD_COMMON = 0;
2473
+ declare const DEPTH_THRESHOLD_UNCOMMON = 2000;
2474
+ declare const DEPTH_THRESHOLD_RARE = 10000;
2475
+ declare const DEPTH_THRESHOLD_EPIC = 30000;
2476
+ declare const DEPTH_THRESHOLD_LEGENDARY = 55000;
2477
+ declare const LOCATION_MIN_DEPTH = 500;
2478
+ declare const LOCATION_MAX_DEPTH = 65535;
2479
+ declare const PLANET_SUBTYPE_GAS_GIANT = 0;
2480
+ declare const PLANET_SUBTYPE_ROCKY = 1;
2481
+ declare const PLANET_SUBTYPE_TERRESTRIAL = 2;
2482
+ declare const PLANET_SUBTYPE_ICY = 3;
2483
+ declare const PLANET_SUBTYPE_OCEAN = 4;
2484
+ declare const PLANET_SUBTYPE_INDUSTRIAL = 5;
2485
+ declare function getDepthThreshold(rarity: ResourceRarity): number;
2486
+ declare function getResourceRarity(itemId: number): ResourceRarity;
2487
+ declare function getResourceWeight(itemId: number, stratum: number): number;
2488
+ declare function getLocationCandidates(locationType: number, subtype: number): number[];
2489
+ declare function getEligibleResources(locationType: number, subtype: number, stratum: number): number[];
2490
+ declare function depthScaleFactor(stratum: number): number;
2491
+
2492
+ declare function hash(seed: Checksum256Type, string: string): Checksum256;
2009
2493
  declare function hash512(seed: Checksum256Type, string: string): Checksum512;
2010
2494
 
2011
2495
  /**
@@ -2043,7 +2527,7 @@ declare function calculateUpdatedCargoCost(currentPaid: UInt64, currentOwned: UI
2043
2527
  * Calculate the maximum quantity of a good a ship can buy
2044
2528
  * considering both space and player balance
2045
2529
  */
2046
- declare function calculateMaxTradeQuantity(ship: Ship, player: Player, goodPrice: GoodPrice): TradeCalculation;
2530
+ declare function calculateMaxTradeQuantity(ship: Ship, player: Player, goodPrice: ItemPrice): TradeCalculation;
2047
2531
  /**
2048
2532
  * Trade profit calculation result
2049
2533
  */
@@ -2068,8 +2552,8 @@ declare function calculateProfitPerSecond(profit: Int64Type, travelTimeSeconds:
2068
2552
  /**
2069
2553
  * Find the best good to trade between two locations
2070
2554
  */
2071
- declare function findBestGoodToTrade(ship: Ship, player: Player, originPrices: GoodPrice[], destPrices: GoodPrice[], travelTimeSeconds: UInt32Type): {
2072
- good: GoodPrice;
2555
+ declare function findBestItemToTrade(ship: Ship, player: Player, originPrices: ItemPrice[], destPrices: ItemPrice[], travelTimeSeconds: UInt32Type): {
2556
+ item: ItemPrice;
2073
2557
  quantity: number;
2074
2558
  profit: number;
2075
2559
  profitPerSecond: number;
@@ -2088,34 +2572,39 @@ declare function isProfitable(buyPrice: UInt32Type, sellPrice: UInt32Type): bool
2088
2572
  */
2089
2573
  declare function calculateROI(cost: number, profit: number): number;
2090
2574
 
2091
- interface CargoData {
2092
- cargo: EntityInventory[];
2093
- }
2094
- declare function totalCargoMass(cargo: EntityInventory[]): UInt64;
2095
- declare function cargoValue(cargo: EntityInventory[]): UInt64;
2096
- declare function getCargoForGood(cargo: EntityInventory[], goodId: UInt64Type): EntityInventory | undefined;
2097
- declare function hasSpace(currentMass: UInt64, maxCapacity: UInt64, goodMass: UInt64, quantity: number): boolean;
2098
- declare function availableCapacity(currentMass: UInt64, maxCapacity: UInt64): UInt64;
2099
- declare function isFull(currentMass: UInt64, maxCapacity: UInt64): boolean;
2575
+ interface Entity {
2576
+ id: UInt64;
2577
+ type: Name;
2578
+ owner: Name;
2579
+ entity_name: string;
2580
+ location: Coordinates | Types.coordinates;
2581
+ }
2582
+ type ShipEntity = Entity & MovementCapability & EnergyCapability & StorageCapability & LoaderCapability & MassCapability & ScheduleCapability & {
2583
+ trade?: Types.trade_stats;
2584
+ extractor?: Types.extractor_stats;
2585
+ };
2586
+ type WarehouseEntity = Entity & StorageCapability & LoaderCapability & ScheduleCapability;
2587
+ type ContainerEntity = Entity & StorageCapability & MassCapability & ScheduleCapability;
2588
+ type AnyEntity = ShipEntity | WarehouseEntity | ContainerEntity;
2100
2589
 
2101
- type cargoUtils_CargoData = CargoData;
2102
- declare const cargoUtils_totalCargoMass: typeof totalCargoMass;
2103
- declare const cargoUtils_cargoValue: typeof cargoValue;
2104
- declare const cargoUtils_getCargoForGood: typeof getCargoForGood;
2105
- declare const cargoUtils_hasSpace: typeof hasSpace;
2106
- declare const cargoUtils_availableCapacity: typeof availableCapacity;
2107
- declare const cargoUtils_isFull: typeof isFull;
2108
- declare namespace cargoUtils {
2109
- export {
2110
- cargoUtils_CargoData as CargoData,
2111
- cargoUtils_totalCargoMass as totalCargoMass,
2112
- cargoUtils_cargoValue as cargoValue,
2113
- cargoUtils_getCargoForGood as getCargoForGood,
2114
- cargoUtils_hasSpace as hasSpace,
2115
- cargoUtils_availableCapacity as availableCapacity,
2116
- cargoUtils_isFull as isFull,
2117
- };
2118
- }
2590
+ declare function canMove(e: Entity): e is Entity & MovementCapability & EnergyCapability;
2591
+ declare function hasEnergy(e: Entity): e is Entity & EnergyCapability;
2592
+ declare function hasStorage(e: Entity): e is Entity & StorageCapability;
2593
+ declare function hasLoaders(e: Entity): e is Entity & LoaderCapability;
2594
+ declare function hasTrade(e: Entity): e is Entity & TradeCapability;
2595
+ declare function hasMass(e: Entity): e is Entity & MassCapability;
2596
+ declare function hasSchedule(e: Entity): e is Entity & ScheduleCapability;
2597
+ declare function hasExtractor(e: Entity): e is Entity & ExtractorCapability;
2598
+
2599
+ declare function maxTravelDistance(entity: MovementCapability): UInt32;
2600
+ declare function calcEnergyUsage(entity: MovementCapability, distance: UInt64): UInt64;
2601
+ declare function energyPercent(entity: MovementCapability & EnergyCapability): number;
2602
+ declare function needsRecharge(entity: MovementCapability & EnergyCapability): boolean;
2603
+
2604
+ declare function calcLoadDuration(entity: LoaderCapability, cargoMass: UInt64): UInt32;
2605
+
2606
+ declare function calc_extraction_duration(extractor: Types.extractor_stats, cargoMass: number, stratum: number, richness: number): UInt32;
2607
+ declare function calc_extraction_energy(extractor: Types.extractor_stats, duration: number): UInt16;
2119
2608
 
2120
2609
  type movement_stats = Types.movement_stats;
2121
2610
  type energy_stats = Types.energy_stats;
@@ -2123,5 +2612,11 @@ type loader_stats = Types.loader_stats;
2123
2612
  type task = Types.task;
2124
2613
  type cargo_item = Types.cargo_item;
2125
2614
  type warehouse_row = Types.warehouse_row;
2615
+ type container_row = Types.container_row;
2616
+ type extractor_stats = Types.extractor_stats;
2617
+ type location_static = Types.location_static;
2618
+ type location_epoch = Types.location_epoch;
2619
+ type location_derived = Types.location_derived;
2620
+ type location_row = Types.location_row;
2126
2621
 
2127
- export { ActionsManager, BetterSaleLocation, COMMIT_ALREADY_SET, COMMIT_CANNOT_MATCH, COMMIT_NOT_SET, COMPANY_NOT_FOUND, CargoData, CargoMassInfo, CargoSaleItem, CollectActionType, CollectAnalysis, CollectAnalysisCallbacks, CollectAnalysisOptions, CollectOption, Coordinates, CoordinatesType, Deal, DiscountedGoodInfo, Distance, EPOCH_NON_ZERO, EPOCH_NOT_READY, ERROR_SYSTEM_ALREADY_INITIALIZED, ERROR_SYSTEM_DISABLED, ERROR_SYSTEM_NOT_INITIALIZED, EntitiesManager, EntityInventory, EntityType, EntityTypeName, EpochInfo, EpochsManager, EstimateTravelTimeOptions, EstimatedTravelTime, FindDealsOptions, GAME_NOT_FOUND, GAME_SEED_NOT_SET, GOOD_DOES_NOT_EXIST, GOOD_NOT_AVAILABLE_AT_LOCATION, GameState, Good, GoodPrice, INITIAL_SHIP_MASS, INSUFFICIENT_BALANCE, INSUFFICIENT_GOOD_QUANTITY, INSUFFICIENT_GOOD_SUPPLY, INVALID_AMOUNT, LoadTimeBreakdown, Location, LocationsManager, MAX_ORBITAL_ALTITUDE, MIN_ORBITAL_ALTITUDE, NO_SCHEDULE, PLAYER_ALREADY_JOINED, PLAYER_NOT_FOUND, PRECISION, platform as PlatformContract, Player, PlayerStateInput, PlayersManager, PotentialDeal, Projectable, ProjectedEntity, REQUIRES_MORE_THAN_ONE, REQUIRES_POSITIVE_VALUE, Rarities, Rarity, RepositionLocation, SHIP_ALREADY_THERE, SHIP_ALREADY_TRAVELING, SHIP_CANNOT_BUY_TRAVELING, SHIP_CANNOT_CANCEL_TASK, SHIP_CANNOT_UPDATE_TRAVELING, SHIP_CARGO_NOT_LOADED, SHIP_CARGO_NOT_OWNED, SHIP_INVALID_CARGO, SHIP_INVALID_DESTINATION, SHIP_INVALID_TRAVEL_DURATION, SHIP_NOT_ARRIVED, SHIP_NOT_ENOUGH_ENERGY, SHIP_NOT_ENOUGH_ENERGY_CAPACITY, SHIP_NOT_FOUND, SHIP_NOT_IDLE, SHIP_NOT_OWNED, SHIP_NO_COMPLETED_TASKS, SHIP_NO_TASKS_TO_CANCEL, ScheduleData, Scheduleable, server as ServerContract, Ship, ShipLike, ShipStateInput, Shipload, TaskCancelable, TaskType, TradeCalculation, TradeProfitResult, TradesManager, TransferEntity, WAREHOUSE_ALREADY_AT_LOCATION, WAREHOUSE_CAPACITY_EXCEEDED, WAREHOUSE_NOT_FOUND, Warehouse, analyzeCargoSale, analyzeCollectOptions, calc_acceleration, calc_energyusage, calc_flighttime, calc_loader_acceleration, calc_loader_flighttime, calc_orbital_altitude, calc_rechargetime, calc_ship_acceleration, calc_ship_flighttime, calc_ship_mass, calc_ship_rechargetime, calc_transfer_duration, calculateBreakEvenPrice, calculateFlightTime, calculateLoadTimeBreakdown, calculateMaxTradeQuantity, calculateProfitPerMass, calculateProfitPerSecond, calculateROI, calculateRefuelingTime, calculateTradeProfit, calculateTransferTime, calculateUpdatedCargoCost, cargoUtils, cargo_item, createExploreOption, createProjectedEntity, createSellAndRepositionOption, createSellAndStayOption, createSellAndTradeOption, createTravelToSellOption, Shipload as default, distanceBetweenCoordinates, distanceBetweenPoints, energy_stats, estimateDealTravelTime, estimateTravelTime, findBestDeal, findBestGoodToTrade, findDealsForShip, findNearbyPlanets, getCurrentEpoch, getEpochInfo, getGood, getGoods, getRarity, getSystemName, goodIds, hasEnergyForDistance, hasSystem, hash, hash512, isProfitable, lerp, loader_stats, marketPrice, marketPrices, movement_stats, projectEntity, projectEntityAt, rotation, schedule, task, toLocation, warehouse_row };
2622
+ export { ActionsManager, AnyEntity, BetterSaleLocation, COMMIT_ALREADY_SET, COMMIT_CANNOT_MATCH, COMMIT_NOT_SET, COMPANY_NOT_FOUND, CONTAINER_Z, CargoData, CargoMassInfo, CargoSaleItem, CollectActionType, CollectAnalysis, CollectAnalysisCallbacks, CollectAnalysisOptions, CollectOption, Container, ContainerEntity, ContainerStateInput, Coordinates, CoordinatesType, DEPTH_THRESHOLD_COMMON, DEPTH_THRESHOLD_EPIC, DEPTH_THRESHOLD_LEGENDARY, DEPTH_THRESHOLD_RARE, DEPTH_THRESHOLD_UNCOMMON, Deal, DiscountedItemInfo, Distance, EPOCH_NON_ZERO, EPOCH_NOT_READY, ERROR_SYSTEM_ALREADY_INITIALIZED, ERROR_SYSTEM_DISABLED, ERROR_SYSTEM_NOT_INITIALIZED, EnergyCapability, EntitiesManager, Entity, EntityCapabilities, EntityInventory, EntityRefInput, EntityState, EntityType, EntityTypeName, EpochInfo, EpochsManager, EstimateTravelTimeOptions, EstimatedTravelTime, ExtractorCapability, FindDealsOptions, GAME_NOT_FOUND, GAME_SEED_NOT_SET, GameState, HasCapacity, HasCargo, HasCargomass, HasScheduleAndLocation, INITIAL_CONTAINER_CAPACITY, INITIAL_CONTAINER_HULLMASS, INITIAL_EXTRACTOR_DRAIN, INITIAL_EXTRACTOR_EFFICIENCY, INITIAL_EXTRACTOR_RATE, INITIAL_LOADER_MASS, INITIAL_LOADER_QUANTITY, INITIAL_LOADER_THRUST, INITIAL_SHIP_CAPACITY, INITIAL_SHIP_DRAIN, INITIAL_SHIP_ENERGY, INITIAL_SHIP_GENERATOR_CAPACITY, INITIAL_SHIP_HULLMASS, INITIAL_SHIP_MASS, INITIAL_SHIP_RECHARGE, INITIAL_SHIP_THRUST, INITIAL_SHIP_Z, INITIAL_WAREHOUSE_CAPACITY, INSUFFICIENT_BALANCE, INSUFFICIENT_ITEM_QUANTITY, INSUFFICIENT_ITEM_SUPPLY, INVALID_AMOUNT, ITEM_DOES_NOT_EXIST, ITEM_NOT_AVAILABLE_AT_LOCATION, InventoryAccessor, Item, ItemPrice, LOCATION_MAX_DEPTH, LOCATION_MIN_DEPTH, LoadTimeBreakdown, LoaderCapability, Location, LocationType, LocationsManager, MAX_ORBITAL_ALTITUDE, MIN_ORBITAL_ALTITUDE, MassCapability, MovementCapability, NO_SCHEDULE, PLANET_SUBTYPE_GAS_GIANT, PLANET_SUBTYPE_ICY, PLANET_SUBTYPE_INDUSTRIAL, PLANET_SUBTYPE_OCEAN, PLANET_SUBTYPE_ROCKY, PLANET_SUBTYPE_TERRESTRIAL, PLAYER_ALREADY_JOINED, PLAYER_NOT_FOUND, PRECISION, platform as PlatformContract, Player, PlayerStateInput, PlayersManager, PotentialDeal, Projectable, ProjectedEntity, REQUIRES_MORE_THAN_ONE, REQUIRES_POSITIVE_VALUE, Rarities, Rarity, RepositionLocation, ResourceCategory, ResourceRarity, ResourceStats, SHIP_ALREADY_THERE, SHIP_ALREADY_TRAVELING, SHIP_CANNOT_BUY_TRAVELING, SHIP_CANNOT_CANCEL_TASK, SHIP_CANNOT_UPDATE_TRAVELING, SHIP_CARGO_NOT_LOADED, SHIP_CARGO_NOT_OWNED, SHIP_INVALID_CARGO, SHIP_INVALID_DESTINATION, SHIP_INVALID_TRAVEL_DURATION, SHIP_NOT_ARRIVED, SHIP_NOT_ENOUGH_ENERGY, SHIP_NOT_ENOUGH_ENERGY_CAPACITY, SHIP_NOT_FOUND, SHIP_NOT_IDLE, SHIP_NOT_OWNED, SHIP_NO_COMPLETED_TASKS, SHIP_NO_TASKS_TO_CANCEL, ScheduleAccessor, ScheduleCapability, ScheduleData, Scheduleable, server as ServerContract, Ship, ShipEntity, ShipLike, ShipStateInput, Shipload, StorageCapability, StratumInfo, TRAVEL_MAX_DURATION, TaskCancelable, TaskType, TradeCalculation, TradeCapability, TradeProfitResult, TradesManager, TransferEntity, WAREHOUSE_ALREADY_AT_LOCATION, WAREHOUSE_CAPACITY_EXCEEDED, WAREHOUSE_NOT_FOUND, WAREHOUSE_Z, Warehouse, WarehouseEntity, WarehouseStateInput, analyzeCargoSale, analyzeCollectOptions, availableCapacity$1 as availableCapacity, availableCapacityFromMass, calcCargoMass, calcCargoValue, calcEnergyUsage, calcLoadDuration, calc_acceleration, calc_energyusage, calc_extraction_duration, calc_extraction_energy, calc_flighttime, calc_loader_acceleration, calc_loader_flighttime, calc_orbital_altitude, calc_rechargetime, calc_ship_acceleration, calc_ship_flighttime, calc_ship_mass, calc_ship_rechargetime, calc_transfer_duration, calculateBreakEvenPrice, calculateFlightTime, calculateLoadTimeBreakdown, calculateMaxTradeQuantity, calculateProfitPerMass, calculateProfitPerSecond, calculateROI, calculateRefuelingTime, calculateTradeProfit, calculateTransferTime, calculateUpdatedCargoCost, canMove, capsHasExtractor, capsHasLoaders, capsHasMass, capsHasMovement, capsHasStorage, capsHasTrade, cargoUtils, cargo_item, container_row, coordsToLocationId, createExploreOption, createInventoryAccessor, createProjectedEntity, createScheduleAccessor, createSellAndRepositionOption, createSellAndStayOption, createSellAndTradeOption, createTravelToSellOption, Shipload as default, depthScaleFactor, deriveLocation, deriveLocationEpoch, deriveLocationSize, deriveLocationStatic, deriveResourceStats, deriveStratum, distanceBetweenCoordinates, distanceBetweenPoints, energyPercent, energy_stats, estimateDealTravelTime, estimateTravelTime, extractor_stats, findBestDeal, findBestItemToTrade, findDealsForShip, findNearbyPlanets, getCurrentEpoch, getDepthThreshold, getDestinationLocation, getEligibleResources, getEpochInfo, getFlightOrigin, getItem, getItems, getLocationCandidates, getLocationType, getPositionAt, getRarity, getResourceRarity, getResourceWeight, getSystemName, hasEnergy, hasEnergyForDistance, hasExtractor, hasLoaders, hasMass, hasSchedule, hasSpace$1 as hasSpace, hasSpaceForMass, hasStorage, hasSystem, hasTrade, hash, hash512, isExtractableLocation, isFull$1 as isFull, isFullFromMass, isProfitable, itemIds, lerp, loader_stats, location_derived, location_epoch, location_row, location_static, makeContainer, makeShip, makeWarehouse, marketPrice, marketPrices, maxTravelDistance, movement_stats, needsRecharge, projectEntity, projectEntityAt, rotation, schedule, task, toLocation, warehouse_row };