@shipload/sdk 2.0.0-rc2 → 2.0.0-rc21

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 (84) hide show
  1. package/README.md +1 -349
  2. package/lib/shipload.d.ts +1729 -1127
  3. package/lib/shipload.js +7944 -3165
  4. package/lib/shipload.js.map +1 -1
  5. package/lib/shipload.m.js +7487 -2840
  6. package/lib/shipload.m.js.map +1 -1
  7. package/package.json +6 -4
  8. package/src/capabilities/crafting.ts +22 -0
  9. package/src/capabilities/gathering.ts +36 -0
  10. package/src/capabilities/guards.ts +3 -8
  11. package/src/capabilities/hauling.ts +22 -0
  12. package/src/capabilities/index.ts +4 -1
  13. package/src/capabilities/modules.ts +86 -0
  14. package/src/capabilities/storage.ts +101 -9
  15. package/src/contracts/server.ts +785 -293
  16. package/src/data/capabilities.ts +408 -0
  17. package/src/data/categories.ts +55 -0
  18. package/src/data/colors.ts +71 -0
  19. package/src/data/entities.json +50 -0
  20. package/src/data/item-ids.ts +75 -0
  21. package/src/data/items.json +252 -0
  22. package/src/data/locations.ts +53 -0
  23. package/src/data/metadata.ts +208 -0
  24. package/src/data/nebula-adjectives.json +211 -0
  25. package/src/data/nebula-nouns.json +151 -0
  26. package/src/data/recipes-runtime.ts +65 -0
  27. package/src/data/recipes.json +878 -0
  28. package/src/data/syllables.json +1386 -780
  29. package/src/data/tiers.ts +45 -0
  30. package/src/derivation/crafting.ts +348 -0
  31. package/src/derivation/index.ts +30 -0
  32. package/src/derivation/location-size.ts +15 -0
  33. package/src/derivation/resources.ts +112 -0
  34. package/src/derivation/stats.ts +146 -0
  35. package/src/derivation/stratum.ts +134 -0
  36. package/src/derivation/tiers.ts +54 -0
  37. package/src/entities/cargo-utils.ts +10 -68
  38. package/src/entities/container.ts +37 -0
  39. package/src/entities/entity-inventory.ts +13 -13
  40. package/src/entities/inventory-accessor.ts +2 -6
  41. package/src/entities/location.ts +5 -200
  42. package/src/entities/makers.ts +144 -17
  43. package/src/entities/player.ts +1 -274
  44. package/src/entities/ship-deploy.ts +258 -0
  45. package/src/entities/ship.ts +28 -34
  46. package/src/entities/warehouse.ts +35 -7
  47. package/src/errors.ts +59 -5
  48. package/src/format.ts +12 -0
  49. package/src/index-module.ts +188 -50
  50. package/src/managers/actions.ts +138 -88
  51. package/src/managers/context.ts +19 -9
  52. package/src/managers/index.ts +0 -1
  53. package/src/managers/locations.ts +2 -85
  54. package/src/market/items.ts +41 -0
  55. package/src/nft/description.ts +176 -0
  56. package/src/nft/deserializers.ts +83 -0
  57. package/src/nft/index.ts +2 -0
  58. package/src/resolution/describe-module.ts +165 -0
  59. package/src/resolution/display-name.ts +43 -0
  60. package/src/resolution/resolve-item.ts +358 -0
  61. package/src/scheduling/projection.ts +200 -67
  62. package/src/scheduling/schedule.ts +2 -2
  63. package/src/shipload.ts +10 -5
  64. package/src/subscriptions/connection.ts +154 -0
  65. package/src/subscriptions/debug.ts +17 -0
  66. package/src/subscriptions/index.ts +5 -0
  67. package/src/subscriptions/manager.ts +240 -0
  68. package/src/subscriptions/mappers.ts +28 -0
  69. package/src/subscriptions/types.ts +143 -0
  70. package/src/travel/travel.ts +37 -23
  71. package/src/types/capabilities.ts +11 -14
  72. package/src/types/entity-traits.ts +3 -4
  73. package/src/types/entity.ts +9 -6
  74. package/src/types.ts +72 -72
  75. package/src/utils/system.ts +66 -53
  76. package/src/capabilities/extraction.ts +0 -37
  77. package/src/data/goods.json +0 -23
  78. package/src/managers/trades.ts +0 -119
  79. package/src/market/goods.ts +0 -31
  80. package/src/market/market.ts +0 -208
  81. package/src/market/rolls.ts +0 -8
  82. package/src/trading/collect.ts +0 -938
  83. package/src/trading/deal.ts +0 -207
  84. package/src/trading/trade.ts +0 -203
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, UInt8, TimePoint, Int64, UInt8Type, TimePointType, UInt16Type, Int64Type, Checksum512, APIClient } from '@wharfkit/antelope';
2
+ import { Blob, ABI, Struct, Name, UInt64, Checksum256, UInt32, TimePointSec, Checksum256Type, UInt32Type, NameType, UInt64Type, Action, UInt8, Int64, UInt16, TimePoint, Bytes, Int32, UInt16Type, UInt8Type, TimePointType, Int64Type, Int32Type, 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';
@@ -158,29 +158,40 @@ declare namespace platform {
158
158
  declare const abiBlob: Blob;
159
159
  declare const abi: ABI;
160
160
  declare namespace Types {
161
+ class addmodule extends Struct {
162
+ entity_type: Name;
163
+ entity_id: UInt64;
164
+ module_index: UInt8;
165
+ module_cargo_id: UInt64;
166
+ target_cargo_id: UInt64;
167
+ }
168
+ class addnexus extends Struct {
169
+ nexus_name: string;
170
+ x: Int64;
171
+ y: Int64;
172
+ }
161
173
  class advance extends Struct {
162
174
  reveal: string;
163
175
  commit: Checksum256;
164
176
  }
165
- class buycontainer extends Struct {
166
- account: Name;
167
- ship_id: UInt64;
168
- name: string;
177
+ class packed_module extends Struct {
178
+ item_id: UInt16;
179
+ stats: UInt64;
169
180
  }
170
- class buygoods extends Struct {
171
- entity_type: Name;
172
- id: UInt64;
173
- good_id: UInt16;
174
- quantity: UInt32;
181
+ class module_entry extends Struct {
182
+ type: UInt8;
183
+ installed?: packed_module;
175
184
  }
176
- class buyship extends Struct {
177
- account: Name;
178
- name: string;
185
+ class cargo_item extends Struct {
186
+ item_id: UInt16;
187
+ quantity: UInt32;
188
+ stats: UInt64;
189
+ modules: module_entry[];
179
190
  }
180
- class buywarehouse extends Struct {
181
- account: Name;
182
- ship_id: UInt64;
183
- name: string;
191
+ class blend extends Struct {
192
+ entity_type: Name;
193
+ id: UInt64;
194
+ inputs: cargo_item[];
184
195
  }
185
196
  class cancel extends Struct {
186
197
  entity_type: Name;
@@ -199,25 +210,22 @@ declare namespace Types {
199
210
  entitygroup?: UInt64;
200
211
  group_members?: entity_ref[];
201
212
  }
202
- class mixture_component extends Struct {
203
- good_id: UInt16;
204
- purity: UInt16;
205
- }
206
- class mixture_info extends Struct {
207
- components: mixture_component[];
208
- }
209
- class cargo_item extends Struct {
210
- good_id: UInt16;
211
- quantity: UInt32;
212
- unit_cost: UInt64;
213
- mixture?: mixture_info;
214
- }
215
213
  class cargo_row extends Struct {
216
214
  id: UInt64;
217
215
  entity_id: UInt64;
218
- good_id: UInt64;
216
+ item_id: UInt64;
219
217
  quantity: UInt64;
220
- unit_cost: UInt64;
218
+ stats: UInt64;
219
+ modules: module_entry[];
220
+ }
221
+ class claimstarter extends Struct {
222
+ account: Name;
223
+ x: Int64;
224
+ y: Int64;
225
+ }
226
+ class cleanrsvp extends Struct {
227
+ epoch: UInt64;
228
+ max_rows: UInt64;
221
229
  }
222
230
  class cleartable extends Struct {
223
231
  table_name: Name;
@@ -227,6 +235,25 @@ declare namespace Types {
227
235
  class commit extends Struct {
228
236
  commit: Checksum256;
229
237
  }
238
+ class entity_defaults extends Struct {
239
+ warehouse_z: UInt16;
240
+ container_z: UInt16;
241
+ }
242
+ class item_def extends Struct {
243
+ id: UInt16;
244
+ mass: UInt32;
245
+ type: UInt8;
246
+ subtype: UInt8;
247
+ tier: UInt8;
248
+ }
249
+ class game_config extends Struct {
250
+ version: UInt32;
251
+ defaults: entity_defaults;
252
+ items: item_def[];
253
+ }
254
+ class configlog extends Struct {
255
+ config: game_config;
256
+ }
230
257
  class coordinates extends Struct {
231
258
  x: Int64;
232
259
  y: Int64;
@@ -240,7 +267,6 @@ declare namespace Types {
240
267
  cargo: cargo_item[];
241
268
  entitytarget?: entity_ref;
242
269
  entitygroup?: UInt64;
243
- credits?: Int64;
244
270
  energy_cost?: UInt16;
245
271
  }
246
272
  class schedule extends Struct {
@@ -257,6 +283,36 @@ declare namespace Types {
257
283
  cargomass: UInt32;
258
284
  schedule?: schedule;
259
285
  }
286
+ class craft extends Struct {
287
+ entity_type: Name;
288
+ id: UInt64;
289
+ recipe_id: UInt16;
290
+ quantity: UInt32;
291
+ inputs: cargo_item[];
292
+ }
293
+ class crafter_stats extends Struct {
294
+ speed: UInt16;
295
+ drain: UInt16;
296
+ }
297
+ class createentity extends Struct {
298
+ owner: Name;
299
+ entity_type: Name;
300
+ entity_name: string;
301
+ x: Int64;
302
+ y: Int64;
303
+ }
304
+ class deploy extends Struct {
305
+ entity_type: Name;
306
+ id: UInt64;
307
+ packed_item_id: UInt16;
308
+ stats: UInt64;
309
+ }
310
+ class descentity extends Struct {
311
+ item_id: UInt16;
312
+ hull_stats: UInt64;
313
+ module_items: UInt16[];
314
+ module_stats: UInt64[];
315
+ }
260
316
  class enable extends Struct {
261
317
  enabled: boolean;
262
318
  }
@@ -277,10 +333,19 @@ declare namespace Types {
277
333
  thrust: UInt32;
278
334
  drain: UInt16;
279
335
  }
280
- class extractor_stats extends Struct {
281
- rate: UInt16;
336
+ class gatherer_stats extends Struct {
337
+ yield: UInt16;
282
338
  drain: UInt16;
339
+ depth: UInt16;
340
+ speed: UInt16;
341
+ }
342
+ class hauler_stats extends Struct {
343
+ capacity: UInt8;
283
344
  efficiency: UInt16;
345
+ drain: UInt16;
346
+ }
347
+ class warp_stats extends Struct {
348
+ range: UInt32;
284
349
  }
285
350
  class entity_info extends Struct {
286
351
  type: Name;
@@ -291,12 +356,16 @@ declare namespace Types {
291
356
  cargomass: UInt32;
292
357
  cargo: cargo_item[];
293
358
  loaders?: loader_stats;
359
+ modules: module_entry[];
294
360
  energy?: UInt16;
295
361
  hullmass?: UInt32;
296
362
  engines?: movement_stats;
297
363
  generator?: energy_stats;
298
364
  capacity?: UInt32;
299
- extractor?: extractor_stats;
365
+ gatherer?: gatherer_stats;
366
+ hauler?: hauler_stats;
367
+ warp?: warp_stats;
368
+ crafter?: crafter_stats;
300
369
  is_idle: boolean;
301
370
  current_task?: task;
302
371
  current_task_elapsed: UInt32;
@@ -305,6 +374,16 @@ declare namespace Types {
305
374
  idle_at?: TimePoint;
306
375
  schedule?: schedule;
307
376
  }
377
+ class slot_def extends Struct {
378
+ type: UInt8;
379
+ }
380
+ class entity_layout extends Struct {
381
+ entity_item_id: UInt16;
382
+ slots: slot_def[];
383
+ }
384
+ class entity_layouts_result extends Struct {
385
+ entities: entity_layout[];
386
+ }
308
387
  class entity_summary extends Struct {
309
388
  type: Name;
310
389
  id: UInt64;
@@ -325,8 +404,20 @@ declare namespace Types {
325
404
  id: UInt64;
326
405
  participants: entity_ref[];
327
406
  }
328
- class extract extends Struct {
329
- ship_id: UInt64;
407
+ class enum_member extends Struct {
408
+ value: UInt8;
409
+ name: string;
410
+ }
411
+ class enum_result extends Struct {
412
+ members: enum_member[];
413
+ }
414
+ class gather extends Struct {
415
+ source: entity_ref;
416
+ destination: entity_ref;
417
+ stratum: UInt16;
418
+ quantity: UInt32;
419
+ }
420
+ class getconfig extends Struct {
330
421
  }
331
422
  class getentities extends Struct {
332
423
  owner: Name;
@@ -336,7 +427,13 @@ declare namespace Types {
336
427
  entity_type: Name;
337
428
  entity_id: UInt64;
338
429
  }
339
- class getgoods extends Struct {
430
+ class getitemdata extends Struct {
431
+ }
432
+ class getitemids extends Struct {
433
+ }
434
+ class getitems extends Struct {
435
+ }
436
+ class getitemtypes extends Struct {
340
437
  }
341
438
  class getlocation extends Struct {
342
439
  x: Int64;
@@ -346,28 +443,42 @@ declare namespace Types {
346
443
  x: Int64;
347
444
  y: Int64;
348
445
  }
446
+ class getmodtypes extends Struct {
447
+ }
448
+ class getmodules extends Struct {
449
+ }
349
450
  class getnearby extends Struct {
350
451
  entity_type: Name;
351
452
  entity_id: UInt64;
352
453
  recharge: boolean;
353
454
  }
455
+ class getnftinfo extends Struct {
456
+ }
354
457
  class getplayer extends Struct {
355
458
  account: Name;
356
459
  }
357
- class getstarter extends Struct {
460
+ class getrecipe extends Struct {
461
+ output_item_id: UInt16;
462
+ }
463
+ class getrecipes extends Struct {
464
+ lower_bound: UInt16;
465
+ limit: UInt8;
466
+ }
467
+ class getrescats extends Struct {
468
+ }
469
+ class getresources extends Struct {
470
+ }
471
+ class getslots extends Struct {
472
+ }
473
+ class getstratum extends Struct {
474
+ x: Int64;
475
+ y: Int64;
476
+ stratum: UInt16;
358
477
  }
359
478
  class getsummaries extends Struct {
360
479
  owner: Name;
361
480
  entity_type?: Name;
362
481
  }
363
- class good extends Struct {
364
- id: UInt16;
365
- base_price: UInt32;
366
- mass: UInt32;
367
- }
368
- class goods_info extends Struct {
369
- goods: good[];
370
- }
371
482
  class grouptravel extends Struct {
372
483
  entities: entity_ref[];
373
484
  x: Int64;
@@ -383,6 +494,49 @@ declare namespace Types {
383
494
  class init extends Struct {
384
495
  seed: Checksum256;
385
496
  }
497
+ class item_id_pair extends Struct {
498
+ id: UInt16;
499
+ name: string;
500
+ }
501
+ class item_ids_result extends Struct {
502
+ items: item_id_pair[];
503
+ }
504
+ class recipe_input extends Struct {
505
+ item_id: UInt16;
506
+ category: UInt8;
507
+ tier: UInt8;
508
+ quantity: UInt32;
509
+ }
510
+ class stat_source extends Struct {
511
+ input_index: UInt8;
512
+ input_stat_index: UInt8;
513
+ }
514
+ class stat_slot_response extends Struct {
515
+ sources: stat_source[];
516
+ }
517
+ class recipe_item_info extends Struct {
518
+ id: UInt16;
519
+ mass: UInt32;
520
+ }
521
+ class recipe_response extends Struct {
522
+ output_item_id: UInt16;
523
+ output_mass: UInt32;
524
+ inputs: recipe_input[];
525
+ stat_slots: stat_slot_response[];
526
+ blend_weights: Bytes;
527
+ output_item: recipe_item_info;
528
+ input_items: recipe_item_info[];
529
+ }
530
+ class recipes_result extends Struct {
531
+ recipes: recipe_response[];
532
+ }
533
+ class itemdata_result extends Struct {
534
+ items: item_def[];
535
+ recipes: recipes_result;
536
+ }
537
+ class items_info extends Struct {
538
+ items: item_def[];
539
+ }
386
540
  class join extends Struct {
387
541
  account: Name;
388
542
  }
@@ -401,18 +555,11 @@ declare namespace Types {
401
555
  class location_derived extends Struct {
402
556
  static_props: location_static;
403
557
  epoch_props: location_epoch;
404
- }
405
- class location_good extends Struct {
406
- id: UInt16;
407
- price: UInt32;
408
- supply: UInt16;
409
- rarity_multiplier: UInt32;
410
- location_multiplier: UInt32;
558
+ size: UInt16;
411
559
  }
412
560
  class location_info extends Struct {
413
561
  coords: coordinates;
414
562
  is_system: boolean;
415
- goods: location_good[];
416
563
  }
417
564
  class location_row extends Struct {
418
565
  id: UInt64;
@@ -422,6 +569,15 @@ declare namespace Types {
422
569
  cargo: cargo_item[];
423
570
  schedule?: schedule;
424
571
  }
572
+ class module_info extends Struct {
573
+ id: UInt16;
574
+ mass: UInt32;
575
+ module_type: UInt8;
576
+ tier: UInt8;
577
+ }
578
+ class modules_result extends Struct {
579
+ modules: module_info[];
580
+ }
425
581
  class nearby_system extends Struct {
426
582
  distance: UInt64;
427
583
  energy_cost: UInt64;
@@ -435,6 +591,33 @@ declare namespace Types {
435
591
  max_energy: UInt16;
436
592
  systems: nearby_system[];
437
593
  }
594
+ class nexus_row extends Struct {
595
+ id: UInt64;
596
+ owner: Name;
597
+ name: string;
598
+ coordinates: coordinates;
599
+ }
600
+ class schema_field extends Struct {
601
+ name: string;
602
+ field_type: string;
603
+ }
604
+ class nft_schema_def extends Struct {
605
+ schema_name: Name;
606
+ fields: schema_field[];
607
+ }
608
+ class nft_template_def extends Struct {
609
+ item_id: UInt16;
610
+ schema_name: Name;
611
+ }
612
+ class nftconfig_row extends Struct {
613
+ item_id: UInt16;
614
+ template_id: Int32;
615
+ schema_name: Name;
616
+ }
617
+ class nftinfo_result extends Struct {
618
+ schemas: nft_schema_def[];
619
+ templates: nft_template_def[];
620
+ }
438
621
  class task_event extends Struct {
439
622
  event_type: UInt8;
440
623
  owner: Name;
@@ -445,47 +628,29 @@ declare namespace Types {
445
628
  starts_at: TimePoint;
446
629
  completes_at: TimePoint;
447
630
  new_energy?: UInt16;
448
- new_coordinates?: coordinates;
449
- cargomass_delta: Int64;
450
- cargo_added: cargo_item[];
451
- cargo_removed: cargo_item[];
452
- credits?: Int64;
453
631
  }
454
632
  class notify extends Struct {
455
633
  event: task_event;
456
634
  }
457
- class payloan extends Struct {
458
- account: Name;
459
- amount: UInt64;
460
- }
461
635
  class player_info extends Struct {
462
636
  owner: Name;
463
637
  is_player: boolean;
464
638
  company_name: string;
465
- balance: UInt64;
466
- debt: UInt32;
467
- networth: Int64;
468
- available_loan: UInt64;
469
- next_ship_price: UInt64;
470
- next_warehouse_price: UInt64;
471
- next_container_price: UInt64;
472
639
  ship_count: UInt64;
473
640
  warehouse_count: UInt64;
474
641
  container_count: UInt64;
475
642
  }
476
643
  class player_row extends Struct {
477
644
  owner: Name;
478
- balance: UInt64;
479
- debt: UInt32;
480
- networth: Int64;
481
- }
482
- class purgesupply extends Struct {
483
- max_rows?: UInt64;
484
645
  }
485
646
  class recharge extends Struct {
486
647
  entity_type: Name;
487
648
  id: UInt64;
488
649
  }
650
+ class reserve_row extends Struct {
651
+ id: UInt64;
652
+ remaining: UInt32;
653
+ }
489
654
  class resolve extends Struct {
490
655
  entity_type: Name;
491
656
  id: UInt64;
@@ -499,42 +664,77 @@ declare namespace Types {
499
664
  entitygroup?: UInt64;
500
665
  group_members?: entity_ref[];
501
666
  }
502
- class salt extends Struct {
503
- salt: UInt64;
667
+ class resource_info extends Struct {
668
+ id: UInt16;
669
+ mass: UInt32;
670
+ category: UInt8;
671
+ tier: UInt8;
504
672
  }
505
- class sellgoods extends Struct {
673
+ class resource_stats extends Struct {
674
+ stat1: UInt16;
675
+ stat2: UInt16;
676
+ stat3: UInt16;
677
+ }
678
+ class resources_result extends Struct {
679
+ resources: resource_info[];
680
+ }
681
+ class rmmodule extends Struct {
506
682
  entity_type: Name;
507
- id: UInt64;
508
- good_id: UInt16;
509
- quantity: UInt32;
683
+ entity_id: UInt64;
684
+ module_index: UInt8;
685
+ target_cargo_id: UInt64;
686
+ }
687
+ class rmnftcfg extends Struct {
688
+ item_id: UInt16;
689
+ }
690
+ class salt extends Struct {
691
+ salt: UInt64;
510
692
  }
511
693
  class sequence_row extends Struct {
512
694
  key: Name;
513
695
  value: UInt64;
514
696
  }
515
- class trade_stats extends Struct {
516
- margin: UInt16;
697
+ class setnftcfg extends Struct {
698
+ item_id: UInt16;
699
+ template_id: Int32;
700
+ schema_name: Name;
517
701
  }
518
702
  class ship_row extends Struct {
519
703
  id: UInt64;
520
704
  owner: Name;
521
705
  name: string;
706
+ stats: UInt64;
522
707
  coordinates: coordinates;
523
- hullmass: UInt32;
524
- capacity: UInt32;
525
- energy: UInt16;
708
+ hullmass?: UInt32;
709
+ capacity?: UInt32;
710
+ energy?: UInt16;
526
711
  cargomass: UInt32;
527
- engines: movement_stats;
528
- generator: energy_stats;
529
- loaders: loader_stats;
530
- trade?: trade_stats;
531
- extractor?: extractor_stats;
712
+ engines?: movement_stats;
713
+ generator?: energy_stats;
714
+ loaders?: loader_stats;
715
+ gatherer?: gatherer_stats;
716
+ warp?: warp_stats;
717
+ crafter?: crafter_stats;
718
+ hauler?: hauler_stats;
719
+ modules: module_entry[];
532
720
  schedule?: schedule;
533
721
  }
534
- class starter_info extends Struct {
535
- balance: UInt64;
536
- debt: UInt64;
537
- ship: entity_info;
722
+ class spawncargo extends Struct {
723
+ entity_id: UInt64;
724
+ item_id: UInt64;
725
+ quantity: UInt64;
726
+ }
727
+ class spawnpacked extends Struct {
728
+ entity_id: UInt64;
729
+ item_id: UInt16;
730
+ hull_stats: UInt64;
731
+ installed: packed_module[];
732
+ }
733
+ class spawnseeded extends Struct {
734
+ entity_id: UInt64;
735
+ item_id: UInt64;
736
+ quantity: UInt64;
737
+ stats: UInt64;
538
738
  }
539
739
  class state_row extends Struct {
540
740
  enabled: boolean;
@@ -544,16 +744,16 @@ declare namespace Types {
544
744
  seed: Checksum256;
545
745
  commit: Checksum256;
546
746
  }
547
- class supply_row extends Struct {
548
- id: UInt64;
549
- coordinates: coordinates;
550
- epoch: UInt64;
551
- good_id: UInt16;
552
- supply: UInt16;
747
+ class stratum_info extends Struct {
748
+ item_id: UInt16;
749
+ seed: UInt64;
750
+ richness: UInt16;
751
+ reserve: UInt32;
752
+ reserve_max: UInt32;
553
753
  }
554
- class takeloan extends Struct {
555
- account: Name;
556
- amount: UInt64;
754
+ class stratum_data extends Struct {
755
+ stratum: stratum_info;
756
+ stats: resource_stats;
557
757
  }
558
758
  class task_results extends Struct {
559
759
  entities: entity_task_info[];
@@ -563,7 +763,8 @@ declare namespace Types {
563
763
  source_id: UInt64;
564
764
  dest_type: Name;
565
765
  dest_id: UInt64;
566
- good_id: UInt16;
766
+ item_id: UInt16;
767
+ stats: UInt64;
567
768
  quantity: UInt32;
568
769
  }
569
770
  class travel extends Struct {
@@ -576,41 +777,51 @@ declare namespace Types {
576
777
  class types_row extends Struct {
577
778
  id: UInt64;
578
779
  entity_summary_type: entity_summary;
579
- starter_info_type: starter_info;
580
- }
581
- class updatecredit extends Struct {
582
- account: Name;
583
- amount: Int64;
584
- }
585
- class updatedebt extends Struct {
586
- account: Name;
587
- amount: Int64;
780
+ game_config_type: game_config;
588
781
  }
589
782
  class warehouse_row extends Struct {
590
783
  id: UInt64;
591
784
  owner: Name;
592
785
  name: string;
786
+ stats: UInt64;
593
787
  coordinates: coordinates;
594
- capacity: UInt32;
788
+ hullmass?: UInt32;
789
+ capacity?: UInt32;
595
790
  cargomass: UInt32;
596
- loaders: loader_stats;
791
+ loaders?: loader_stats;
792
+ modules: module_entry[];
597
793
  schedule?: schedule;
598
794
  }
795
+ class warp extends Struct {
796
+ entity_type: Name;
797
+ id: UInt64;
798
+ x: Int64;
799
+ y: Int64;
800
+ }
599
801
  class wipe extends Struct {
600
802
  }
601
803
  class wipesequence extends Struct {
602
804
  }
805
+ class wrap extends Struct {
806
+ owner: Name;
807
+ entity_type: Name;
808
+ entity_id: UInt64;
809
+ cargo_id: UInt64;
810
+ quantity: UInt64;
811
+ }
603
812
  }
604
813
  declare const TableMap: {
605
814
  cargo: typeof Types.cargo_row;
606
815
  container: typeof Types.container_row;
607
816
  entitygroup: typeof Types.entitygroup_row;
608
817
  location: typeof Types.location_row;
818
+ nexus: typeof Types.nexus_row;
819
+ nftconfig: typeof Types.nftconfig_row;
609
820
  player: typeof Types.player_row;
821
+ reserve: typeof Types.reserve_row;
610
822
  sequence: typeof Types.sequence_row;
611
823
  ship: typeof Types.ship_row;
612
824
  state: typeof Types.state_row;
613
- supply: typeof Types.supply_row;
614
825
  types: typeof Types.types_row;
615
826
  warehouse: typeof Types.warehouse_row;
616
827
  };
@@ -619,11 +830,13 @@ interface TableTypes {
619
830
  container: Types.container_row;
620
831
  entitygroup: Types.entitygroup_row;
621
832
  location: Types.location_row;
833
+ nexus: Types.nexus_row;
834
+ nftconfig: Types.nftconfig_row;
622
835
  player: Types.player_row;
836
+ reserve: Types.reserve_row;
623
837
  sequence: Types.sequence_row;
624
838
  ship: Types.ship_row;
625
839
  state: Types.state_row;
626
- supply: Types.supply_row;
627
840
  types: Types.types_row;
628
841
  warehouse: Types.warehouse_row;
629
842
  }
@@ -631,6 +844,36 @@ type RowType<T> = T extends keyof TableTypes ? TableTypes[T] : any;
631
844
  type TableNames = keyof TableTypes;
632
845
  declare namespace ActionParams {
633
846
  namespace Type {
847
+ interface cargo_item {
848
+ item_id: UInt16Type;
849
+ quantity: UInt32Type;
850
+ stats: UInt64Type;
851
+ modules: Type.module_entry[];
852
+ }
853
+ interface module_entry {
854
+ type: UInt8Type;
855
+ installed?: Type.packed_module;
856
+ }
857
+ interface packed_module {
858
+ item_id: UInt16Type;
859
+ stats: UInt64Type;
860
+ }
861
+ interface game_config {
862
+ version: UInt32Type;
863
+ defaults: Type.entity_defaults;
864
+ items: Type.item_def[];
865
+ }
866
+ interface entity_defaults {
867
+ warehouse_z: UInt16Type;
868
+ container_z: UInt16Type;
869
+ }
870
+ interface item_def {
871
+ id: UInt16Type;
872
+ mass: UInt32Type;
873
+ type: UInt8Type;
874
+ subtype: UInt8Type;
875
+ tier: UInt8Type;
876
+ }
634
877
  interface entity_ref {
635
878
  entity_type: NameType;
636
879
  entity_id: UInt64Type;
@@ -645,11 +888,6 @@ declare namespace ActionParams {
645
888
  starts_at: TimePointType;
646
889
  completes_at: TimePointType;
647
890
  new_energy?: UInt16Type;
648
- new_coordinates?: Type.coordinates;
649
- cargomass_delta: Int64Type;
650
- cargo_added: Type.cargo_item[];
651
- cargo_removed: Type.cargo_item[];
652
- credits?: Int64Type;
653
891
  }
654
892
  interface task {
655
893
  type: UInt8Type;
@@ -659,7 +897,6 @@ declare namespace ActionParams {
659
897
  cargo: Type.cargo_item[];
660
898
  entitytarget?: Type.entity_ref;
661
899
  entitygroup?: UInt64Type;
662
- credits?: Int64Type;
663
900
  energy_cost?: UInt16Type;
664
901
  }
665
902
  interface coordinates {
@@ -667,49 +904,42 @@ declare namespace ActionParams {
667
904
  y: Int64Type;
668
905
  z?: UInt16Type;
669
906
  }
670
- interface cargo_item {
671
- good_id: UInt16Type;
672
- quantity: UInt32Type;
673
- unit_cost: UInt64Type;
674
- mixture?: Type.mixture_info;
675
- }
676
- interface mixture_info {
677
- components: Type.mixture_component[];
678
- }
679
- interface mixture_component {
680
- good_id: UInt16Type;
681
- purity: UInt16Type;
682
- }
907
+ }
908
+ interface addmodule {
909
+ entity_type: NameType;
910
+ entity_id: UInt64Type;
911
+ module_index: UInt8Type;
912
+ module_cargo_id: UInt64Type;
913
+ target_cargo_id: UInt64Type;
914
+ }
915
+ interface addnexus {
916
+ nexus_name: string;
917
+ x: Int64Type;
918
+ y: Int64Type;
683
919
  }
684
920
  interface advance {
685
921
  reveal: string;
686
922
  commit: Checksum256Type;
687
923
  }
688
- interface buycontainer {
689
- account: NameType;
690
- ship_id: UInt64Type;
691
- name: string;
692
- }
693
- interface buygoods {
924
+ interface blend {
694
925
  entity_type: NameType;
695
926
  id: UInt64Type;
696
- good_id: UInt16Type;
697
- quantity: UInt32Type;
698
- }
699
- interface buyship {
700
- account: NameType;
701
- name: string;
702
- }
703
- interface buywarehouse {
704
- account: NameType;
705
- ship_id: UInt64Type;
706
- name: string;
927
+ inputs: Type.cargo_item[];
707
928
  }
708
929
  interface cancel {
709
930
  entity_type: NameType;
710
931
  id: UInt64Type;
711
932
  count: UInt64Type;
712
933
  }
934
+ interface claimstarter {
935
+ account: NameType;
936
+ x: Int64Type;
937
+ y: Int64Type;
938
+ }
939
+ interface cleanrsvp {
940
+ epoch: UInt64Type;
941
+ max_rows: UInt64Type;
942
+ }
713
943
  interface cleartable {
714
944
  table_name: NameType;
715
945
  scope?: NameType;
@@ -718,11 +948,45 @@ declare namespace ActionParams {
718
948
  interface commit {
719
949
  commit: Checksum256Type;
720
950
  }
951
+ interface configlog {
952
+ config: Type.game_config;
953
+ }
954
+ interface craft {
955
+ entity_type: NameType;
956
+ id: UInt64Type;
957
+ recipe_id: UInt16Type;
958
+ quantity: UInt32Type;
959
+ inputs: Type.cargo_item[];
960
+ }
961
+ interface createentity {
962
+ owner: NameType;
963
+ entity_type: NameType;
964
+ entity_name: string;
965
+ x: Int64Type;
966
+ y: Int64Type;
967
+ }
968
+ interface deploy {
969
+ entity_type: NameType;
970
+ id: UInt64Type;
971
+ packed_item_id: UInt16Type;
972
+ stats: UInt64Type;
973
+ }
974
+ interface descentity {
975
+ item_id: UInt16Type;
976
+ hull_stats: UInt64Type;
977
+ module_items: UInt16Type[];
978
+ module_stats: UInt64Type[];
979
+ }
721
980
  interface enable {
722
981
  enabled: boolean;
723
982
  }
724
- interface extract {
725
- ship_id: UInt64Type;
983
+ interface gather {
984
+ source: Type.entity_ref;
985
+ destination: Type.entity_ref;
986
+ stratum: UInt16Type;
987
+ quantity: UInt32Type;
988
+ }
989
+ interface getconfig {
726
990
  }
727
991
  interface getentities {
728
992
  owner: NameType;
@@ -732,7 +996,13 @@ declare namespace ActionParams {
732
996
  entity_type: NameType;
733
997
  entity_id: UInt64Type;
734
998
  }
735
- interface getgoods {
999
+ interface getitemdata {
1000
+ }
1001
+ interface getitemids {
1002
+ }
1003
+ interface getitems {
1004
+ }
1005
+ interface getitemtypes {
736
1006
  }
737
1007
  interface getlocation {
738
1008
  x: Int64Type;
@@ -742,15 +1012,37 @@ declare namespace ActionParams {
742
1012
  x: Int64Type;
743
1013
  y: Int64Type;
744
1014
  }
1015
+ interface getmodtypes {
1016
+ }
1017
+ interface getmodules {
1018
+ }
745
1019
  interface getnearby {
746
1020
  entity_type: NameType;
747
1021
  entity_id: UInt64Type;
748
1022
  recharge: boolean;
749
1023
  }
1024
+ interface getnftinfo {
1025
+ }
750
1026
  interface getplayer {
751
1027
  account: NameType;
752
1028
  }
753
- interface getstarter {
1029
+ interface getrecipe {
1030
+ output_item_id: UInt16Type;
1031
+ }
1032
+ interface getrecipes {
1033
+ lower_bound: UInt16Type;
1034
+ limit: UInt8Type;
1035
+ }
1036
+ interface getrescats {
1037
+ }
1038
+ interface getresources {
1039
+ }
1040
+ interface getslots {
1041
+ }
1042
+ interface getstratum {
1043
+ x: Int64Type;
1044
+ y: Int64Type;
1045
+ stratum: UInt16Type;
754
1046
  }
755
1047
  interface getsummaries {
756
1048
  owner: NameType;
@@ -777,13 +1069,6 @@ declare namespace ActionParams {
777
1069
  interface notify {
778
1070
  event: Type.task_event;
779
1071
  }
780
- interface payloan {
781
- account: NameType;
782
- amount: UInt64Type;
783
- }
784
- interface purgesupply {
785
- max_rows?: UInt64Type;
786
- }
787
1072
  interface recharge {
788
1073
  entity_type: NameType;
789
1074
  id: UInt64Type;
@@ -793,25 +1078,47 @@ declare namespace ActionParams {
793
1078
  id: UInt64Type;
794
1079
  count?: UInt64Type;
795
1080
  }
1081
+ interface rmmodule {
1082
+ entity_type: NameType;
1083
+ entity_id: UInt64Type;
1084
+ module_index: UInt8Type;
1085
+ target_cargo_id: UInt64Type;
1086
+ }
1087
+ interface rmnftcfg {
1088
+ item_id: UInt16Type;
1089
+ }
796
1090
  interface salt {
797
1091
  salt: UInt64Type;
798
1092
  }
799
- interface sellgoods {
800
- entity_type: NameType;
801
- id: UInt64Type;
802
- good_id: UInt16Type;
803
- quantity: UInt32Type;
1093
+ interface setnftcfg {
1094
+ item_id: UInt16Type;
1095
+ template_id: Int32Type;
1096
+ schema_name: NameType;
804
1097
  }
805
- interface takeloan {
806
- account: NameType;
807
- amount: UInt64Type;
1098
+ interface spawncargo {
1099
+ entity_id: UInt64Type;
1100
+ item_id: UInt64Type;
1101
+ quantity: UInt64Type;
1102
+ }
1103
+ interface spawnpacked {
1104
+ entity_id: UInt64Type;
1105
+ item_id: UInt16Type;
1106
+ hull_stats: UInt64Type;
1107
+ installed: Type.packed_module[];
1108
+ }
1109
+ interface spawnseeded {
1110
+ entity_id: UInt64Type;
1111
+ item_id: UInt64Type;
1112
+ quantity: UInt64Type;
1113
+ stats: UInt64Type;
808
1114
  }
809
1115
  interface transfer {
810
1116
  source_type: NameType;
811
1117
  source_id: UInt64Type;
812
1118
  dest_type: NameType;
813
1119
  dest_id: UInt64Type;
814
- good_id: UInt16Type;
1120
+ item_id: UInt16Type;
1121
+ stats: UInt64Type;
815
1122
  quantity: UInt32Type;
816
1123
  }
817
1124
  interface travel {
@@ -821,38 +1128,61 @@ declare namespace ActionParams {
821
1128
  y: Int64Type;
822
1129
  recharge: boolean;
823
1130
  }
824
- interface updatecredit {
825
- account: NameType;
826
- amount: Int64Type;
827
- }
828
- interface updatedebt {
829
- account: NameType;
830
- amount: Int64Type;
1131
+ interface warp {
1132
+ entity_type: NameType;
1133
+ id: UInt64Type;
1134
+ x: Int64Type;
1135
+ y: Int64Type;
831
1136
  }
832
1137
  interface wipe {
833
1138
  }
834
1139
  interface wipesequence {
835
1140
  }
1141
+ interface wrap {
1142
+ owner: NameType;
1143
+ entity_type: NameType;
1144
+ entity_id: UInt64Type;
1145
+ cargo_id: UInt64Type;
1146
+ quantity: UInt64Type;
1147
+ }
836
1148
  }
837
1149
  interface ActionNameParams {
1150
+ addmodule: ActionParams.addmodule;
1151
+ addnexus: ActionParams.addnexus;
838
1152
  advance: ActionParams.advance;
839
- buycontainer: ActionParams.buycontainer;
840
- buygoods: ActionParams.buygoods;
841
- buyship: ActionParams.buyship;
842
- buywarehouse: ActionParams.buywarehouse;
1153
+ blend: ActionParams.blend;
843
1154
  cancel: ActionParams.cancel;
1155
+ claimstarter: ActionParams.claimstarter;
1156
+ cleanrsvp: ActionParams.cleanrsvp;
844
1157
  cleartable: ActionParams.cleartable;
845
1158
  commit: ActionParams.commit;
1159
+ configlog: ActionParams.configlog;
1160
+ craft: ActionParams.craft;
1161
+ createentity: ActionParams.createentity;
1162
+ deploy: ActionParams.deploy;
1163
+ descentity: ActionParams.descentity;
846
1164
  enable: ActionParams.enable;
847
- extract: ActionParams.extract;
1165
+ gather: ActionParams.gather;
1166
+ getconfig: ActionParams.getconfig;
848
1167
  getentities: ActionParams.getentities;
849
1168
  getentity: ActionParams.getentity;
850
- getgoods: ActionParams.getgoods;
1169
+ getitemdata: ActionParams.getitemdata;
1170
+ getitemids: ActionParams.getitemids;
1171
+ getitems: ActionParams.getitems;
1172
+ getitemtypes: ActionParams.getitemtypes;
851
1173
  getlocation: ActionParams.getlocation;
852
1174
  getlocdata: ActionParams.getlocdata;
1175
+ getmodtypes: ActionParams.getmodtypes;
1176
+ getmodules: ActionParams.getmodules;
853
1177
  getnearby: ActionParams.getnearby;
1178
+ getnftinfo: ActionParams.getnftinfo;
854
1179
  getplayer: ActionParams.getplayer;
855
- getstarter: ActionParams.getstarter;
1180
+ getrecipe: ActionParams.getrecipe;
1181
+ getrecipes: ActionParams.getrecipes;
1182
+ getrescats: ActionParams.getrescats;
1183
+ getresources: ActionParams.getresources;
1184
+ getslots: ActionParams.getslots;
1185
+ getstratum: ActionParams.getstratum;
856
1186
  getsummaries: ActionParams.getsummaries;
857
1187
  grouptravel: ActionParams.grouptravel;
858
1188
  hash: ActionParams.hash;
@@ -860,42 +1190,59 @@ interface ActionNameParams {
860
1190
  init: ActionParams.init;
861
1191
  join: ActionParams.join;
862
1192
  notify: ActionParams.notify;
863
- payloan: ActionParams.payloan;
864
- purgesupply: ActionParams.purgesupply;
865
1193
  recharge: ActionParams.recharge;
866
1194
  resolve: ActionParams.resolve;
1195
+ rmmodule: ActionParams.rmmodule;
1196
+ rmnftcfg: ActionParams.rmnftcfg;
867
1197
  salt: ActionParams.salt;
868
- sellgoods: ActionParams.sellgoods;
869
- takeloan: ActionParams.takeloan;
1198
+ setnftcfg: ActionParams.setnftcfg;
1199
+ spawncargo: ActionParams.spawncargo;
1200
+ spawnpacked: ActionParams.spawnpacked;
1201
+ spawnseeded: ActionParams.spawnseeded;
870
1202
  transfer: ActionParams.transfer;
871
1203
  travel: ActionParams.travel;
872
- updatecredit: ActionParams.updatecredit;
873
- updatedebt: ActionParams.updatedebt;
1204
+ warp: ActionParams.warp;
874
1205
  wipe: ActionParams.wipe;
875
1206
  wipesequence: ActionParams.wipesequence;
1207
+ wrap: ActionParams.wrap;
876
1208
  }
877
1209
  type ActionNames = keyof ActionNameParams;
878
1210
  interface ActionReturnValues {
879
- buygoods: Types.task_results;
880
1211
  cancel: Types.cancel_results;
881
- extract: Types.task_results;
1212
+ craft: Types.task_results;
1213
+ deploy: Types.task_results;
1214
+ descentity: string;
1215
+ gather: Types.task_results;
1216
+ getconfig: Types.game_config;
882
1217
  getentities: Types.entity_info[];
883
1218
  getentity: Types.entity_info;
884
- getgoods: Types.goods_info;
1219
+ getitemdata: Types.itemdata_result;
1220
+ getitemids: Types.item_ids_result;
1221
+ getitems: Types.items_info;
1222
+ getitemtypes: Types.enum_result;
885
1223
  getlocation: Types.location_info;
886
1224
  getlocdata: Types.location_derived;
1225
+ getmodtypes: Types.enum_result;
1226
+ getmodules: Types.modules_result;
887
1227
  getnearby: Types.nearby_info;
1228
+ getnftinfo: Types.nftinfo_result;
888
1229
  getplayer: Types.player_info;
889
- getstarter: Types.starter_info;
1230
+ getrecipe: Types.recipes_result;
1231
+ getrecipes: Types.recipes_result;
1232
+ getrescats: Types.enum_result;
1233
+ getresources: Types.resources_result;
1234
+ getslots: Types.entity_layouts_result;
1235
+ getstratum: Types.stratum_data;
890
1236
  getsummaries: Types.entity_summary[];
891
1237
  grouptravel: Types.task_results;
892
1238
  hash: Checksum256;
893
1239
  hash512: Checksum512;
894
1240
  recharge: Types.task_results;
895
1241
  resolve: Types.resolve_results;
896
- sellgoods: Types.task_results;
897
1242
  transfer: Types.task_results;
898
1243
  travel: Types.task_results;
1244
+ warp: Types.task_results;
1245
+ wrap: Types.task_results;
899
1246
  }
900
1247
  type ActionReturnNames = keyof ActionReturnValues;
901
1248
  declare class Contract extends Contract$2 {
@@ -948,16 +1295,14 @@ declare const ERROR_SYSTEM_DISABLED = "This game is currently disabled.";
948
1295
  declare const ERROR_SYSTEM_NOT_INITIALIZED = "This game has not been initialized.";
949
1296
  declare const GAME_NOT_FOUND = "Cannot find game for given account name.";
950
1297
  declare const GAME_SEED_NOT_SET = "This game has not initialized an epoch seed value.";
951
- declare const GOOD_DOES_NOT_EXIST = "Good does not exist.";
952
- declare const GOOD_NOT_AVAILABLE_AT_LOCATION = "Good is not tradeable at ship location.";
953
- declare const INSUFFICIENT_BALANCE = "Insufficient balance.";
954
- declare const INSUFFICIENT_GOOD_QUANTITY = "Insufficient quantity in cargo.";
955
- declare const INSUFFICIENT_GOOD_SUPPLY = "Insufficient supply of good at location.";
1298
+ declare const ITEM_DOES_NOT_EXIST = "Item does not exist.";
956
1299
  declare const INVALID_AMOUNT = "Invalid amount.";
957
1300
  declare const REQUIRES_MORE_THAN_ONE = "A value greater than one is required.";
958
1301
  declare const REQUIRES_POSITIVE_VALUE = "Value must be greater than zero.";
959
1302
  declare const PLAYER_ALREADY_JOINED = "Player has already joined the game.";
1303
+ declare const PLAYER_NOT_JOINED = "Player has not joined the game.";
960
1304
  declare const PLAYER_NOT_FOUND = "Cannot find player for given account name.";
1305
+ declare const STARTER_ALREADY_CLAIMED = "Starter ship already claimed; destroy existing ships to re-claim.";
961
1306
  declare const SHIP_ALREADY_THERE = "Ship cannot travel to the location its already at.";
962
1307
  declare const SHIP_ALREADY_TRAVELING = "Ship is already traveling.";
963
1308
  declare const SHIP_CANNOT_BUY_TRAVELING = "Ship cannot buy goods while traveling.";
@@ -972,50 +1317,83 @@ declare const SHIP_NOT_OWNED = "Ship is not owned by this account.";
972
1317
  declare const NO_SCHEDULE = "No scheduled tasks.";
973
1318
  declare const SHIP_NOT_IDLE = "Ship must be idle (no active schedule) for this action.";
974
1319
  declare const SHIP_NO_COMPLETED_TASKS = "No completed tasks to resolve.";
1320
+ declare const RESOLVE_COUNT_EXCEEDS_COMPLETED = "Requested resolve count exceeds completed tasks.";
975
1321
  declare const SHIP_CANNOT_CANCEL_TASK = "Cannot cancel task that is immutable or in progress.";
976
1322
  declare const SHIP_NO_TASKS_TO_CANCEL = "No tasks to cancel.";
977
1323
  declare const SHIP_INVALID_CARGO = "Invalid cargo specified for load/unload.";
978
1324
  declare const SHIP_CARGO_NOT_OWNED = "Cannot load cargo that is not owned.";
979
1325
  declare const SHIP_CARGO_NOT_LOADED = "Cannot unload cargo that is not loaded.";
1326
+ declare const SHIP_CAPACITY_EXCEEDED = "Ship cargo capacity would be exceeded.";
1327
+ declare const ENTITY_CAPACITY_EXCEEDED = "Entity cargo capacity would be exceeded.";
980
1328
  declare const WAREHOUSE_NOT_FOUND = "Cannot find warehouse for given id.";
981
1329
  declare const WAREHOUSE_ALREADY_AT_LOCATION = "Warehouse already exists at this location.";
982
1330
  declare const WAREHOUSE_CAPACITY_EXCEEDED = "Warehouse capacity would be exceeded.";
1331
+ declare const CONTAINER_NOT_FOUND = "Cannot find container for given id.";
1332
+ declare const CONTAINER_CAPACITY_EXCEEDED = "Container capacity would be exceeded.";
1333
+ declare const DESTINATION_CAPACITY_EXCEEDED = "Destination entity does not have enough capacity for the gather.";
1334
+ declare const CANCEL_PAIRED_HAS_PENDING = "Cannot cancel transfer, paired entity has pending tasks.";
1335
+ declare const GROUP_EMPTY = "Group travel requires at least one entity.";
1336
+ declare const GROUP_NO_THRUST = "Group travel requires at least one entity with engines.";
1337
+ declare const GROUP_NOT_SAME_LOCATION = "All entities must be at the same location for group travel.";
1338
+ declare const GROUP_NOT_SAME_OWNER = "All entities must have the same owner for group travel.";
1339
+ declare const GROUP_ENTITY_NOT_MOVABLE = "Entity cannot participate in group travel.";
1340
+ declare const GROUP_NOT_FOUND = "Entity group not found.";
1341
+ declare const GROUP_DUPLICATE_ENTITY = "Duplicate entity in group.";
1342
+ declare const GROUP_HAUL_CAPACITY_EXCEEDED = "Group travel requires sufficient hauler capacity for all non-self-propelled entities.";
1343
+ declare const CANCEL_CONTAINS_GROUPED_TASK = "Cannot cancel range containing grouped task - cancel non-grouped tasks first.";
1344
+ declare const WARP_NO_CAPABILITY = "Entity does not have warp capability.";
1345
+ declare const WARP_HAS_SCHEDULE = "Entity must be idle to warp.";
1346
+ declare const WARP_HAS_CARGO = "Entity must have no cargo to warp.";
1347
+ declare const WARP_NOT_FULL_ENERGY = "Entity must have full energy to warp.";
1348
+ declare const WARP_OUT_OF_RANGE = "Destination exceeds warp range.";
1349
+ declare const ENTITY_NO_CRAFTER = "Entity does not have crafting capability.";
1350
+ declare const RECIPE_NOT_FOUND = "Recipe does not exist.";
1351
+ declare const RECIPE_INPUTS_INSUFFICIENT = "Insufficient inputs for recipe.";
1352
+ declare const RECIPE_INPUTS_INVALID = "Input cargo does not match recipe requirements.";
1353
+ declare const RECIPE_INPUTS_EXCESS = "Provided inputs exceed recipe requirements.";
1354
+ declare const RECIPE_INPUTS_MIXED = "All stacks for a recipe input must be the same resource.";
1355
+ declare const ITEM_NOT_DEPLOYABLE = "Item cannot be deployed as an entity.";
1356
+ declare const DEPLOY_ENTITY_HAS_SCHEDULE = "Entity must be idle to deploy.";
1357
+ declare const BLEND_INPUTS_MUST_MATCH = "All blend inputs must be the same item.";
1358
+ declare const GATHER_NOT_ENOUGH_ENERGY = "Gather requires more energy than entity has.";
1359
+ declare const GATHER_EXCEEDS_ENERGY_CAPACITY = "Gather drain exceeds entity's energy capacity.";
1360
+ declare const CRAFT_NOT_ENOUGH_ENERGY = "Craft requires more energy than entity has.";
1361
+ declare const CRAFT_EXCEEDS_ENERGY_CAPACITY = "Craft drain exceeds entity's energy capacity.";
1362
+ declare const BLEND_REQUIRES_MULTIPLE = "Blend requires at least two input stacks.";
1363
+ declare const BLEND_STAT_LESS_NOT_SUPPORTED = "Stat-less items cannot be blended.";
1364
+ declare const MODULE_SLOT_INVALID = "Module slot index is invalid.";
1365
+ declare const MODULE_SLOT_OCCUPIED = "Module slot is already occupied.";
1366
+ declare const MODULE_SLOT_EMPTY = "Module slot is empty.";
1367
+ declare const MODULE_TYPE_MISMATCH = "Module type not allowed in this slot.";
1368
+ declare const MODULE_CARGO_NOT_FOUND = "Module cargo not found.";
1369
+ declare const MODULE_NOT_MODULE = "Item is not a module.";
1370
+ declare const MODULE_ENTITY_BUSY = "Entity must be idle to modify modules.";
1371
+ declare const ITEM_NOT_PACKED_ENTITY = "Item is not a packed entity.";
1372
+ declare const ITEM_NOT_AVAILABLE_AT_LOCATION = "Item is not tradeable at ship location.";
1373
+ declare const INSUFFICIENT_BALANCE = "Insufficient balance.";
1374
+ declare const INSUFFICIENT_ITEM_QUANTITY = "Insufficient quantity in cargo.";
1375
+ declare const INSUFFICIENT_ITEM_SUPPLY = "Insufficient supply of item at location.";
983
1376
 
984
1377
  declare const PRECISION = 10000;
985
- declare const INITIAL_SHIP_GENERATOR_CAPACITY = 350;
986
- declare const INITIAL_SHIP_DRAIN = 25;
987
- declare const INITIAL_SHIP_ENERGY = 350;
988
- declare const INITIAL_SHIP_HULLMASS = 100000;
989
- declare const INITIAL_SHIP_CAPACITY = 500000;
990
- declare const INITIAL_SHIP_Z = 800;
991
- declare const INITIAL_SHIP_RECHARGE = 10;
992
- declare const INITIAL_SHIP_THRUST = 250;
993
- declare const INITIAL_LOADER_MASS = 1000;
994
- declare const INITIAL_LOADER_QUANTITY = 1;
995
- declare const INITIAL_LOADER_THRUST = 1;
1378
+ declare const CRAFT_ENERGY_DIVISOR = 150000;
996
1379
  declare const WAREHOUSE_Z = 500;
997
- declare const INITIAL_WAREHOUSE_CAPACITY = 10000000;
998
1380
  declare const CONTAINER_Z = 300;
999
- declare const INITIAL_CONTAINER_HULLMASS = 50000;
1000
- declare const INITIAL_CONTAINER_CAPACITY = 2000000;
1001
1381
  declare const TRAVEL_MAX_DURATION = 86400;
1002
1382
  declare const MIN_ORBITAL_ALTITUDE = 800;
1003
1383
  declare const MAX_ORBITAL_ALTITUDE = 3000;
1004
- declare const INITIAL_SHIP_MASS = 500000;
1005
- declare const INITIAL_EXTRACTOR_RATE = 700;
1006
- declare const INITIAL_EXTRACTOR_DRAIN = 2500;
1007
- declare const INITIAL_EXTRACTOR_EFFICIENCY = 5000;
1384
+ declare const BASE_ORBITAL_MASS = 100000;
1008
1385
  interface ShipLike {
1009
1386
  coordinates: Types.coordinates;
1010
- hullmass: UInt32;
1011
- energy: UInt16;
1012
- engines: Types.movement_stats;
1013
- generator: Types.energy_stats;
1014
- loaders: Types.loader_stats;
1015
- capacity: UInt32;
1387
+ hullmass?: UInt32;
1388
+ energy?: UInt16;
1389
+ engines?: Types.movement_stats;
1390
+ generator?: Types.energy_stats;
1391
+ loaders?: Types.loader_stats;
1392
+ hauler?: Types.hauler_stats;
1393
+ capacity?: UInt32;
1016
1394
  }
1017
1395
  interface CargoMassInfo {
1018
- good_id: UInt16Type;
1396
+ item_id: UInt16Type;
1019
1397
  quantity: UInt32Type;
1020
1398
  }
1021
1399
  declare enum TaskType {
@@ -1024,7 +1402,12 @@ declare enum TaskType {
1024
1402
  RECHARGE = 2,
1025
1403
  LOAD = 3,
1026
1404
  UNLOAD = 4,
1027
- EXTRACT = 5
1405
+ GATHER = 5,
1406
+ WARP = 6,
1407
+ CRAFT = 7,
1408
+ DEPLOY = 8,
1409
+ WRAP = 9,
1410
+ UNWRAP = 10
1028
1411
  }
1029
1412
  declare enum LocationType {
1030
1413
  EMPTY = 0,
@@ -1058,19 +1441,133 @@ interface Distance {
1058
1441
  destination: ActionParams.Type.coordinates;
1059
1442
  distance: UInt16;
1060
1443
  }
1061
- declare class Good extends Struct {
1062
- id: UInt16;
1444
+ type ItemType = 'resource' | 'component' | 'module' | 'entity';
1445
+ type ResourceCategory = 'ore' | 'crystal' | 'gas' | 'regolith' | 'biomass';
1446
+ type ResourceTier = 't1' | 't2' | 't3' | 't4' | 't5';
1447
+ type ModuleType = 'any' | 'engine' | 'generator' | 'gatherer' | 'loader' | 'warp' | 'crafter' | 'launcher' | 'storage' | 'hauler';
1448
+ declare const TIER_ADJECTIVES: Record<number, string>;
1449
+ declare const CATEGORY_LABELS: Record<ResourceCategory, string>;
1450
+ declare function tierNumber(tier: string): number;
1451
+ interface Item {
1452
+ id: number;
1063
1453
  name: string;
1064
1454
  description: string;
1065
- base_price: UInt32;
1066
- mass: UInt32;
1455
+ color: string;
1456
+ mass: number;
1457
+ type: ItemType;
1458
+ tier: number;
1459
+ category?: ResourceCategory;
1460
+ moduleType?: ModuleType;
1461
+ }
1462
+ declare function formatTier(tier: number): string;
1463
+
1464
+ declare const ITEM_ORE_T1 = 101;
1465
+ declare const ITEM_ORE_T2 = 102;
1466
+ declare const ITEM_ORE_T3 = 103;
1467
+ declare const ITEM_ORE_T4 = 104;
1468
+ declare const ITEM_ORE_T5 = 105;
1469
+ declare const ITEM_ORE_T6 = 106;
1470
+ declare const ITEM_ORE_T7 = 107;
1471
+ declare const ITEM_ORE_T8 = 108;
1472
+ declare const ITEM_ORE_T9 = 109;
1473
+ declare const ITEM_ORE_T10 = 110;
1474
+ declare const ITEM_CRYSTAL_T1 = 201;
1475
+ declare const ITEM_CRYSTAL_T2 = 202;
1476
+ declare const ITEM_CRYSTAL_T3 = 203;
1477
+ declare const ITEM_CRYSTAL_T4 = 204;
1478
+ declare const ITEM_CRYSTAL_T5 = 205;
1479
+ declare const ITEM_CRYSTAL_T6 = 206;
1480
+ declare const ITEM_CRYSTAL_T7 = 207;
1481
+ declare const ITEM_CRYSTAL_T8 = 208;
1482
+ declare const ITEM_CRYSTAL_T9 = 209;
1483
+ declare const ITEM_CRYSTAL_T10 = 210;
1484
+ declare const ITEM_GAS_T1 = 301;
1485
+ declare const ITEM_GAS_T2 = 302;
1486
+ declare const ITEM_GAS_T3 = 303;
1487
+ declare const ITEM_GAS_T4 = 304;
1488
+ declare const ITEM_GAS_T5 = 305;
1489
+ declare const ITEM_GAS_T6 = 306;
1490
+ declare const ITEM_GAS_T7 = 307;
1491
+ declare const ITEM_GAS_T8 = 308;
1492
+ declare const ITEM_GAS_T9 = 309;
1493
+ declare const ITEM_GAS_T10 = 310;
1494
+ declare const ITEM_REGOLITH_T1 = 401;
1495
+ declare const ITEM_REGOLITH_T2 = 402;
1496
+ declare const ITEM_REGOLITH_T3 = 403;
1497
+ declare const ITEM_REGOLITH_T4 = 404;
1498
+ declare const ITEM_REGOLITH_T5 = 405;
1499
+ declare const ITEM_REGOLITH_T6 = 406;
1500
+ declare const ITEM_REGOLITH_T7 = 407;
1501
+ declare const ITEM_REGOLITH_T8 = 408;
1502
+ declare const ITEM_REGOLITH_T9 = 409;
1503
+ declare const ITEM_REGOLITH_T10 = 410;
1504
+ declare const ITEM_BIOMASS_T1 = 501;
1505
+ declare const ITEM_BIOMASS_T2 = 502;
1506
+ declare const ITEM_BIOMASS_T3 = 503;
1507
+ declare const ITEM_BIOMASS_T4 = 504;
1508
+ declare const ITEM_BIOMASS_T5 = 505;
1509
+ declare const ITEM_BIOMASS_T6 = 506;
1510
+ declare const ITEM_BIOMASS_T7 = 507;
1511
+ declare const ITEM_BIOMASS_T8 = 508;
1512
+ declare const ITEM_BIOMASS_T9 = 509;
1513
+ declare const ITEM_BIOMASS_T10 = 510;
1514
+ declare const ITEM_HULL_PLATES = 10001;
1515
+ declare const ITEM_CARGO_LINING = 10002;
1516
+ declare const ITEM_THRUSTER_CORE = 10003;
1517
+ declare const ITEM_POWER_CELL = 10004;
1518
+ declare const ITEM_MATTER_CONDUIT = 10005;
1519
+ declare const ITEM_SURVEY_PROBE = 10006;
1520
+ declare const ITEM_CARGO_ARM = 10007;
1521
+ declare const ITEM_TOOL_BIT = 10008;
1522
+ declare const ITEM_REACTION_CHAMBER = 10009;
1523
+ declare const ITEM_FOCUSING_ARRAY = 10010;
1524
+ declare const ITEM_ENGINE_T1 = 10100;
1525
+ declare const ITEM_GENERATOR_T1 = 10101;
1526
+ declare const ITEM_GATHERER_T1 = 10102;
1527
+ declare const ITEM_LOADER_T1 = 10103;
1528
+ declare const ITEM_CRAFTER_T1 = 10104;
1529
+ declare const ITEM_STORAGE_T1 = 10105;
1530
+ declare const ITEM_HAULER_T1 = 10106;
1531
+ declare const ITEM_CONTAINER_T1_PACKED = 10200;
1532
+ declare const ITEM_SHIP_T1_PACKED = 10201;
1533
+ declare const ITEM_WAREHOUSE_T1_PACKED = 10202;
1534
+ declare const ITEM_HULL_PLATES_T2 = 20001;
1535
+ declare const ITEM_CARGO_LINING_T2 = 20002;
1536
+ declare const ITEM_CONTAINER_T2_PACKED = 20200;
1537
+
1538
+ interface RecipeInputItemId {
1539
+ itemId: number;
1540
+ quantity: number;
1067
1541
  }
1068
- declare class GoodPrice extends Struct {
1069
- id: UInt16;
1070
- good: Good;
1071
- price: UInt32;
1072
- supply: UInt16;
1542
+ interface RecipeInputCategory {
1543
+ category: ResourceCategory;
1544
+ tier: number;
1545
+ quantity: number;
1073
1546
  }
1547
+ type RecipeInput = RecipeInputItemId | RecipeInputCategory;
1548
+ interface StatSlot {
1549
+ sources: {
1550
+ inputIndex: number;
1551
+ statIndex: number;
1552
+ }[];
1553
+ }
1554
+ interface Recipe {
1555
+ outputItemId: number;
1556
+ outputMass: number;
1557
+ inputs: RecipeInput[];
1558
+ statSlots: StatSlot[];
1559
+ blendWeights: number[];
1560
+ }
1561
+ interface EntitySlot {
1562
+ type: ModuleType;
1563
+ }
1564
+ interface EntityLayout {
1565
+ entityItemId: number;
1566
+ slots: EntitySlot[];
1567
+ }
1568
+ declare function getRecipe(outputItemId: number): Recipe | undefined;
1569
+ declare function getEntityLayout(entityItemId: number): EntityLayout | undefined;
1570
+ declare function findItemByCategoryAndTier(category: ResourceCategory, tier: number): Item;
1074
1571
 
1075
1572
  interface EpochInfo {
1076
1573
  epoch: UInt64;
@@ -1158,265 +1655,161 @@ declare class GameState extends Types.state_row {
1158
1655
 
1159
1656
  interface PlayerStateInput {
1160
1657
  owner: NameType;
1161
- balance: UInt64Type;
1162
- debt: UInt32Type;
1163
- networth: Int64Type;
1164
1658
  }
1165
- /**
1166
- * Player helper class extending player_row with computed financial properties.
1167
- * Provides easy access to balance, debt, networth, and loan calculations.
1168
- */
1169
1659
  declare class Player extends Types.player_row {
1170
- /**
1171
- * Construct a Player instance from individual state pieces.
1172
- * Used by UI's ReactivePlayer to reconstruct Player from reactive state.
1173
- */
1174
1660
  static fromState(state: PlayerStateInput): Player;
1175
- private static readonly MAX_LOAN;
1176
- private static readonly BASE_SHIP_COST;
1177
- private static readonly SHIP_COST_MULTIPLIER;
1178
- private _shipCount?;
1179
- /**
1180
- * Set the current ship count (needed for nextShipCost calculation)
1181
- */
1182
- setShipCount(count: number): void;
1183
- /**
1184
- * Get the current ship count (if set)
1185
- */
1186
- get shipCount(): number | undefined;
1187
- /**
1188
- * Calculate the cost of the next ship based on current ship count
1189
- * Matches contract: pow(5, sequence) * 100
1190
- * @param shipCount - Optional ship count (uses cached value if not provided)
1191
- */
1192
- getNextShipCost(shipCount?: number): UInt64;
1193
- /**
1194
- * Get the cost of the next ship based on cached ship count
1195
- */
1196
- get nextShipCost(): UInt64;
1197
- /**
1198
- * Check if player can afford to buy a ship
1199
- * @param shipCount - Optional ship count (uses cached value if not provided)
1200
- */
1201
- canBuyShip(shipCount?: number): boolean;
1202
- /**
1203
- * Calculate available loan amount (max loan - current debt)
1204
- */
1205
- get availableLoan(): UInt64;
1206
- /**
1207
- * Check if player can take out a loan
1208
- */
1209
- get canTakeLoan(): boolean;
1210
- /**
1211
- * Check if player can pay back loan
1212
- */
1213
- get canPayLoan(): boolean;
1214
- /**
1215
- * Calculate maximum payback amount (min of debt and balance)
1216
- */
1217
- get maxPayback(): UInt64;
1218
- /**
1219
- * Get the maximum loan amount (constant)
1220
- */
1221
- static get MAX_LOAN_LIMIT(): number;
1222
- /**
1223
- * Check if player is in debt
1224
- */
1225
- get hasDebt(): boolean;
1226
- /**
1227
- * Check if player is solvent (positive networth)
1228
- */
1229
- get isSolvent(): boolean;
1230
- /**
1231
- * Create an optimistic update for balance changes
1232
- * Uses integer math to match contract
1233
- * @param delta - Amount to change (can be negative)
1234
- */
1235
- withBalanceChange(delta: UInt64 | number): Player;
1236
- /**
1237
- * Create an optimistic update for debt changes
1238
- * Uses integer math to match contract
1239
- * @param delta - Amount to change (can be negative)
1240
- */
1241
- withDebtChange(delta: UInt64 | number): Player;
1242
- /**
1243
- * Create an optimistic update for taking a loan
1244
- */
1245
- withLoan(amount: UInt64): Player;
1246
- /**
1247
- * Create an optimistic update for paying back a loan
1248
- */
1249
- withLoanPayment(amount: UInt64): Player;
1250
- /**
1251
- * Simulate networth update from selling goods.
1252
- * Matches contract: networth += (sellPrice - paid * quantity)
1253
- * Contract reference: market.cpp:75
1254
- *
1255
- * @param sellPrice - Total revenue from sale (price * quantity)
1256
- * @param paidPerUnit - Average cost per unit paid (from cargo.paid)
1257
- * @param quantity - Quantity being sold
1258
- * @returns New player with updated networth
1259
- *
1260
- * @example
1261
- * // Sold 10 units at 150 each (revenue=1500), paid 100 per unit
1262
- * const newPlayer = player.withSaleNetworth(
1263
- * UInt64.from(1500),
1264
- * UInt64.from(100),
1265
- * UInt32.from(10)
1266
- * )
1267
- * // Networth increases by: 1500 - (100*10) = 500
1268
- */
1269
- withSaleNetworth(sellPrice: UInt64, paidPerUnit: UInt64, quantity: UInt64): Player;
1270
- /**
1271
- * Simulate complete sell goods transaction.
1272
- * Updates both balance (adds revenue) and networth (adds profit).
1273
- * Matches contract actions: update_balance + update_networth
1274
- *
1275
- * @param sellPrice - Total revenue from sale (price * quantity)
1276
- * @param paidPerUnit - Average cost per unit paid (from cargo.paid)
1277
- * @param quantity - Quantity being sold
1278
- * @returns New player with updated balance and networth
1279
- */
1280
- withSellGoods(sellPrice: UInt64, paidPerUnit: UInt64, quantity: UInt64): Player;
1281
- /**
1282
- * Simulate complete buy goods transaction.
1283
- * Updates balance (subtracts cost).
1284
- *
1285
- * @param purchaseCost - Total cost of purchase (price * quantity)
1286
- * @returns New player with updated balance
1287
- */
1288
- withBuyGoods(purchaseCost: UInt64): Player;
1289
1661
  }
1290
1662
 
1291
1663
  declare class PlayersManager extends BaseManager {
1292
1664
  getPlayer(account: NameType): Promise<Player | undefined>;
1293
1665
  }
1294
1666
 
1295
- /**
1296
- * Location helper class for working with game coordinates.
1297
- * Provides system detection, market price caching, nearby planet finding, and supply tracking.
1298
- */
1299
- declare class Location {
1300
- readonly coordinates: Coordinates;
1301
- private _marketPrices?;
1302
- private _gameSeed?;
1303
- private _hasSystem?;
1304
- private _locationRows?;
1305
- private _epoch?;
1306
- constructor(coordinates: CoordinatesType);
1307
- /**
1308
- * Create a Location from coordinates
1309
- */
1310
- static from(coordinates: CoordinatesType): Location;
1311
- /**
1312
- * Check if this location has a system (planet, asteroid, or nebula)
1313
- */
1314
- hasSystemAt(gameSeed: Checksum256Type): boolean;
1315
- /**
1316
- * Get the location type (EMPTY, PLANET, ASTEROID, or NEBULA)
1317
- */
1318
- getLocationTypeAt(gameSeed: Checksum256Type): LocationType;
1319
- /**
1320
- * Check if this location is extractable (asteroid or nebula)
1321
- */
1322
- isExtractableAt(gameSeed: Checksum256Type): boolean;
1323
- /**
1324
- * Set cached market prices for this location
1325
- */
1326
- setMarketPrices(prices: GoodPrice[]): void;
1327
- /**
1328
- * Get cached market prices (returns undefined if not cached)
1329
- */
1330
- get marketPrices(): GoodPrice[] | undefined;
1331
- /**
1332
- * Get price for a specific good (from cache)
1333
- */
1334
- getPrice(goodId: UInt16Type): GoodPrice | undefined;
1335
- /**
1336
- * Find nearby planets from this location
1337
- */
1338
- findNearby(gameSeed: Checksum256Type, maxDistance?: UInt16Type): Distance[];
1339
- /**
1340
- * Check if this location equals another location
1341
- */
1342
- equals(other: CoordinatesType | Location): boolean;
1343
- /**
1344
- * Set location rows (supply data) for this location
1345
- */
1346
- setLocationRows(rows: Types.supply_row[], epoch: UInt64): void;
1347
- /**
1348
- * Get cached location rows (supply data)
1349
- */
1350
- get locationRows(): Types.supply_row[] | undefined;
1351
- /**
1352
- * Get supply for a specific good at this location
1353
- * Returns undefined if location rows not cached or good not found
1354
- */
1355
- getSupply(goodId: UInt16Type): UInt16 | undefined;
1356
- /**
1357
- * Get all available goods at this location (goods with supply > 0)
1358
- * Returns undefined if location rows not cached
1359
- */
1360
- get availableGoods(): Types.supply_row[] | undefined;
1361
- /**
1362
- * Check if a specific good is available (has supply)
1363
- * Returns false if location rows not cached
1364
- */
1365
- hasGood(goodId: UInt16Type): boolean;
1366
- /**
1367
- * Get the epoch for cached location data
1368
- */
1369
- get epoch(): UInt64 | undefined;
1370
- /**
1371
- * Check if cached data exists
1372
- */
1373
- get hasCachedData(): boolean;
1374
- /**
1375
- * Check if supply data is cached
1376
- */
1377
- get hasSupplyData(): boolean;
1378
- /**
1379
- * Clear all cached data
1380
- */
1381
- clearCache(): void;
1382
- /**
1383
- * Create optimistic Location with updated supply after purchase/sale.
1384
- * Matches contract: update_location_supply (delta can be positive or negative)
1385
- * Contract reference: market.cpp:53, 123-151
1386
- *
1387
- * @param goodId - Good ID to update supply for
1388
- * @param quantityDelta - Change in supply (negative for purchase, positive for sale)
1389
- * @returns New Location with updated supply in cached data
1390
- *
1391
- * @example
1392
- * // After buying 10 units (supply decreases)
1393
- * const newLocation = location.withUpdatedSupply(1, -10)
1394
- *
1395
- * // After selling 5 units (supply increases)
1396
- * const newLocation = location.withUpdatedSupply(1, 5)
1397
- */
1398
- withUpdatedSupply(goodId: UInt16Type, quantityDelta: number): Location;
1399
- }
1400
- /**
1401
- * Helper function to convert various coordinate types to Location
1402
- */
1403
- declare function toLocation(coords: CoordinatesType | Location): Location;
1404
-
1405
1667
  declare class LocationsManager extends BaseManager {
1406
- getMarketPrice(location: CoordinatesType, goodId: number): Promise<GoodPrice>;
1407
- getMarketPrices(location: CoordinatesType): Promise<GoodPrice[]>;
1408
- getMarketPricesWithSupply(location: CoordinatesType): Promise<GoodPrice[]>;
1409
1668
  hasSystem(location: CoordinatesType): Promise<boolean>;
1410
1669
  findNearbyPlanets(origin: CoordinatesType, maxDistance?: UInt16Type): Promise<Distance[]>;
1411
- getSupplyRows(location: CoordinatesType): Promise<any[]>;
1412
- getLocationWithPrices(coords: CoordinatesType): Promise<Location>;
1413
- getLocationWithSupply(coords: CoordinatesType): Promise<Location>;
1414
- getLocationComplete(coords: CoordinatesType): Promise<Location>;
1415
1670
  getLocationEntity(id: UInt64Type): Promise<Types.location_row | undefined>;
1416
1671
  getLocationEntityAt(coords: CoordinatesType): Promise<Types.location_row | undefined>;
1417
1672
  getAllLocationEntities(): Promise<Types.location_row[]>;
1418
1673
  }
1419
1674
 
1675
+ declare class EpochsManager extends BaseManager {
1676
+ getCurrentHeight(): Promise<UInt64>;
1677
+ getCurrent(): Promise<EpochInfo>;
1678
+ getByHeight(height: UInt64Type): Promise<EpochInfo>;
1679
+ getTimeRemaining(): Promise<number>;
1680
+ getProgress(): Promise<number>;
1681
+ fitsInCurrentEpoch(durationMs: number): Promise<boolean>;
1682
+ }
1683
+
1684
+ type EntityRefInput = {
1685
+ entityType: EntityTypeName;
1686
+ entityId: UInt64Type;
1687
+ };
1688
+ declare class ActionsManager extends BaseManager {
1689
+ travel(shipId: UInt64Type, destination: CoordinatesType, recharge?: boolean): Action;
1690
+ grouptravel(entities: EntityRefInput[], destination: CoordinatesType, recharge?: boolean): Action;
1691
+ resolve(entityId: UInt64Type, entityType?: EntityTypeName, count?: UInt64Type): Action;
1692
+ cancel(entityId: UInt64Type, count: UInt64Type, entityType?: EntityTypeName): Action;
1693
+ recharge(entityId: UInt64Type, entityType?: EntityTypeName): Action;
1694
+ transfer(sourceType: EntityTypeName, sourceId: UInt64Type, destType: EntityTypeName, destId: UInt64Type, itemId: UInt64Type, stats: UInt64Type, quantity: UInt64Type): Action;
1695
+ foundCompany(account: NameType, name: string): Action;
1696
+ join(account: NameType): Action;
1697
+ gather(source: EntityRefInput, destination: EntityRefInput, stratum: UInt16Type, quantity: UInt32Type): Action;
1698
+ warp(entityId: UInt64Type, destination: CoordinatesType, entityType?: EntityTypeName): Action;
1699
+ craft(entityType: EntityTypeName, entityId: UInt64Type, recipeId: number, quantity: number, inputs: ActionParams.Type.cargo_item[]): Action;
1700
+ blend(entityType: EntityTypeName, entityId: UInt64Type, inputs: ActionParams.Type.cargo_item[]): Action;
1701
+ deploy(entityType: EntityTypeName, entityId: UInt64Type, packedItemId: number, stats: bigint): Action;
1702
+ addmodule(entityType: EntityTypeName, entityId: UInt64Type, moduleIndex: number, moduleCargoId: UInt64Type, targetCargoId?: UInt64Type): Action;
1703
+ rmmodule(entityType: EntityTypeName, entityId: UInt64Type, moduleIndex: number, targetCargoId?: UInt64Type): Action;
1704
+ wrap(owner: NameType, entityType: EntityTypeName, entityId: UInt64Type, cargoId: UInt64Type, quantity: UInt64Type): Action;
1705
+ joinGame(account: NameType, companyName: string): Action[];
1706
+ }
1707
+
1708
+ type EntityInfo = Types.entity_info;
1709
+ interface BoundingBox {
1710
+ min_x: number;
1711
+ min_y: number;
1712
+ max_x: number;
1713
+ max_y: number;
1714
+ }
1715
+ interface WireCoordinates {
1716
+ x: number;
1717
+ y: number;
1718
+ z?: number;
1719
+ }
1720
+ type SubscribeMessage = {
1721
+ type: 'subscribe';
1722
+ sub_id: string;
1723
+ bounds?: BoundingBox;
1724
+ owner?: string;
1725
+ prioritize_owner?: string;
1726
+ };
1727
+ type UpdateBoundsMessage = {
1728
+ type: 'update_bounds';
1729
+ sub_id: string;
1730
+ bounds: BoundingBox;
1731
+ };
1732
+ type UnsubscribeMessage = {
1733
+ type: 'unsubscribe';
1734
+ sub_id: string;
1735
+ };
1736
+ type SubscribeEntityMessage = {
1737
+ type: 'subscribe_entity';
1738
+ sub_id: string;
1739
+ entity_type: 'ship' | 'warehouse' | 'container';
1740
+ entity_id: string;
1741
+ };
1742
+ type UnsubscribeEntityMessage = {
1743
+ type: 'unsubscribe_entity';
1744
+ sub_id: string;
1745
+ };
1746
+ type SubscribeEventsMessage = {
1747
+ type: 'subscribe_events';
1748
+ sub_id: string;
1749
+ event_filter?: Record<string, unknown>;
1750
+ };
1751
+ type UnsubscribeEventsMessage = {
1752
+ type: 'unsubscribe_events';
1753
+ sub_id: string;
1754
+ };
1755
+ type PingMessage = {
1756
+ type: 'ping';
1757
+ };
1758
+ type ClientMessage = SubscribeMessage | UpdateBoundsMessage | UnsubscribeMessage | SubscribeEntityMessage | UnsubscribeEntityMessage | SubscribeEventsMessage | UnsubscribeEventsMessage | PingMessage;
1759
+ type AckMessage = {
1760
+ type: 'subscribed' | 'unsubscribed' | 'bounds_updated';
1761
+ sub_id: string;
1762
+ };
1763
+ type WireEntity = Record<string, unknown> & {
1764
+ type: number;
1765
+ type_name: 'ship' | 'warehouse' | 'container';
1766
+ id: string | number;
1767
+ owner: string;
1768
+ coordinates: WireCoordinates;
1769
+ };
1770
+ type SnapshotMessage = {
1771
+ type: 'snapshot';
1772
+ sub_id: string;
1773
+ seq: number;
1774
+ entities: WireEntity[];
1775
+ truncated?: boolean;
1776
+ };
1777
+ type UpdateMessage = {
1778
+ type: 'update';
1779
+ sub_ids: string[];
1780
+ entity_id: number;
1781
+ entity: WireEntity;
1782
+ seq: number;
1783
+ };
1784
+ type BoundsDeltaMessage = {
1785
+ type: 'bounds_delta';
1786
+ sub_id: string;
1787
+ entered: WireEntity[];
1788
+ exited: number[];
1789
+ seq: number;
1790
+ truncated?: boolean;
1791
+ };
1792
+ type EventMessage = {
1793
+ type: 'event';
1794
+ sub_id: string;
1795
+ catchup: boolean;
1796
+ events: Array<Record<string, unknown>>;
1797
+ seq?: number;
1798
+ };
1799
+ type EventCatchupCompleteMessage = {
1800
+ type: 'event_catchup_complete';
1801
+ sub_id: string;
1802
+ };
1803
+ type PongMessage = {
1804
+ type: 'pong';
1805
+ };
1806
+ type ErrorMessage = {
1807
+ type: 'error';
1808
+ error: string;
1809
+ sub_id?: string;
1810
+ };
1811
+ type ServerMessage = AckMessage | SnapshotMessage | UpdateMessage | BoundsDeltaMessage | EventMessage | EventCatchupCompleteMessage | PongMessage | ErrorMessage;
1812
+
1420
1813
  interface MovementCapability {
1421
1814
  engines: Types.movement_stats;
1422
1815
  generator: Types.energy_stats;
@@ -1432,11 +1825,8 @@ interface StorageCapability {
1432
1825
  interface LoaderCapability {
1433
1826
  loaders: Types.loader_stats;
1434
1827
  }
1435
- interface TradeCapability {
1436
- trade: Types.trade_stats;
1437
- }
1438
- interface ExtractorCapability {
1439
- extractor: Types.extractor_stats;
1828
+ interface GathererCapability {
1829
+ gatherer: Types.gatherer_stats;
1440
1830
  }
1441
1831
  interface MassCapability {
1442
1832
  hullmass: UInt32;
@@ -1450,8 +1840,9 @@ interface EntityCapabilities {
1450
1840
  engines?: Types.movement_stats;
1451
1841
  generator?: Types.energy_stats;
1452
1842
  loaders?: Types.loader_stats;
1453
- trade?: Types.trade_stats;
1454
- extractor?: Types.extractor_stats;
1843
+ gatherer?: Types.gatherer_stats;
1844
+ crafter?: Types.crafter_stats;
1845
+ hauler?: Types.hauler_stats;
1455
1846
  }
1456
1847
  interface EntityState {
1457
1848
  owner: Name;
@@ -1463,9 +1854,45 @@ interface EntityState {
1463
1854
  declare function capsHasMovement(caps: EntityCapabilities): boolean;
1464
1855
  declare function capsHasStorage(caps: EntityCapabilities): boolean;
1465
1856
  declare function capsHasLoaders(caps: EntityCapabilities): boolean;
1466
- declare function capsHasTrade(caps: EntityCapabilities): boolean;
1467
- declare function capsHasExtractor(caps: EntityCapabilities): boolean;
1857
+ declare function capsHasGatherer(caps: EntityCapabilities): boolean;
1468
1858
  declare function capsHasMass(caps: EntityCapabilities): boolean;
1859
+ declare function capsHasHauler(caps: EntityCapabilities): boolean;
1860
+
1861
+ interface HasCargo {
1862
+ cargo: Types.cargo_item[];
1863
+ }
1864
+ interface HasCapacity {
1865
+ capacity: UInt32;
1866
+ }
1867
+ interface HasCargomass {
1868
+ cargomass: UInt32;
1869
+ }
1870
+ interface MassInput {
1871
+ item_id: UInt16;
1872
+ quantity: UInt32;
1873
+ modules: Types.module_entry[];
1874
+ }
1875
+ declare function calcCargoItemMass(item: MassInput): UInt64;
1876
+ declare function calcCargoMass(entity: HasCargo): UInt64;
1877
+ declare function calcStacksMass(stacks: CargoStack[]): UInt64;
1878
+ declare function availableCapacity$1(entity: StorageCapability): UInt64;
1879
+ declare function availableCapacityFromMass(capacity: UInt64Type, cargoMass: UInt64Type): UInt64;
1880
+ declare function hasSpace$1(entity: StorageCapability, goodMass: UInt64, quantity: number): boolean;
1881
+ declare function hasSpaceForMass(capacity: UInt64Type, currentMass: UInt64Type, additionalMass: UInt64Type): boolean;
1882
+ declare function isFull$1(entity: HasCapacity & HasCargomass): boolean;
1883
+ declare function isFullFromMass(capacity: UInt64Type, cargoMass: UInt64Type): boolean;
1884
+ interface CargoStack {
1885
+ item_id: UInt16;
1886
+ quantity: UInt32;
1887
+ stats: UInt64;
1888
+ modules: Types.module_entry[];
1889
+ }
1890
+ declare function cargoItemToStack(item: Types.cargo_item): CargoStack;
1891
+ declare function stackToCargoItem(stack: CargoStack): Types.cargo_item;
1892
+ declare function stackKey(s: CargoStack): string;
1893
+ declare function stacksEqual(a: CargoStack, b: CargoStack): boolean;
1894
+ declare function mergeStacks(stacks: CargoStack[], add: CargoStack): CargoStack[];
1895
+ declare function removeFromStacks(stacks: CargoStack[], remove: CargoStack): CargoStack[];
1469
1896
 
1470
1897
  type Schedule = Types.schedule;
1471
1898
  type Task$1 = Types.task;
@@ -1513,7 +1940,7 @@ declare function isInFlight(entity: ScheduleData, now: Date): boolean;
1513
1940
  declare function isRecharging(entity: ScheduleData, now: Date): boolean;
1514
1941
  declare function isLoading(entity: ScheduleData, now: Date): boolean;
1515
1942
  declare function isUnloading(entity: ScheduleData, now: Date): boolean;
1516
- declare function isExtracting(entity: ScheduleData, now: Date): boolean;
1943
+ declare function isGathering(entity: ScheduleData, now: Date): boolean;
1517
1944
 
1518
1945
  type schedule_ScheduleData = ScheduleData;
1519
1946
  type schedule_Scheduleable = Scheduleable;
@@ -1538,7 +1965,7 @@ declare const schedule_isInFlight: typeof isInFlight;
1538
1965
  declare const schedule_isRecharging: typeof isRecharging;
1539
1966
  declare const schedule_isLoading: typeof isLoading;
1540
1967
  declare const schedule_isUnloading: typeof isUnloading;
1541
- declare const schedule_isExtracting: typeof isExtracting;
1968
+ declare const schedule_isGathering: typeof isGathering;
1542
1969
  declare namespace schedule {
1543
1970
  export {
1544
1971
  schedule_ScheduleData as ScheduleData,
@@ -1565,25 +1992,25 @@ declare namespace schedule {
1565
1992
  schedule_isRecharging as isRecharging,
1566
1993
  schedule_isLoading as isLoading,
1567
1994
  schedule_isUnloading as isUnloading,
1568
- schedule_isExtracting as isExtracting,
1995
+ schedule_isGathering as isGathering,
1569
1996
  };
1570
1997
  }
1571
1998
 
1572
1999
  interface ProjectedEntity {
1573
2000
  location: Coordinates;
1574
2001
  energy: UInt16;
1575
- cargoMass: UInt64;
2002
+ cargo: CargoStack[];
1576
2003
  shipMass: UInt32;
1577
2004
  capacity?: UInt64;
1578
2005
  engines?: Types.movement_stats;
1579
2006
  loaders?: Types.loader_stats;
1580
2007
  generator?: Types.energy_stats;
1581
- trade?: Types.trade_stats;
2008
+ hauler?: Types.hauler_stats;
2009
+ readonly cargoMass: UInt64;
1582
2010
  readonly totalMass: UInt64;
1583
2011
  hasMovement(): boolean;
1584
2012
  hasStorage(): boolean;
1585
2013
  hasLoaders(): boolean;
1586
- hasTrade(): boolean;
1587
2014
  capabilities(): EntityCapabilities;
1588
2015
  state(): EntityState;
1589
2016
  }
@@ -1594,16 +2021,37 @@ interface Projectable extends ScheduleData {
1594
2021
  generator?: Types.energy_stats;
1595
2022
  engines?: Types.movement_stats;
1596
2023
  loaders?: Types.loader_stats;
1597
- trade?: Types.trade_stats;
2024
+ hauler?: Types.hauler_stats;
1598
2025
  capacity?: UInt32;
1599
2026
  cargo: Types.cargo_item[];
1600
2027
  cargomass: UInt32;
1601
2028
  owner?: Name;
1602
2029
  }
1603
2030
  declare function createProjectedEntity(entity: Projectable): ProjectedEntity;
1604
- declare function projectEntity(entity: Projectable): ProjectedEntity;
2031
+ interface ProjectionOptions {
2032
+ upToTaskIndex?: number;
2033
+ }
2034
+ declare function projectEntity(entity: Projectable, options?: ProjectionOptions): ProjectedEntity;
2035
+ declare function validateSchedule(entity: Projectable): void;
1605
2036
  declare function projectEntityAt(entity: Projectable, now: Date): ProjectedEntity;
1606
2037
 
2038
+ declare class Location {
2039
+ readonly coordinates: Coordinates;
2040
+ private _gameSeed?;
2041
+ private _hasSystem?;
2042
+ private _epoch?;
2043
+ constructor(coordinates: CoordinatesType);
2044
+ static from(coordinates: CoordinatesType): Location;
2045
+ hasSystemAt(gameSeed: Checksum256Type): boolean;
2046
+ getLocationTypeAt(gameSeed: Checksum256Type): LocationType;
2047
+ isGatherableAt(gameSeed: Checksum256Type): boolean;
2048
+ findNearby(gameSeed: Checksum256Type, maxDistance?: UInt16Type): Distance[];
2049
+ equals(other: CoordinatesType | Location): boolean;
2050
+ get epoch(): UInt64 | undefined;
2051
+ clearCache(): void;
2052
+ }
2053
+ declare function toLocation(coords: CoordinatesType | Location): Location;
2054
+
1607
2055
  type Task = Types.task;
1608
2056
  declare class ScheduleAccessor {
1609
2057
  private entity;
@@ -1629,99 +2077,33 @@ declare class ScheduleAccessor {
1629
2077
  declare function createScheduleAccessor(entity: ScheduleData): ScheduleAccessor;
1630
2078
 
1631
2079
  declare class EntityInventory extends Types.cargo_item {
1632
- private _good?;
1633
- get good(): Good;
2080
+ private _item?;
2081
+ get item(): Item;
2082
+ get good(): Item;
1634
2083
  get name(): string;
1635
2084
  get unitMass(): UInt32;
1636
2085
  get totalMass(): UInt64;
1637
- get totalCost(): UInt64;
1638
2086
  get hasCargo(): boolean;
1639
2087
  get isEmpty(): boolean;
1640
2088
  }
1641
2089
 
1642
- interface HasCargo {
1643
- cargo: Types.cargo_item[];
1644
- }
1645
- interface HasCapacity {
1646
- capacity: UInt32;
1647
- }
1648
- interface HasCargomass {
1649
- cargomass: UInt32;
1650
- }
1651
- declare function calcCargoMass(entity: HasCargo): UInt64;
1652
- declare function calcCargoValue(entity: HasCargo): UInt64;
1653
- declare function availableCapacity$1(entity: StorageCapability): UInt64;
1654
- declare function availableCapacityFromMass(capacity: UInt64Type, cargoMass: UInt64Type): UInt64;
1655
- declare function hasSpace$1(entity: StorageCapability, goodMass: UInt64, quantity: number): boolean;
1656
- declare function hasSpaceForMass(capacity: UInt64Type, currentMass: UInt64Type, additionalMass: UInt64Type): boolean;
1657
- declare function isFull$1(entity: HasCapacity & HasCargomass): boolean;
1658
- declare function isFullFromMass(capacity: UInt64Type, cargoMass: UInt64Type): boolean;
1659
-
1660
2090
  declare class InventoryAccessor {
1661
2091
  private readonly entity;
1662
2092
  private _items?;
1663
2093
  constructor(entity: HasCargo);
1664
2094
  get items(): EntityInventory[];
1665
2095
  get totalMass(): UInt64;
1666
- get totalValue(): UInt64;
1667
- forGood(goodId: UInt64Type): EntityInventory | undefined;
2096
+ forItem(goodId: UInt64Type): EntityInventory | undefined;
1668
2097
  get sellable(): EntityInventory[];
1669
2098
  get hasSellable(): boolean;
1670
2099
  get sellableCount(): number;
1671
2100
  }
1672
2101
  declare function createInventoryAccessor(entity: HasCargo): InventoryAccessor;
1673
2102
 
1674
- interface CargoData {
1675
- cargo: EntityInventory[];
1676
- }
1677
- declare function totalCargoMass(cargo: EntityInventory[]): UInt64;
1678
- declare function cargoValue(cargo: EntityInventory[]): UInt64;
1679
- declare function getCargoForGood(cargo: EntityInventory[], goodId: UInt64Type): EntityInventory | undefined;
1680
- declare function hasSpace(currentMass: UInt64, maxCapacity: UInt64, goodMass: UInt64, quantity: number): boolean;
1681
- declare function availableCapacity(currentMass: UInt64, maxCapacity: UInt64): UInt64;
1682
- declare function isFull(currentMass: UInt64, maxCapacity: UInt64): boolean;
1683
- interface SaleValue {
1684
- revenue: UInt64;
1685
- profit: UInt64;
1686
- cost: UInt64;
1687
- }
1688
- declare function calculateSaleValue(cargo: Types.cargo_item[], prices: Map<number, UInt64>): SaleValue;
1689
- declare function calculateSaleValueFromArray(cargo: Types.cargo_item[], prices: UInt64[]): SaleValue;
1690
- declare function afterSellGoods(cargo: Types.cargo_item[], goodsToSell: Array<{
1691
- goodId: number;
1692
- quantity: number;
1693
- }>): EntityInventory[];
1694
- declare function afterSellAllGoods(cargo: Types.cargo_item[]): EntityInventory[];
1695
-
1696
- type cargoUtils_CargoData = CargoData;
1697
- declare const cargoUtils_totalCargoMass: typeof totalCargoMass;
1698
- declare const cargoUtils_cargoValue: typeof cargoValue;
1699
- declare const cargoUtils_getCargoForGood: typeof getCargoForGood;
1700
- declare const cargoUtils_hasSpace: typeof hasSpace;
1701
- declare const cargoUtils_availableCapacity: typeof availableCapacity;
1702
- declare const cargoUtils_isFull: typeof isFull;
1703
- type cargoUtils_SaleValue = SaleValue;
1704
- declare const cargoUtils_calculateSaleValue: typeof calculateSaleValue;
1705
- declare const cargoUtils_calculateSaleValueFromArray: typeof calculateSaleValueFromArray;
1706
- declare const cargoUtils_afterSellGoods: typeof afterSellGoods;
1707
- declare const cargoUtils_afterSellAllGoods: typeof afterSellAllGoods;
1708
- declare namespace cargoUtils {
1709
- export {
1710
- cargoUtils_CargoData as CargoData,
1711
- cargoUtils_totalCargoMass as totalCargoMass,
1712
- cargoUtils_cargoValue as cargoValue,
1713
- cargoUtils_getCargoForGood as getCargoForGood,
1714
- cargoUtils_hasSpace as hasSpace,
1715
- cargoUtils_availableCapacity as availableCapacity,
1716
- cargoUtils_isFull as isFull,
1717
- cargoUtils_SaleValue as SaleValue,
1718
- cargoUtils_calculateSaleValue as calculateSaleValue,
1719
- cargoUtils_calculateSaleValueFromArray as calculateSaleValueFromArray,
1720
- cargoUtils_afterSellGoods as afterSellGoods,
1721
- cargoUtils_afterSellAllGoods as afterSellAllGoods,
1722
- };
2103
+ interface PackedModuleInput {
2104
+ itemId: UInt16Type;
2105
+ stats: UInt64Type;
1723
2106
  }
1724
-
1725
2107
  interface ShipStateInput {
1726
2108
  id: UInt64Type;
1727
2109
  owner: string;
@@ -1731,12 +2113,10 @@ interface ShipStateInput {
1731
2113
  y: number;
1732
2114
  z?: number;
1733
2115
  };
1734
- hullmass: number;
1735
- capacity: number;
1736
- energy: number;
1737
- engines: Types.movement_stats;
1738
- generator: Types.energy_stats;
1739
- loaders: Types.loader_stats;
2116
+ hullmass?: number;
2117
+ capacity?: number;
2118
+ energy?: number;
2119
+ modules?: PackedModuleInput[];
1740
2120
  schedule?: Types.schedule;
1741
2121
  cargo?: Types.cargo_item[];
1742
2122
  }
@@ -1756,18 +2136,20 @@ declare class Ship extends Types.entity_info {
1756
2136
  isRecharging(now: Date): boolean;
1757
2137
  isLoading(now: Date): boolean;
1758
2138
  isUnloading(now: Date): boolean;
1759
- isExtracting(now: Date): boolean;
1760
- get hasExtractor(): boolean;
2139
+ isGathering(now: Date): boolean;
2140
+ get hasEngines(): boolean;
2141
+ get hasGenerator(): boolean;
2142
+ get hasGatherer(): boolean;
2143
+ get hasWarp(): boolean;
1761
2144
  project(): ProjectedEntity;
1762
2145
  projectAt(now: Date): ProjectedEntity;
1763
2146
  get location(): Location;
1764
2147
  get totalCargoMass(): UInt64;
1765
- get cargoValue(): UInt64;
1766
2148
  get totalMass(): UInt64;
1767
2149
  get maxCapacity(): UInt64;
1768
2150
  hasSpace(goodMass: UInt64, quantity: number): boolean;
1769
2151
  get availableCapacity(): UInt64;
1770
- getCargoForGood(goodId: UInt64Type): EntityInventory | undefined;
2152
+ getCargoForItem(goodId: UInt64Type): EntityInventory | undefined;
1771
2153
  get sellableCargo(): EntityInventory[];
1772
2154
  get hasSellableCargo(): boolean;
1773
2155
  get sellableGoodsCount(): number;
@@ -1775,439 +2157,6 @@ declare class Ship extends Types.entity_info {
1775
2157
  get energyPercent(): number;
1776
2158
  get needsRecharge(): boolean;
1777
2159
  hasEnergyFor(distance: UInt64): boolean;
1778
- calculateSaleValue(prices: Map<number, UInt64>): SaleValue;
1779
- calculateSaleValueFromArray(prices: UInt64[]): SaleValue;
1780
- afterSellGoods(goodsToSell: Array<{
1781
- goodId: number;
1782
- quantity: number;
1783
- }>): EntityInventory[];
1784
- afterSellAllGoods(): EntityInventory[];
1785
- }
1786
-
1787
- /**
1788
- * Travel calculations for ship movement, energy usage, and flight times.
1789
- *
1790
- * Functions prefixed with `calc_` are contract-parity functions that mirror
1791
- * the C++ implementation in the server contract (schedule.cpp, ship.cpp).
1792
- * These use snake_case intentionally to match the contract naming convention
1793
- * and signal that they must produce identical results to the on-chain code.
1794
- *
1795
- * Functions prefixed with `calculate` are higher-level SDK helpers that may
1796
- * combine multiple contract calculations for convenience.
1797
- */
1798
-
1799
- declare function calc_orbital_altitude(mass: number): number;
1800
- declare function distanceBetweenCoordinates(origin: ActionParams.Type.coordinates, destination: ActionParams.Type.coordinates): UInt64;
1801
- declare function distanceBetweenPoints(x1: Int64Type, y1: Int64Type, x2: Int64Type, y2: Int64Type): UInt64;
1802
- declare function lerp(origin: ActionParams.Type.coordinates, destination: ActionParams.Type.coordinates, time: number): ActionParams.Type.coordinates;
1803
- declare function rotation(origin: ActionParams.Type.coordinates, destination: ActionParams.Type.coordinates): number;
1804
- declare function findNearbyPlanets(seed: Checksum256, origin: ActionParams.Type.coordinates, maxDistance?: UInt64Type): Distance[];
1805
- declare function calc_rechargetime(capacity: UInt32Type, energy: UInt32Type, recharge: UInt32Type): UInt32;
1806
- declare function calc_ship_rechargetime(ship: ShipLike): UInt32;
1807
- declare function calc_flighttime(distance: UInt64Type, acceleration: number): UInt32;
1808
- declare function calc_loader_flighttime(ship: ShipLike, mass: UInt64, altitude?: number): UInt32;
1809
- declare function calc_loader_acceleration(ship: ShipLike, mass: UInt64): number;
1810
- declare function calc_ship_flighttime(ship: ShipLike, mass: UInt64, distance: UInt64): UInt32;
1811
- declare function calc_ship_acceleration(ship: ShipLike, mass: UInt64): number;
1812
- declare function calc_acceleration(thrust: number, mass: number): number;
1813
- declare function calc_ship_mass(ship: ShipLike, cargos: CargoMassInfo[]): UInt64;
1814
- declare function calc_energyusage(distance: UInt64Type, drain: UInt32Type): UInt32;
1815
- declare function calculateTransferTime(ship: ShipLike, cargos: CargoMassInfo[], quantities?: Map<number, number>): UInt32;
1816
- declare function calculateRefuelingTime(ship: ShipLike): UInt32;
1817
- declare function calculateFlightTime(ship: ShipLike, cargos: CargoMassInfo[], distance: UInt64Type): UInt32;
1818
- interface LoadTimeBreakdown {
1819
- unloadTime: number;
1820
- loadTime: number;
1821
- totalTime: number;
1822
- unloadMass: number;
1823
- loadMass: number;
1824
- }
1825
- declare function calculateLoadTimeBreakdown(ship: ShipLike, cargos: CargoMassInfo[], loadQuantities?: Map<number, number>, unloadQuantities?: Map<number, number>): LoadTimeBreakdown;
1826
- interface EstimatedTravelTime {
1827
- flightTime: UInt32;
1828
- rechargeTime: UInt32;
1829
- loadTime: UInt32;
1830
- unloadTime: UInt32;
1831
- total: UInt32;
1832
- }
1833
- interface EstimateTravelTimeOptions {
1834
- needsRecharge?: boolean;
1835
- loadMass?: UInt32Type;
1836
- unloadMass?: UInt32Type;
1837
- }
1838
- declare function estimateTravelTime(ship: ShipLike, travelMass: UInt64Type, distance: UInt64Type, options?: EstimateTravelTimeOptions): EstimatedTravelTime;
1839
- declare function estimateDealTravelTime(ship: ShipLike, shipMass: UInt64Type, distance: UInt64Type, loadMass: UInt32Type): UInt32;
1840
- declare function hasEnergyForDistance(ship: ShipLike, distance: UInt64Type): boolean;
1841
- interface TransferEntity {
1842
- location: {
1843
- z?: {
1844
- toNumber(): number;
1845
- } | number;
1846
- };
1847
- loaders?: {
1848
- thrust: {
1849
- toNumber(): number;
1850
- } | number;
1851
- mass: {
1852
- toNumber(): number;
1853
- } | number;
1854
- quantity: {
1855
- toNumber(): number;
1856
- } | number;
1857
- };
1858
- }
1859
- interface HasScheduleAndLocation {
1860
- coordinates: ActionParams.Type.coordinates;
1861
- schedule?: Types.schedule;
1862
- }
1863
- declare function getFlightOrigin(entity: HasScheduleAndLocation, flightTaskIndex: number): ActionParams.Type.coordinates;
1864
- declare function getDestinationLocation(entity: HasScheduleAndLocation): ActionParams.Type.coordinates | undefined;
1865
- declare function getPositionAt(entity: HasScheduleAndLocation, taskIndex: number, taskProgress: number): ActionParams.Type.coordinates;
1866
- declare function calc_transfer_duration(source: TransferEntity, dest: TransferEntity, cargoMass: number): number;
1867
-
1868
- /**
1869
- * Trading deal interface representing a profitable trade opportunity
1870
- */
1871
- interface Deal {
1872
- /** Origin location */
1873
- origin: Location;
1874
- /** Destination location */
1875
- destination: Location;
1876
- /** Good to trade */
1877
- good: GoodPrice;
1878
- /** Distance between origin and destination */
1879
- distance: UInt64;
1880
- /** Available supply at origin */
1881
- supply: UInt16;
1882
- /** Buy price at origin */
1883
- buyPrice: UInt32;
1884
- /** Sell price at destination */
1885
- sellPrice: UInt32;
1886
- /** Profit per unit */
1887
- profitPerUnit: UInt32;
1888
- /** Maximum quantity that can be traded */
1889
- maxQuantity: UInt32;
1890
- /** Total profit for max quantity */
1891
- totalProfit: Int64;
1892
- /** Estimated travel time in seconds */
1893
- travelTime: UInt32;
1894
- /** Detailed breakdown of travel time components */
1895
- travelTimeBreakdown: EstimatedTravelTime;
1896
- /** Profit per second (floating point for UI display) */
1897
- profitPerSecond: number;
1898
- /** Profit margin percentage (floating point for UI display) */
1899
- marginPercent: number;
1900
- }
1901
- /**
1902
- * Options for finding deals
1903
- */
1904
- interface FindDealsOptions {
1905
- /** Maximum number of deals to return */
1906
- maxDeals?: number;
1907
- /** Maximum search distance */
1908
- maxDistance?: number;
1909
- /** Player's current balance (for affordability filtering) */
1910
- playerBalance?: UInt64Type;
1911
- /** Minimum profit per second threshold */
1912
- minProfitPerSecond?: number;
1913
- /** Minimum profit margin percentage */
1914
- minMarginPercent?: number;
1915
- /** Override available cargo space (in mass units). If provided, uses this instead of calculating from ship's current cargo. */
1916
- availableSpace?: number;
1917
- }
1918
- /**
1919
- * Calculate deals for a ship from a specific origin location
1920
- */
1921
- declare function findDealsForShip(ship: Ship, originLocation: Coordinates, getNearbyLocations: (origin: Coordinates, maxDistance: number) => Promise<Location[]>, getMarketPrices: (location: Coordinates) => Promise<GoodPrice[]>, options?: FindDealsOptions): Promise<Deal[]>;
1922
- /**
1923
- * Find the single best deal for a ship from a specific origin location
1924
- */
1925
- declare function findBestDeal(ship: Ship, originLocation: Coordinates, getNearbyLocations: (origin: Coordinates, maxDistance: number) => Promise<Location[]>, getMarketPrices: (location: Coordinates) => Promise<GoodPrice[]>, options?: FindDealsOptions): Promise<Deal | undefined>;
1926
-
1927
- /**
1928
- * Types of collect actions available to the player
1929
- */
1930
- type CollectActionType = 'sell-and-trade' | 'sell-and-reposition' | 'travel-to-sell' | 'sell-and-stay' | 'explore' | 'orbit';
1931
- /**
1932
- * Represents a single collect option presented to the player
1933
- */
1934
- interface CollectOption {
1935
- /** Unique identifier for this option */
1936
- id: string;
1937
- /** Type of action sequence */
1938
- type: CollectActionType;
1939
- /** Human-readable title */
1940
- title: string;
1941
- /** Detailed description of what will happen */
1942
- description: string;
1943
- /** Brief explanation of why this option is worth considering */
1944
- reason: string;
1945
- /** Whether this is the recommended option (best profitPerSecond with quality threshold) */
1946
- recommended: boolean;
1947
- /** Whether this option has the highest absolute profit (may differ from recommended) */
1948
- highestProfit: boolean;
1949
- /** Estimated profit/loss from this action */
1950
- estimatedProfit: UInt64;
1951
- /** Revenue from selling cargo (if applicable) */
1952
- saleRevenue?: UInt64;
1953
- /** Cost of purchasing new cargo (if applicable) */
1954
- purchaseCost?: UInt64;
1955
- /** Expected profit from the next trade (if applicable) */
1956
- nextTradeProfit?: UInt64;
1957
- /** Profit per second for this option (floating point for display) */
1958
- profitPerSecond?: number;
1959
- /** Margin percentage for the deal (floating point for display) */
1960
- marginPercent?: number;
1961
- /** Destination location (if traveling) */
1962
- destination?: Location;
1963
- /** Deal to execute (if buying goods) */
1964
- deal?: Deal;
1965
- /** Sale location if different from current */
1966
- saleLocation?: Location;
1967
- /** Price per unit at sale location */
1968
- salePrice?: UInt32;
1969
- /** Price per unit at current location (for comparison) */
1970
- currentPrice?: UInt32;
1971
- /** Estimated travel time in seconds (undefined = instant/no travel) */
1972
- travelTime?: UInt32;
1973
- /** Detailed breakdown of travel time components */
1974
- travelTimeBreakdown?: EstimatedTravelTime;
1975
- /** Info about a discounted good at the destination (for explore options) */
1976
- discountedGood?: DiscountedGoodInfo;
1977
- /** Top potential deals available at destination (for explore options) */
1978
- potentialDeals?: PotentialDeal[];
1979
- /** Details of cargo being sold (if selling cargo) */
1980
- cargoSale?: CargoSaleItem[];
1981
- /** Total profit/loss from selling cargo */
1982
- cargoProfitLoss?: Int64;
1983
- }
1984
- /**
1985
- * Analysis result for collect options
1986
- */
1987
- interface CollectAnalysis {
1988
- /** Current location where ship arrived */
1989
- arrivedAt: Coordinates;
1990
- /** Ship being analyzed */
1991
- ship: Ship;
1992
- /** Current cargo on ship */
1993
- cargo: EntityInventory[];
1994
- /** Value of cargo if sold at current location */
1995
- cargoValueHere: UInt64;
1996
- /** All available options, sorted by estimated profit */
1997
- options: CollectOption[];
1998
- /** Whether any profitable options exist */
1999
- hasProfitableOptions: boolean;
2000
- }
2001
- /**
2002
- * Options for analyzing collect choices
2003
- */
2004
- interface CollectAnalysisOptions {
2005
- /** Player's current balance (defaults to Infinity) */
2006
- playerBalance?: number;
2007
- /** Maximum distance to search (defaults to ship's max range) */
2008
- maxDistance?: number;
2009
- /** Minimum profit improvement to suggest traveling elsewhere to sell */
2010
- minSaleImprovement?: number;
2011
- }
2012
- /**
2013
- * Find locations where current cargo could be sold for more
2014
- */
2015
- interface BetterSaleLocation {
2016
- location: Location;
2017
- /** Price per unit at this location */
2018
- price: UInt32;
2019
- /** Total revenue if sold here */
2020
- revenue: UInt64;
2021
- /** Difference vs selling at current location */
2022
- improvement: Int64;
2023
- /** Best deal available at this location after selling */
2024
- bestDealAfterSale?: Deal;
2025
- /** Distance to this location */
2026
- distance: UInt64;
2027
- /** Estimated travel time */
2028
- travelTime: UInt32;
2029
- /** Detailed breakdown of travel time components */
2030
- travelTimeBreakdown?: EstimatedTravelTime;
2031
- }
2032
- /**
2033
- * Find locations with good deals when current location has none
2034
- */
2035
- interface RepositionLocation {
2036
- location: Location;
2037
- /** Best deal available at this location */
2038
- bestDeal: Deal;
2039
- /** Distance to this location */
2040
- distance: UInt64;
2041
- /** Estimated travel time */
2042
- travelTime: UInt32;
2043
- /** Detailed breakdown of travel time components */
2044
- travelTimeBreakdown?: EstimatedTravelTime;
2045
- }
2046
- /**
2047
- * Analyze cargo sale value at a specific location
2048
- */
2049
- declare function analyzeCargoSale(cargo: EntityInventory[], prices: Map<number, UInt64>): {
2050
- revenue: UInt64;
2051
- cost: UInt64;
2052
- profit: Int64;
2053
- };
2054
- /**
2055
- * Create a "Sell & Trade" option (full loop)
2056
- */
2057
- declare function createSellAndTradeOption(saleRevenue: UInt64, saleCost: UInt64, deal: Deal, cargoSale?: CargoSaleItem[], unloadTime?: UInt32): CollectOption;
2058
- /**
2059
- * Create a "Travel to Sell" option (better market elsewhere)
2060
- */
2061
- declare function createTravelToSellOption(currentRevenue: UInt64, cargoCost: UInt64, betterSale: BetterSaleLocation, cargo: EntityInventory[], destPrices?: Map<number, UInt64>): CollectOption;
2062
- /**
2063
- * Create a "Sell & Reposition" option (sell here, travel empty to deals)
2064
- */
2065
- declare function createSellAndRepositionOption(saleRevenue: UInt64, saleCost: UInt64, reposition: RepositionLocation, cargoSale?: CargoSaleItem[]): CollectOption;
2066
- /**
2067
- * Create a "Sell & Stay" option (just sell, stay idle)
2068
- */
2069
- declare function createSellAndStayOption(saleRevenue: UInt64, saleCost: UInt64, cargoSale?: CargoSaleItem[], unloadTime?: UInt32): CollectOption;
2070
- /**
2071
- * Details about a cargo item being sold
2072
- */
2073
- interface CargoSaleItem {
2074
- goodId: UInt16;
2075
- goodName: string;
2076
- quantity: UInt32;
2077
- /** Price per unit at sale location */
2078
- pricePerUnit: UInt32;
2079
- /** Total revenue from this item */
2080
- revenue: UInt64;
2081
- /** Original cost (paid) per unit */
2082
- costPerUnit: UInt64;
2083
- /** Profit/loss on this item */
2084
- profit: Int64;
2085
- }
2086
- /**
2087
- * Info about a discounted good for explore options
2088
- */
2089
- interface DiscountedGoodInfo {
2090
- goodId: number;
2091
- name: string;
2092
- rarity: string;
2093
- discountPercent: number;
2094
- }
2095
- /**
2096
- * A potential deal available at a destination (for explore options)
2097
- */
2098
- interface PotentialDeal {
2099
- goodId: number;
2100
- goodName: string;
2101
- destinationCoords: Coordinates;
2102
- marginPercent: number;
2103
- profitPerSecond: number;
2104
- }
2105
- /**
2106
- * Create an "Explore" option (travel to find opportunities)
2107
- */
2108
- declare function createExploreOption(destination: Location, travelTime?: UInt32, discountedGood?: DiscountedGoodInfo, travelTimeBreakdown?: EstimatedTravelTime, potentialDeals?: PotentialDeal[]): CollectOption;
2109
- /**
2110
- * Callbacks for collect analysis (provided by manager)
2111
- */
2112
- interface CollectAnalysisCallbacks {
2113
- getNearbyLocations: (origin: Coordinates, maxDistance: number) => Promise<Location[]>;
2114
- getMarketPrices: (location: Coordinates) => Promise<GoodPrice[]>;
2115
- getGameSeed?: () => Checksum256Type;
2116
- getState?: () => Types.state_row;
2117
- }
2118
- /**
2119
- * Analyze all collect options for a ship that has arrived at its destination.
2120
- * Returns all available options sorted by estimated profit.
2121
- */
2122
- declare function analyzeCollectOptions(ship: Ship, arrivedAt: Coordinates, callbacks: CollectAnalysisCallbacks, options?: CollectAnalysisOptions): Promise<CollectAnalysis>;
2123
-
2124
- declare class TradesManager extends BaseManager {
2125
- private priceCache;
2126
- private priceCacheEpoch;
2127
- private makePriceCacheKey;
2128
- private createCallbacks;
2129
- clearPriceCache(): void;
2130
- findDeals(ship: Ship, originLocation?: Coordinates, options?: FindDealsOptions): Promise<Deal[]>;
2131
- findBestDeal(ship: Ship, originLocation?: Coordinates, options?: FindDealsOptions): Promise<Deal | undefined>;
2132
- getCollectOptions(ship: Ship, arrivedAt?: Coordinates, options?: CollectAnalysisOptions): Promise<CollectAnalysis>;
2133
- }
2134
-
2135
- declare class EpochsManager extends BaseManager {
2136
- getCurrentHeight(): Promise<UInt64>;
2137
- getCurrent(): Promise<EpochInfo>;
2138
- getByHeight(height: UInt64Type): Promise<EpochInfo>;
2139
- getTimeRemaining(): Promise<number>;
2140
- getProgress(): Promise<number>;
2141
- fitsInCurrentEpoch(durationMs: number): Promise<boolean>;
2142
- }
2143
-
2144
- interface SellableCargo {
2145
- good_id: {
2146
- toNumber(): number;
2147
- } | number;
2148
- quantity: {
2149
- toNumber(): number;
2150
- } | number;
2151
- hasCargo: boolean;
2152
- }
2153
- type EntityRefInput = {
2154
- entityType: EntityTypeName;
2155
- entityId: UInt64Type;
2156
- };
2157
- declare class ActionsManager extends BaseManager {
2158
- travel(shipId: UInt64Type, destination: CoordinatesType, recharge?: boolean): Action;
2159
- grouptravel(entities: EntityRefInput[], destination: CoordinatesType, recharge?: boolean): Action;
2160
- resolve(entityId: UInt64Type, entityType?: EntityTypeName): Action;
2161
- cancel(entityId: UInt64Type, count: UInt64Type, entityType?: EntityTypeName): Action;
2162
- recharge(shipId: UInt64Type): Action;
2163
- transfer(sourceType: EntityTypeName, sourceId: UInt64Type, destType: EntityTypeName, destId: UInt64Type, goodId: UInt64Type, quantity: UInt64Type): Action;
2164
- buyGoods(entityId: UInt64Type, goodId: UInt64Type, quantity: UInt64Type, entityType?: EntityTypeName): Action;
2165
- sellGoods(entityId: UInt64Type, goodId: UInt64Type, quantity: UInt64Type, entityType?: EntityTypeName): Action;
2166
- buyShip(account: NameType, name: string): Action;
2167
- buyWarehouse(account: NameType, shipId: UInt64Type, name: string): Action;
2168
- buyContainer(account: NameType, shipId: UInt64Type, name: string): Action;
2169
- takeLoan(account: NameType, amount: UInt64Type): Action;
2170
- payLoan(account: NameType, amount: UInt64Type): Action;
2171
- foundCompany(account: NameType, name: string): Action;
2172
- join(account: NameType): Action;
2173
- extract(shipId: UInt64Type): Action;
2174
- joinGame(account: NameType, companyName: string): Action[];
2175
- sellAllCargo(ship: Ship | UInt64Type, cargo?: SellableCargo[]): Action[];
2176
- }
2177
-
2178
- declare class GameContext {
2179
- readonly client: APIClient;
2180
- readonly server: Contract$2;
2181
- readonly platform: Contract$2;
2182
- private _entities?;
2183
- private _players?;
2184
- private _locations?;
2185
- private _trades?;
2186
- private _epochs?;
2187
- private _actions?;
2188
- private _gameCache?;
2189
- private _stateCache?;
2190
- constructor(client: APIClient, server: Contract$2, platform: Contract$2);
2191
- get entities(): EntitiesManager;
2192
- get players(): PlayersManager;
2193
- get locations(): LocationsManager;
2194
- get trades(): TradesManager;
2195
- get epochs(): EpochsManager;
2196
- get actions(): ActionsManager;
2197
- getGame(reload?: boolean): Promise<Types$1.game_row>;
2198
- getState(reload?: boolean): Promise<GameState>;
2199
- get cachedGame(): Types$1.game_row | undefined;
2200
- get cachedState(): GameState | undefined;
2201
- }
2202
-
2203
- declare abstract class BaseManager {
2204
- protected readonly context: GameContext;
2205
- constructor(context: GameContext);
2206
- protected get client(): _wharfkit_antelope.APIClient;
2207
- protected get server(): _wharfkit_contract.Contract;
2208
- protected get platform(): _wharfkit_contract.Contract;
2209
- protected getGame(): Promise<Types$1.game_row>;
2210
- protected getState(): Promise<GameState>;
2211
2160
  }
2212
2161
 
2213
2162
  interface WarehouseStateInput {
@@ -2219,8 +2168,9 @@ interface WarehouseStateInput {
2219
2168
  y: number;
2220
2169
  z?: number;
2221
2170
  };
2171
+ hullmass?: number;
2222
2172
  capacity: number;
2223
- loaders: Types.loader_stats;
2173
+ modules?: PackedModuleInput[];
2224
2174
  schedule?: Types.schedule;
2225
2175
  cargo?: Types.cargo_item[];
2226
2176
  }
@@ -2236,14 +2186,24 @@ declare class Warehouse extends Types.entity_info {
2236
2186
  isUnloading(now: Date): boolean;
2237
2187
  get location(): Location;
2238
2188
  get totalCargoMass(): UInt64;
2239
- get cargoValue(): UInt64;
2240
2189
  get maxCapacity(): UInt64;
2241
2190
  get availableCapacity(): UInt64;
2242
2191
  hasSpace(goodMass: UInt64, quantity: number): boolean;
2243
2192
  get isFull(): boolean;
2244
- getCargoForGood(goodId: UInt64Type): EntityInventory | undefined;
2193
+ getCargoForItem(goodId: UInt64Type): EntityInventory | undefined;
2245
2194
  get orbitalAltitude(): number;
2195
+ get totalMass(): UInt64;
2246
2196
  }
2197
+ declare function computeWarehouseCapabilities(modules: {
2198
+ itemId: number;
2199
+ stats: bigint;
2200
+ }[]): {
2201
+ loaders?: {
2202
+ mass: number;
2203
+ thrust: number;
2204
+ quantity: number;
2205
+ };
2206
+ };
2247
2207
 
2248
2208
  interface ContainerStateInput {
2249
2209
  id: UInt64Type;
@@ -2257,6 +2217,7 @@ interface ContainerStateInput {
2257
2217
  hullmass: number;
2258
2218
  capacity: number;
2259
2219
  cargomass?: number;
2220
+ cargo?: Types.cargo_item[];
2260
2221
  schedule?: Types.schedule;
2261
2222
  }
2262
2223
  declare class Container extends Types.entity_info {
@@ -2274,6 +2235,97 @@ declare class Container extends Types.entity_info {
2274
2235
  get isFull(): boolean;
2275
2236
  get orbitalAltitude(): number;
2276
2237
  }
2238
+ declare function computeContainerCapabilities(stats: Record<string, number>): {
2239
+ hullmass: number;
2240
+ capacity: number;
2241
+ };
2242
+ declare function computeContainerT2Capabilities(stats: Record<string, number>): {
2243
+ hullmass: number;
2244
+ capacity: number;
2245
+ };
2246
+
2247
+ type SubscriptionEntityType = 'ship' | 'warehouse' | 'container';
2248
+ type EntityInstance = Ship | Warehouse | Container;
2249
+ interface SubscriptionsOptions {
2250
+ url: string;
2251
+ }
2252
+ interface BoundsSubscriptionHandle {
2253
+ readonly subId: string;
2254
+ unsubscribe(): void;
2255
+ updateBounds(bounds: BoundingBox): void;
2256
+ current: Map<number, EntityInstance>;
2257
+ }
2258
+ interface EntitySubscriptionHandle {
2259
+ readonly subId: string;
2260
+ readonly entityType: SubscriptionEntityType;
2261
+ readonly entityId: string;
2262
+ unsubscribe(): void;
2263
+ current: EntityInstance | null;
2264
+ }
2265
+ declare class SubscriptionsManager {
2266
+ private readonly conn;
2267
+ private readonly entitySubs;
2268
+ private readonly boundsSubs;
2269
+ private subCounter;
2270
+ constructor(opts: SubscriptionsOptions);
2271
+ close(): void;
2272
+ private generateSubID;
2273
+ private sendMessage;
2274
+ subscribeEntity(type: SubscriptionEntityType, id: string, onUpdate: (e: EntityInstance) => void): EntitySubscriptionHandle;
2275
+ private unsubscribeEntity;
2276
+ subscribeBounds(bounds: BoundingBox, handlers: {
2277
+ onSnapshot?: (entities: EntityInstance[]) => void;
2278
+ onUpdate?: (entity: EntityInstance) => void;
2279
+ onBoundsDelta?: (entered: EntityInstance[], exited: number[]) => void;
2280
+ owner?: string;
2281
+ prioritizeOwner?: string;
2282
+ }): BoundsSubscriptionHandle;
2283
+ private unsubscribeBounds;
2284
+ private updateBounds;
2285
+ private onMessage;
2286
+ private parseEntity;
2287
+ private handleSnapshot;
2288
+ private handleUpdate;
2289
+ private handleBoundsDelta;
2290
+ private handleError;
2291
+ }
2292
+
2293
+ declare class GameContext {
2294
+ readonly client: APIClient;
2295
+ readonly server: Contract$2;
2296
+ readonly platform: Contract$2;
2297
+ private _entities?;
2298
+ private _players?;
2299
+ private _locations?;
2300
+ private _epochs?;
2301
+ private _actions?;
2302
+ private _subscriptions?;
2303
+ private _subscriptionsUrl?;
2304
+ private _gameCache?;
2305
+ private _stateCache?;
2306
+ constructor(client: APIClient, server: Contract$2, platform: Contract$2);
2307
+ get entities(): EntitiesManager;
2308
+ get players(): PlayersManager;
2309
+ get locations(): LocationsManager;
2310
+ get epochs(): EpochsManager;
2311
+ get actions(): ActionsManager;
2312
+ setSubscriptionsUrl(url: string): void;
2313
+ get subscriptions(): SubscriptionsManager;
2314
+ getGame(reload?: boolean): Promise<Types$1.game_row>;
2315
+ getState(reload?: boolean): Promise<GameState>;
2316
+ get cachedGame(): Types$1.game_row | undefined;
2317
+ get cachedState(): GameState | undefined;
2318
+ }
2319
+
2320
+ declare abstract class BaseManager {
2321
+ protected readonly context: GameContext;
2322
+ constructor(context: GameContext);
2323
+ protected get client(): _wharfkit_antelope.APIClient;
2324
+ protected get server(): _wharfkit_contract.Contract;
2325
+ protected get platform(): _wharfkit_contract.Contract;
2326
+ protected getGame(): Promise<Types$1.game_row>;
2327
+ protected getState(): Promise<GameState>;
2328
+ }
2277
2329
 
2278
2330
  type EntityType = 'ship' | 'warehouse' | 'container' | 'location';
2279
2331
  declare class EntitiesManager extends BaseManager {
@@ -2297,6 +2349,7 @@ interface ShiploadOptions {
2297
2349
  platformContractName?: string;
2298
2350
  serverContractName?: string;
2299
2351
  client?: APIClient;
2352
+ subscriptionsUrl?: string;
2300
2353
  }
2301
2354
  interface ShiploadConstructorOptions extends ShiploadOptions {
2302
2355
  platformContract?: Contract$2;
@@ -2312,9 +2365,9 @@ declare class Shipload {
2312
2365
  get entities(): EntitiesManager;
2313
2366
  get players(): PlayersManager;
2314
2367
  get locations(): LocationsManager;
2315
- get trades(): TradesManager;
2316
2368
  get epochs(): EpochsManager;
2317
2369
  get actions(): ActionsManager;
2370
+ get subscriptions(): SubscriptionsManager;
2318
2371
  getGame(reload?: boolean): Promise<Types$1.game_row>;
2319
2372
  getState(reload?: boolean): Promise<GameState>;
2320
2373
  }
@@ -2323,118 +2376,271 @@ declare function makeShip(state: ShipStateInput): Ship;
2323
2376
  declare function makeWarehouse(state: WarehouseStateInput): Warehouse;
2324
2377
  declare function makeContainer(state: ContainerStateInput): Container;
2325
2378
 
2326
- declare const goodIds: number[];
2327
- declare function getGood(goodId: UInt16Type): Good;
2328
- declare function getGoods(): Good[];
2329
-
2330
- declare enum Rarities {
2331
- legendary = "LEGENDARY",
2332
- epic = "EPIC",
2333
- rare = "RARE",
2334
- uncommon = "UNCOMMON",
2335
- common = "COMMON",
2336
- trash = "TRASH"
2337
- }
2338
- interface Rarity {
2339
- rarity: Rarities;
2340
- minMultiplier: number;
2341
- maxMultiplier: number;
2342
- }
2343
- declare function getRarity(gameSeed: Checksum256Type, epochSeed: Checksum256Type, location: CoordinatesType, goodId: UInt16Type): Rarity;
2344
- declare function marketPrice(location: ActionParams.Type.coordinates, goodId: UInt16Type, gameSeed: Checksum256Type, state: Types.state_row): GoodPrice;
2345
- declare function marketPrices(location: ActionParams.Type.coordinates, gameSeed: Checksum256Type, state: Types.state_row): GoodPrice[];
2379
+ declare const itemIds: number[];
2380
+ declare function getItem(itemId: UInt16Type): Item;
2381
+ declare function getItems(): Item[];
2346
2382
 
2347
2383
  declare function getLocationType(gameSeed: Checksum256Type, coordinates: CoordinatesType): LocationType;
2348
- declare function isExtractableLocation(locationType: LocationType): boolean;
2384
+ declare function isGatherableLocation(locationType: LocationType): boolean;
2385
+ declare function getLocationTypeName(type: LocationType): string;
2349
2386
  declare function getSystemName(gameSeed: Checksum256Type, location: CoordinatesType): string;
2350
2387
  declare function hasSystem(gameSeed: Checksum256Type, coordinates: CoordinatesType): boolean;
2351
2388
  declare function deriveLocationStatic(gameSeed: Checksum256Type, coordinates: CoordinatesType): Types.location_static;
2352
2389
  declare function deriveLocationEpoch(epochSeed: Checksum256Type, coordinates: CoordinatesType): Types.location_epoch;
2353
2390
  declare function deriveLocation(gameSeed: Checksum256Type, epochSeed: Checksum256Type, coordinates: CoordinatesType): Types.location_derived;
2354
- declare function deriveLocationMixture(location: Types.location_derived, epochSeed: Checksum256Type): Types.mixture_info;
2355
-
2356
- declare function hash(seed: Checksum256Type, string: string): Checksum256;
2357
- declare function hash512(seed: Checksum256Type, string: string): Checksum512;
2358
2391
 
2392
+ interface StratumInfo {
2393
+ itemId: number;
2394
+ seed: bigint;
2395
+ richness: number;
2396
+ reserve: number;
2397
+ }
2398
+ interface ResourceStats {
2399
+ stat1: number;
2400
+ stat2: number;
2401
+ stat3: number;
2402
+ }
2403
+ declare function deriveStratum(epochSeed: Checksum256Type, coords: CoordinatesType, stratum: number, locationType: number, subtype: number, _maxDepth: number): StratumInfo;
2359
2404
  /**
2360
- * Trade calculation result
2361
- */
2362
- interface TradeCalculation {
2363
- maxQuantity: number;
2364
- totalCost: number;
2365
- totalMass: UInt64;
2366
- affordableQuantity: number;
2367
- spaceForQuantity: number;
2368
- }
2369
- /**
2370
- * Calculate updated weighted average cargo cost after purchase.
2371
- * Matches contract logic: (paid * owned + cost) / (owned + quantity)
2405
+ * Derives the three stat values for a raw resource from a deposit's
2406
+ * entropy seed (hash-based, weibull-transformed).
2372
2407
  *
2373
- * @param currentPaid - Current average cost per unit (from cargo.paid)
2374
- * @param currentOwned - Current owned quantity
2375
- * @param purchaseCost - Total cost of new purchase (price * quantity)
2376
- * @param purchaseQuantity - Quantity being purchased
2377
- * @returns New weighted average cost per unit
2408
+ * **Use only on deposit seeds** the bigint returned by `deriveStratum`
2409
+ * or carried on a `MassDeposit`. Do NOT call this on a cargo item's
2410
+ * `stats` field; cargo stats are bit-packed and must be read via
2411
+ * `decodeStat` (or `decodeStackStats` for category-mapped output).
2378
2412
  *
2379
- * @example
2380
- * // Owned 10 units at 100 each, buying 5 more at 120 each
2381
- * const newPaid = calculateUpdatedCargoCost(
2382
- * UInt64.from(100),
2383
- * UInt32.from(10),
2384
- * UInt64.from(600),
2385
- * UInt32.from(5)
2386
- * )
2387
- * // Result: (100*10 + 600) / (10+5) = 106.67 per unit
2388
- */
2389
- declare function calculateUpdatedCargoCost(currentPaid: UInt64, currentOwned: UInt32, purchaseCost: UInt64, purchaseQuantity: UInt32): UInt64;
2390
- /**
2391
- * Calculate the maximum quantity of a good a ship can buy
2392
- * considering both space and player balance
2393
- */
2394
- declare function calculateMaxTradeQuantity(ship: Ship, player: Player, goodPrice: GoodPrice): TradeCalculation;
2395
- /**
2396
- * Trade profit calculation result
2413
+ * Passing a cargo `stats` value here produces meaningless output
2414
+ * (hash of the packed bits, unrelated to the actual stats).
2397
2415
  */
2398
- interface TradeProfitResult {
2399
- revenue: UInt64;
2400
- cost: UInt64;
2401
- profit: Int64;
2402
- margin: number;
2416
+ declare function deriveResourceStats(seed: bigint): ResourceStats;
2417
+
2418
+ declare function deriveLocationSize(loc: Types.location_static): number;
2419
+
2420
+ declare const DEPTH_THRESHOLD_T1 = 0;
2421
+ declare const DEPTH_THRESHOLD_T2 = 2000;
2422
+ declare const DEPTH_THRESHOLD_T3 = 10000;
2423
+ declare const DEPTH_THRESHOLD_T4 = 30000;
2424
+ declare const DEPTH_THRESHOLD_T5 = 55000;
2425
+ declare const LOCATION_MIN_DEPTH = 500;
2426
+ declare const LOCATION_MAX_DEPTH = 65535;
2427
+ declare const PLANET_SUBTYPE_GAS_GIANT = 0;
2428
+ declare const PLANET_SUBTYPE_ROCKY = 1;
2429
+ declare const PLANET_SUBTYPE_TERRESTRIAL = 2;
2430
+ declare const PLANET_SUBTYPE_ICY = 3;
2431
+ declare const PLANET_SUBTYPE_OCEAN = 4;
2432
+ declare const PLANET_SUBTYPE_INDUSTRIAL = 5;
2433
+ declare function getDepthThreshold(tier: number): number;
2434
+ declare function getResourceTier(itemId: number): number;
2435
+ declare function getResourceWeight(itemId: number, stratum: number): number;
2436
+ declare function getLocationCandidates(locationType: number, subtype: number): number[];
2437
+ declare function getEligibleResources(locationType: number, subtype: number, stratum: number): number[];
2438
+
2439
+ type ReserveTier = 'small' | 'medium' | 'large' | 'massive' | 'motherlode';
2440
+ interface TierRange {
2441
+ min: number;
2442
+ max: number;
2443
+ }
2444
+ declare const RESERVE_TIERS: Record<ReserveTier, TierRange>;
2445
+ declare const TIER_ROLL_MAX = 65536;
2446
+ declare function rollTier(tierRoll: number, stratum: number): ReserveTier;
2447
+ declare function rollWithinTier(withinRoll: number, range: TierRange): number;
2448
+
2449
+ interface StatDefinition {
2450
+ key: string;
2451
+ label: string;
2452
+ abbreviation: string;
2453
+ purpose: string;
2454
+ inverted?: boolean;
2455
+ }
2456
+ declare function getStatDefinitions(category: ResourceCategory): StatDefinition[];
2457
+ declare function getStatName(category: ResourceCategory, index: 0 | 1 | 2): StatDefinition;
2458
+ interface NamedStats {
2459
+ definitions: StatDefinition[];
2460
+ values: [number, number, number];
2461
+ }
2462
+ declare function resolveStats(category: ResourceCategory, stats: {
2463
+ stat1: number;
2464
+ stat2: number;
2465
+ stat3: number;
2466
+ }): NamedStats;
2467
+
2468
+ interface StackInput {
2469
+ quantity: number;
2470
+ stats: Record<string, number>;
2471
+ }
2472
+ interface CategoryStacks {
2473
+ category: ResourceCategory;
2474
+ stacks: StackInput[];
2475
+ }
2476
+ declare function encodeStats(values: number[]): bigint;
2477
+ declare function decodeStat(stats: bigint, index: number): number;
2478
+ declare function decodeStats(stats: bigint, count: number): number[];
2479
+ declare function decodeCraftedItemStats(itemId: number, stats: bigint): Record<string, number>;
2480
+ declare function blendStacks(stacks: StackInput[], statKey: string): number;
2481
+ declare function blendComponentStacks(stacks: {
2482
+ quantity: number;
2483
+ stats: Record<string, number>;
2484
+ }[]): Record<string, number>;
2485
+ declare function computeComponentStats(componentId: number, categoryStacks: CategoryStacks[]): {
2486
+ key: string;
2487
+ value: number;
2488
+ }[];
2489
+ declare function computeEntityStats(entityItemIdOrLegacyId: number | string, componentStacks: Record<number, {
2490
+ quantity: number;
2491
+ stats: Record<string, number>;
2492
+ }[]>): {
2493
+ key: string;
2494
+ value: number;
2495
+ }[];
2496
+ declare function computeInputMass(itemId: number): number;
2497
+ declare function blendCrossGroup(sources: {
2498
+ value: number;
2499
+ weight: number;
2500
+ }[]): number;
2501
+ declare function blendCargoStacks(itemId: number, stacks: {
2502
+ quantity: number;
2503
+ stats: UInt64;
2504
+ }[]): UInt64;
2505
+ interface RecipeSlotInput {
2506
+ itemId: number;
2507
+ category: ResourceCategory | undefined;
2508
+ stacks: {
2509
+ quantity: number;
2510
+ stats: bigint;
2511
+ }[];
2403
2512
  }
2513
+ declare function computeCraftedOutputStats(outputItemId: number, slotInputs: RecipeSlotInput[]): UInt64;
2404
2514
  /**
2405
- * Calculate profit for a trade route
2406
- */
2407
- declare function calculateTradeProfit(quantity: UInt32Type, buyPrice: UInt32Type, sellPrice: UInt32Type): TradeProfitResult;
2408
- /**
2409
- * Calculate profit per unit of mass
2410
- */
2411
- declare function calculateProfitPerMass(quantity: number, buyPrice: number, sellPrice: number, massPerUnit: number): number;
2412
- /**
2413
- * Calculate profit per second for a trade route
2515
+ * Mirrors the contract's gather-time transform. Takes a deposit's entropy
2516
+ * seed (bigint from deriveStratum), derives stats via weibull hashing, and
2517
+ * returns a UInt64 whose bit-packed form matches what the contract writes
2518
+ * to cargo_item.stats on gather.
2519
+ *
2520
+ * Use this whenever off-chain code simulates a gather (testmap, player
2521
+ * scanners that project cargo outcomes) and needs a value that matches
2522
+ * what on-chain cargo would carry.
2414
2523
  */
2415
- declare function calculateProfitPerSecond(profit: Int64Type, travelTimeSeconds: UInt32Type): number;
2524
+ declare function encodeGatheredCargoStats(depositSeed: bigint): UInt64;
2525
+
2526
+ declare function hash(seed: Checksum256Type, string: string): Checksum256;
2527
+ declare function hash512(seed: Checksum256Type, string: string): Checksum512;
2528
+
2416
2529
  /**
2417
- * Find the best good to trade between two locations
2530
+ * Travel calculations for ship movement, energy usage, and flight times.
2531
+ *
2532
+ * Functions prefixed with `calc_` are contract-parity functions that mirror
2533
+ * the C++ implementation in the server contract (schedule.cpp, ship.cpp).
2534
+ * These use snake_case intentionally to match the contract naming convention
2535
+ * and signal that they must produce identical results to the on-chain code.
2536
+ *
2537
+ * Functions prefixed with `calculate` are higher-level SDK helpers that may
2538
+ * combine multiple contract calculations for convenience.
2418
2539
  */
2419
- declare function findBestGoodToTrade(ship: Ship, player: Player, originPrices: GoodPrice[], destPrices: GoodPrice[], travelTimeSeconds: UInt32Type): {
2420
- good: GoodPrice;
2540
+
2541
+ declare function calc_orbital_altitude(mass: number): number;
2542
+ declare function distanceBetweenCoordinates(origin: ActionParams.Type.coordinates, destination: ActionParams.Type.coordinates): UInt64;
2543
+ declare function distanceBetweenPoints(x1: Int64Type, y1: Int64Type, x2: Int64Type, y2: Int64Type): UInt64;
2544
+ declare function lerp(origin: ActionParams.Type.coordinates, destination: ActionParams.Type.coordinates, time: number): ActionParams.Type.coordinates;
2545
+ declare function rotation(origin: ActionParams.Type.coordinates, destination: ActionParams.Type.coordinates): number;
2546
+ declare function findNearbyPlanets(seed: Checksum256, origin: ActionParams.Type.coordinates, maxDistance?: UInt64Type): Distance[];
2547
+ declare function calc_rechargetime(capacity: UInt32Type, energy: UInt32Type, recharge: UInt32Type): UInt32;
2548
+ declare function calc_ship_rechargetime(ship: ShipLike): UInt32;
2549
+ declare function calc_flighttime(distance: UInt64Type, acceleration: number): UInt32;
2550
+ declare function calc_loader_flighttime(ship: ShipLike, mass: UInt64, altitude?: number): UInt32;
2551
+ declare function calc_loader_acceleration(ship: ShipLike, mass: UInt64): number;
2552
+ declare function calc_ship_flighttime(ship: ShipLike, mass: UInt64, distance: UInt64): UInt32;
2553
+ declare function calc_ship_acceleration(ship: ShipLike, mass: UInt64): number;
2554
+ declare function calc_acceleration(thrust: number, mass: number): number;
2555
+ declare function calc_ship_mass(ship: ShipLike, cargos: CargoMassInfo[]): UInt64;
2556
+ declare function calc_energyusage(distance: UInt64Type, drain: UInt32Type): UInt32;
2557
+ declare function calculateTransferTime(ship: ShipLike, cargos: CargoMassInfo[], quantities?: Map<number, number>): UInt32;
2558
+ declare function calculateRefuelingTime(ship: ShipLike): UInt32;
2559
+ declare function calculateFlightTime(ship: ShipLike, cargos: CargoMassInfo[], distance: UInt64Type): UInt32;
2560
+ interface LoadTimeBreakdown {
2561
+ unloadTime: number;
2562
+ loadTime: number;
2563
+ totalTime: number;
2564
+ unloadMass: number;
2565
+ loadMass: number;
2566
+ }
2567
+ declare function calculateLoadTimeBreakdown(ship: ShipLike, cargos: CargoMassInfo[], loadQuantities?: Map<number, number>, unloadQuantities?: Map<number, number>): LoadTimeBreakdown;
2568
+ interface EstimatedTravelTime {
2569
+ flightTime: UInt32;
2570
+ rechargeTime: UInt32;
2571
+ loadTime: UInt32;
2572
+ unloadTime: UInt32;
2573
+ total: UInt32;
2574
+ }
2575
+ interface EstimateTravelTimeOptions {
2576
+ needsRecharge?: boolean;
2577
+ loadMass?: UInt32Type;
2578
+ unloadMass?: UInt32Type;
2579
+ }
2580
+ declare function estimateTravelTime(ship: ShipLike, travelMass: UInt64Type, distance: UInt64Type, options?: EstimateTravelTimeOptions): EstimatedTravelTime;
2581
+ declare function estimateDealTravelTime(ship: ShipLike, shipMass: UInt64Type, distance: UInt64Type, loadMass: UInt32Type): UInt32;
2582
+ declare function hasEnergyForDistance(ship: ShipLike, distance: UInt64Type): boolean;
2583
+ interface TransferEntity {
2584
+ location: {
2585
+ z?: {
2586
+ toNumber(): number;
2587
+ } | number;
2588
+ };
2589
+ loaders?: {
2590
+ thrust: {
2591
+ toNumber(): number;
2592
+ } | number;
2593
+ mass: {
2594
+ toNumber(): number;
2595
+ } | number;
2596
+ quantity: {
2597
+ toNumber(): number;
2598
+ } | number;
2599
+ };
2600
+ }
2601
+ interface HasScheduleAndLocation {
2602
+ coordinates: ActionParams.Type.coordinates;
2603
+ schedule?: Types.schedule;
2604
+ }
2605
+ declare function getFlightOrigin(entity: HasScheduleAndLocation, flightTaskIndex: number): ActionParams.Type.coordinates;
2606
+ declare function getDestinationLocation(entity: HasScheduleAndLocation): ActionParams.Type.coordinates | undefined;
2607
+ declare function getPositionAt(entity: HasScheduleAndLocation, taskIndex: number, taskProgress: number): ActionParams.Type.coordinates;
2608
+ declare function calc_transfer_duration(source: TransferEntity, dest: TransferEntity, cargoMass: number): number;
2609
+
2610
+ interface CargoData {
2611
+ cargo: EntityInventory[];
2612
+ }
2613
+ declare function totalCargoMass(cargo: EntityInventory[]): UInt64;
2614
+ declare function getCargoForItem(cargo: EntityInventory[], goodId: UInt64Type): EntityInventory | undefined;
2615
+ declare function hasSpace(currentMass: UInt64, maxCapacity: UInt64, goodMass: UInt64, quantity: number): boolean;
2616
+ declare function availableCapacity(currentMass: UInt64, maxCapacity: UInt64): UInt64;
2617
+ declare function isFull(currentMass: UInt64, maxCapacity: UInt64): boolean;
2618
+ declare function afterRemoveItems(cargo: Types.cargo_item[], goodsToRemove: Array<{
2619
+ goodId: number;
2421
2620
  quantity: number;
2422
- profit: number;
2423
- profitPerSecond: number;
2424
- margin: number;
2425
- } | null;
2426
- /**
2427
- * Calculate break-even price for selling cargo
2428
- */
2429
- declare function calculateBreakEvenPrice(costPaid: number, quantity: number): number;
2430
- /**
2431
- * Check if a trade is profitable
2432
- */
2433
- declare function isProfitable(buyPrice: UInt32Type, sellPrice: UInt32Type): boolean;
2434
- /**
2435
- * Calculate return on investment percentage
2436
- */
2437
- declare function calculateROI(cost: number, profit: number): number;
2621
+ }>): EntityInventory[];
2622
+ declare function afterRemoveAllItems(cargo: Types.cargo_item[]): EntityInventory[];
2623
+
2624
+ type cargoUtils_CargoData = CargoData;
2625
+ declare const cargoUtils_totalCargoMass: typeof totalCargoMass;
2626
+ declare const cargoUtils_getCargoForItem: typeof getCargoForItem;
2627
+ declare const cargoUtils_hasSpace: typeof hasSpace;
2628
+ declare const cargoUtils_availableCapacity: typeof availableCapacity;
2629
+ declare const cargoUtils_isFull: typeof isFull;
2630
+ declare const cargoUtils_afterRemoveItems: typeof afterRemoveItems;
2631
+ declare const cargoUtils_afterRemoveAllItems: typeof afterRemoveAllItems;
2632
+ declare namespace cargoUtils {
2633
+ export {
2634
+ cargoUtils_CargoData as CargoData,
2635
+ cargoUtils_totalCargoMass as totalCargoMass,
2636
+ cargoUtils_getCargoForItem as getCargoForItem,
2637
+ cargoUtils_hasSpace as hasSpace,
2638
+ cargoUtils_availableCapacity as availableCapacity,
2639
+ cargoUtils_isFull as isFull,
2640
+ cargoUtils_afterRemoveItems as afterRemoveItems,
2641
+ cargoUtils_afterRemoveAllItems as afterRemoveAllItems,
2642
+ };
2643
+ }
2438
2644
 
2439
2645
  interface Entity {
2440
2646
  id: UInt64;
@@ -2443,11 +2649,10 @@ interface Entity {
2443
2649
  entity_name: string;
2444
2650
  location: Coordinates | Types.coordinates;
2445
2651
  }
2446
- type ShipEntity = Entity & MovementCapability & EnergyCapability & StorageCapability & LoaderCapability & MassCapability & ScheduleCapability & {
2447
- trade?: Types.trade_stats;
2448
- extractor?: Types.extractor_stats;
2652
+ type ShipEntity = Entity & Partial<MovementCapability> & Partial<EnergyCapability> & StorageCapability & Partial<LoaderCapability> & MassCapability & ScheduleCapability & {
2653
+ gatherer?: Types.gatherer_stats;
2449
2654
  };
2450
- type WarehouseEntity = Entity & StorageCapability & LoaderCapability & ScheduleCapability;
2655
+ type WarehouseEntity = Entity & StorageCapability & Partial<LoaderCapability> & MassCapability & ScheduleCapability;
2451
2656
  type ContainerEntity = Entity & StorageCapability & MassCapability & ScheduleCapability;
2452
2657
  type AnyEntity = ShipEntity | WarehouseEntity | ContainerEntity;
2453
2658
 
@@ -2455,10 +2660,9 @@ declare function canMove(e: Entity): e is Entity & MovementCapability & EnergyCa
2455
2660
  declare function hasEnergy(e: Entity): e is Entity & EnergyCapability;
2456
2661
  declare function hasStorage(e: Entity): e is Entity & StorageCapability;
2457
2662
  declare function hasLoaders(e: Entity): e is Entity & LoaderCapability;
2458
- declare function hasTrade(e: Entity): e is Entity & TradeCapability;
2459
2663
  declare function hasMass(e: Entity): e is Entity & MassCapability;
2460
2664
  declare function hasSchedule(e: Entity): e is Entity & ScheduleCapability;
2461
- declare function hasExtractor(e: Entity): e is Entity & ExtractorCapability;
2665
+ declare function hasGatherer(e: Entity): e is Entity & GathererCapability;
2462
2666
 
2463
2667
  declare function maxTravelDistance(entity: MovementCapability): UInt32;
2464
2668
  declare function calcEnergyUsage(entity: MovementCapability, distance: UInt64): UInt64;
@@ -2467,8 +2671,408 @@ declare function needsRecharge(entity: MovementCapability & EnergyCapability): b
2467
2671
 
2468
2672
  declare function calcLoadDuration(entity: LoaderCapability, cargoMass: UInt64): UInt32;
2469
2673
 
2470
- declare function calc_extraction_duration(extractor: Types.extractor_stats, loaders: Types.loader_stats, shipZ: number, batchMass: number): UInt32;
2471
- declare function calc_extraction_energy(extractor: Types.extractor_stats, duration: number): UInt16;
2674
+ declare function calc_gather_duration(gatherer: Types.gatherer_stats, itemMass: number, quantity: number, stratum: number, richness: number): UInt32;
2675
+ declare function calc_gather_energy(gatherer: Types.gatherer_stats, duration: number): UInt16;
2676
+
2677
+ interface CrafterCapability {
2678
+ crafter: Types.crafter_stats;
2679
+ }
2680
+ declare function capsHasCrafter(caps: EntityCapabilities): boolean;
2681
+ declare function calc_craft_duration(speed: number, totalInputMass: number): UInt32;
2682
+ declare function calc_craft_energy(drain: number, totalInputMass: number): UInt16;
2683
+
2684
+ declare const MODULE_ANY = 0;
2685
+ declare const MODULE_ENGINE = 1;
2686
+ declare const MODULE_GENERATOR = 2;
2687
+ declare const MODULE_GATHERER = 3;
2688
+ declare const MODULE_LOADER = 4;
2689
+ declare const MODULE_WARP = 5;
2690
+ declare const MODULE_CRAFTER = 6;
2691
+ declare const MODULE_LAUNCHER = 7;
2692
+ declare const MODULE_STORAGE = 8;
2693
+ declare const MODULE_HAULER = 9;
2694
+ interface PackedModule {
2695
+ itemId: number;
2696
+ stats: bigint;
2697
+ }
2698
+ interface ModuleEntry {
2699
+ type: number;
2700
+ installed?: PackedModule;
2701
+ }
2702
+ declare function moduleAccepts(slotType: number, moduleType: number): boolean;
2703
+ declare function getModuleCapabilityType(itemId: number): number;
2704
+ declare function isModuleItem(itemId: number): boolean;
2705
+ declare function moduleSlotTypeToCode(slotType: string): number;
2706
+
2707
+ declare function computeHaulPenalty(totalThrust: number, haulCount: number, avgEfficiency: number): number;
2708
+ declare function computeHaulerDrain(distance: number, drain: number, haulCount: number): number;
2709
+
2710
+ declare const categoryColors: Record<ResourceCategory, string>;
2711
+ declare const tierColors: Record<ResourceTier, string>;
2712
+ declare const tierLabels: Record<ResourceTier, string>;
2713
+ declare const categoryIcons: Record<ResourceCategory, string>;
2714
+ type CategoryIconShape = 'hex' | 'diamond' | 'star' | 'circle' | 'square';
2715
+ declare const categoryIconShapes: Record<ResourceCategory, CategoryIconShape>;
2716
+ declare const componentIcon = "\u25A3";
2717
+ declare const moduleIcon = "\u2B22";
2718
+ declare const itemAbbreviations: Record<number, string>;
2719
+
2720
+ type CraftedItemCategory = 'component' | 'module' | 'entity' | 'resource';
2721
+ declare const ITEM_TYPE_RESOURCE = 0;
2722
+ declare const ITEM_TYPE_COMPONENT = 1;
2723
+ declare const ITEM_TYPE_MODULE = 2;
2724
+ declare const ITEM_TYPE_ENTITY = 3;
2725
+ declare function itemTypeCode(id: number): number;
2726
+ declare function itemTier(id: number): number;
2727
+ declare function itemOffset(id: number): number;
2728
+ declare function itemCategory(id: number): CraftedItemCategory;
2729
+ declare function isRelatedItem(a: number, b: number): boolean;
2730
+ declare function isCraftedItem(id: number): boolean;
2731
+
2732
+ interface CategoryInfo {
2733
+ id: ResourceCategory;
2734
+ name: string;
2735
+ label: string;
2736
+ description: string;
2737
+ color: string;
2738
+ }
2739
+ declare function getCategoryInfo(): CategoryInfo[];
2740
+ declare function getCategoryInfo(id: ResourceCategory): CategoryInfo | undefined;
2741
+
2742
+ interface PlanetSubtypeInfo {
2743
+ id: number;
2744
+ label: string;
2745
+ description: string;
2746
+ paletteType: string;
2747
+ }
2748
+ declare function getPlanetSubtypes(): PlanetSubtypeInfo[];
2749
+ declare function getPlanetSubtype(id: number): PlanetSubtypeInfo | undefined;
2750
+
2751
+ interface CapabilityAttribute {
2752
+ capability: string;
2753
+ attribute: string;
2754
+ description: string;
2755
+ }
2756
+ interface StatMapping {
2757
+ stat: string;
2758
+ capability: string;
2759
+ attribute: string;
2760
+ rationale: string;
2761
+ }
2762
+ declare const capabilityNames: string[];
2763
+ declare const capabilityAttributes: CapabilityAttribute[];
2764
+ declare const statMappings: StatMapping[];
2765
+ declare function isInvertedAttribute(attribute: string): boolean;
2766
+ declare function getCapabilityAttributes(capability?: string): CapabilityAttribute[];
2767
+ declare function getStatMappings(): StatMapping[];
2768
+ declare function getStatMappingsForStat(stat: string): StatMapping[];
2769
+ declare function getStatMappingsForCapability(capability: string): StatMapping[];
2770
+
2771
+ declare function computeShipHullCapabilities(stats: Record<string, number>): {
2772
+ hullmass: number;
2773
+ capacity: number;
2774
+ };
2775
+ declare function computeEngineCapabilities(stats: Record<string, number>): {
2776
+ thrust: number;
2777
+ drain: number;
2778
+ };
2779
+ declare function computeGeneratorCapabilities(stats: Record<string, number>): {
2780
+ capacity: number;
2781
+ recharge: number;
2782
+ };
2783
+ declare function computeGathererCapabilities(stats: Record<string, number>): {
2784
+ yield: number;
2785
+ drain: number;
2786
+ depth: number;
2787
+ speed: number;
2788
+ };
2789
+ declare function computeLoaderCapabilities(stats: Record<string, number>): {
2790
+ mass: number;
2791
+ thrust: number;
2792
+ quantity: number;
2793
+ };
2794
+ declare function computeCrafterCapabilities(stats: Record<string, number>): {
2795
+ speed: number;
2796
+ drain: number;
2797
+ };
2798
+ declare function computeHaulerCapabilities(stats: Record<string, number>): {
2799
+ capacity: number;
2800
+ efficiency: number;
2801
+ drain: number;
2802
+ };
2803
+ declare function computeStorageCapabilities(stats: Record<string, number>, baseCapacity: number): {
2804
+ capacityBonus: number;
2805
+ };
2806
+ declare function computeWarehouseHullCapabilities(stats: Record<string, number>): {
2807
+ hullmass: number;
2808
+ capacity: number;
2809
+ };
2810
+ interface ShipCapabilities {
2811
+ engines?: {
2812
+ thrust: number;
2813
+ drain: number;
2814
+ };
2815
+ generator?: {
2816
+ capacity: number;
2817
+ recharge: number;
2818
+ };
2819
+ gatherer?: {
2820
+ yield: number;
2821
+ drain: number;
2822
+ depth: number;
2823
+ speed: number;
2824
+ };
2825
+ hauler?: {
2826
+ capacity: number;
2827
+ efficiency: number;
2828
+ drain: number;
2829
+ };
2830
+ loaders?: {
2831
+ mass: number;
2832
+ thrust: number;
2833
+ quantity: number;
2834
+ };
2835
+ crafter?: {
2836
+ speed: number;
2837
+ drain: number;
2838
+ };
2839
+ }
2840
+ declare function computeShipCapabilities(modules: {
2841
+ itemId: number;
2842
+ stats: bigint;
2843
+ }[]): ShipCapabilities;
2844
+
2845
+ interface ResolvedItemStat {
2846
+ key: string;
2847
+ label: string;
2848
+ abbreviation: string;
2849
+ value: number;
2850
+ color: string;
2851
+ category?: ResourceCategory;
2852
+ inverted?: boolean;
2853
+ }
2854
+ interface ResolvedAttributeGroup {
2855
+ capability: string;
2856
+ attributes: {
2857
+ label: string;
2858
+ value: number;
2859
+ }[];
2860
+ }
2861
+ type ResolvedItemType = 'resource' | 'component' | 'module' | 'entity';
2862
+ interface ResolvedModuleSlot {
2863
+ name?: string;
2864
+ installed: boolean;
2865
+ attributes?: {
2866
+ label: string;
2867
+ value: number;
2868
+ }[];
2869
+ }
2870
+ interface ResolvedItem {
2871
+ itemId: number;
2872
+ name: string;
2873
+ icon: string;
2874
+ abbreviation: string | null;
2875
+ category?: ResourceCategory;
2876
+ tier: number;
2877
+ mass: number;
2878
+ itemType: ResolvedItemType;
2879
+ stats?: ResolvedItemStat[];
2880
+ attributes?: ResolvedAttributeGroup[];
2881
+ moduleSlots?: ResolvedModuleSlot[];
2882
+ }
2883
+ declare function resolveItem(itemId: UInt16Type, stats?: UInt64Type, modules?: Types.module_entry[]): ResolvedItem;
2884
+
2885
+ interface TextSpan {
2886
+ text: string;
2887
+ highlight?: boolean;
2888
+ }
2889
+ interface CapabilityInput {
2890
+ capability: string;
2891
+ attributes: {
2892
+ label: string;
2893
+ value: number;
2894
+ }[];
2895
+ }
2896
+ interface ModuleDescription {
2897
+ id: string;
2898
+ template: string;
2899
+ params: Readonly<Record<string, number | string>>;
2900
+ highlightKeys: readonly string[];
2901
+ }
2902
+ interface RenderDescriptionOptions {
2903
+ translate?: (id: string, fallback: string) => string;
2904
+ formatNumber?: (n: number) => string;
2905
+ }
2906
+ declare function describeModule(input: CapabilityInput): ModuleDescription | null;
2907
+ declare function describeModuleForItem(resolved: ResolvedItem): ModuleDescription | null;
2908
+ declare function describeModuleForSlot(slot: ResolvedModuleSlot): ModuleDescription | null;
2909
+ declare function renderDescription(desc: ModuleDescription, options?: RenderDescriptionOptions): TextSpan[];
2910
+
2911
+ interface NFTInstalledModule {
2912
+ item_id: number;
2913
+ stats: string;
2914
+ }
2915
+ interface NFTModuleSlot {
2916
+ type: number;
2917
+ installed?: NFTInstalledModule;
2918
+ }
2919
+ interface NFTCargoItem {
2920
+ item_id: number;
2921
+ quantity: number;
2922
+ stats: string;
2923
+ modules?: NFTModuleSlot[];
2924
+ }
2925
+ interface NFTCommonBase {
2926
+ quantity: number;
2927
+ stats: string;
2928
+ origin_x: string;
2929
+ origin_y: string;
2930
+ }
2931
+ declare function readCommonBase(data: Record<string, any>): NFTCommonBase;
2932
+ declare function deserializeScalar(data: Record<string, any>, itemId: number): NFTCargoItem;
2933
+ declare const deserializeResource: typeof deserializeScalar;
2934
+ declare const deserializeComponent: typeof deserializeScalar;
2935
+ declare const deserializeModule: typeof deserializeScalar;
2936
+ declare function deserializeEntity(data: Record<string, any>, itemId: number): NFTCargoItem;
2937
+ declare function deserializeAsset(data: Record<string, any>, itemId: number): NFTCargoItem;
2938
+
2939
+ declare function computeBaseHullmass(stats: bigint): number;
2940
+ declare function computeBaseCapacityShip(stats: bigint): number;
2941
+ declare function computeBaseCapacityWarehouse(stats: bigint): number;
2942
+ declare const computeEngineThrust: (vol: number) => number;
2943
+ declare const computeEngineDrain: (thm: number) => number;
2944
+ declare const computeGeneratorCap: (res: number) => number;
2945
+ declare const computeGeneratorRech: (ref: number) => number;
2946
+ declare const computeGathererYield: (str: number) => number;
2947
+ declare const computeGathererDrain: (con: number) => number;
2948
+ declare const computeGathererDepth: (tol: number) => number;
2949
+ declare const computeGathererSpeed: (ref: number) => number;
2950
+ declare const computeLoaderMass: (fin: number) => number;
2951
+ declare const computeLoaderThrust: (pla: number) => number;
2952
+ declare const computeCrafterSpeed: (rea: number) => number;
2953
+ declare const computeCrafterDrain: (com: number) => number;
2954
+ declare function entityDisplayName(itemId: number): string;
2955
+ declare function moduleDisplayName(itemId: number): string;
2956
+ declare function formatModuleLine(slot: number, itemId: number, stats: bigint): string;
2957
+ declare function buildEntityDescription(itemId: number, hullStats: bigint, moduleItems: number[], moduleStats: bigint[]): string;
2958
+
2959
+ type index_NFTInstalledModule = NFTInstalledModule;
2960
+ type index_NFTModuleSlot = NFTModuleSlot;
2961
+ type index_NFTCargoItem = NFTCargoItem;
2962
+ type index_NFTCommonBase = NFTCommonBase;
2963
+ declare const index_readCommonBase: typeof readCommonBase;
2964
+ declare const index_deserializeScalar: typeof deserializeScalar;
2965
+ declare const index_deserializeResource: typeof deserializeResource;
2966
+ declare const index_deserializeComponent: typeof deserializeComponent;
2967
+ declare const index_deserializeModule: typeof deserializeModule;
2968
+ declare const index_deserializeEntity: typeof deserializeEntity;
2969
+ declare const index_deserializeAsset: typeof deserializeAsset;
2970
+ declare const index_computeBaseHullmass: typeof computeBaseHullmass;
2971
+ declare const index_computeBaseCapacityShip: typeof computeBaseCapacityShip;
2972
+ declare const index_computeBaseCapacityWarehouse: typeof computeBaseCapacityWarehouse;
2973
+ declare const index_computeEngineThrust: typeof computeEngineThrust;
2974
+ declare const index_computeEngineDrain: typeof computeEngineDrain;
2975
+ declare const index_computeGeneratorCap: typeof computeGeneratorCap;
2976
+ declare const index_computeGeneratorRech: typeof computeGeneratorRech;
2977
+ declare const index_computeGathererYield: typeof computeGathererYield;
2978
+ declare const index_computeGathererDrain: typeof computeGathererDrain;
2979
+ declare const index_computeGathererDepth: typeof computeGathererDepth;
2980
+ declare const index_computeGathererSpeed: typeof computeGathererSpeed;
2981
+ declare const index_computeLoaderMass: typeof computeLoaderMass;
2982
+ declare const index_computeLoaderThrust: typeof computeLoaderThrust;
2983
+ declare const index_computeCrafterSpeed: typeof computeCrafterSpeed;
2984
+ declare const index_computeCrafterDrain: typeof computeCrafterDrain;
2985
+ declare const index_entityDisplayName: typeof entityDisplayName;
2986
+ declare const index_moduleDisplayName: typeof moduleDisplayName;
2987
+ declare const index_formatModuleLine: typeof formatModuleLine;
2988
+ declare const index_buildEntityDescription: typeof buildEntityDescription;
2989
+ declare namespace index {
2990
+ export {
2991
+ index_NFTInstalledModule as NFTInstalledModule,
2992
+ index_NFTModuleSlot as NFTModuleSlot,
2993
+ index_NFTCargoItem as NFTCargoItem,
2994
+ index_NFTCommonBase as NFTCommonBase,
2995
+ index_readCommonBase as readCommonBase,
2996
+ index_deserializeScalar as deserializeScalar,
2997
+ index_deserializeResource as deserializeResource,
2998
+ index_deserializeComponent as deserializeComponent,
2999
+ index_deserializeModule as deserializeModule,
3000
+ index_deserializeEntity as deserializeEntity,
3001
+ index_deserializeAsset as deserializeAsset,
3002
+ index_computeBaseHullmass as computeBaseHullmass,
3003
+ index_computeBaseCapacityShip as computeBaseCapacityShip,
3004
+ index_computeBaseCapacityWarehouse as computeBaseCapacityWarehouse,
3005
+ index_computeEngineThrust as computeEngineThrust,
3006
+ index_computeEngineDrain as computeEngineDrain,
3007
+ index_computeGeneratorCap as computeGeneratorCap,
3008
+ index_computeGeneratorRech as computeGeneratorRech,
3009
+ index_computeGathererYield as computeGathererYield,
3010
+ index_computeGathererDrain as computeGathererDrain,
3011
+ index_computeGathererDepth as computeGathererDepth,
3012
+ index_computeGathererSpeed as computeGathererSpeed,
3013
+ index_computeLoaderMass as computeLoaderMass,
3014
+ index_computeLoaderThrust as computeLoaderThrust,
3015
+ index_computeCrafterSpeed as computeCrafterSpeed,
3016
+ index_computeCrafterDrain as computeCrafterDrain,
3017
+ index_entityDisplayName as entityDisplayName,
3018
+ index_moduleDisplayName as moduleDisplayName,
3019
+ index_formatModuleLine as formatModuleLine,
3020
+ index_buildEntityDescription as buildEntityDescription,
3021
+ };
3022
+ }
3023
+
3024
+ declare function formatMass(kg: number): string;
3025
+ declare function formatMassDelta(kg: number): string;
3026
+
3027
+ interface DisplayNameInput {
3028
+ itemType: 'resource' | 'component' | 'module' | 'entity' | string;
3029
+ tier: number | string;
3030
+ category?: ResourceCategory;
3031
+ name: string;
3032
+ }
3033
+ declare function displayName(resolved: DisplayNameInput): string;
3034
+ interface DescribeOptions {
3035
+ translate?: (key: string) => string;
3036
+ formatNumber?: (n: number) => string;
3037
+ formatMass?: (kg: number) => string;
3038
+ }
3039
+ declare function describeItem(resolved: ResolvedItem, opts?: DescribeOptions): string;
3040
+
3041
+ type ConnectionState = 'disconnected' | 'connecting' | 'connected' | 'reconnecting';
3042
+ interface WebSocketConnectionOptions {
3043
+ url: string;
3044
+ onMessage: (message: ServerMessage) => void;
3045
+ onStateChange?: (state: ConnectionState) => void;
3046
+ }
3047
+ declare class WebSocketConnection {
3048
+ private ws;
3049
+ private url;
3050
+ private onMessage;
3051
+ private onStateChange?;
3052
+ private reconnectAttempts;
3053
+ private reconnectTimeout;
3054
+ private _state;
3055
+ private shouldReconnect;
3056
+ private sendQueue;
3057
+ private static readonly MIN_RECONNECT_DELAY;
3058
+ private static readonly MAX_RECONNECT_DELAY;
3059
+ private static readonly RECONNECT_MULTIPLIER;
3060
+ constructor(options: WebSocketConnectionOptions);
3061
+ get state(): ConnectionState;
3062
+ private setState;
3063
+ connect(): void;
3064
+ private scheduleReconnect;
3065
+ disconnect(): void;
3066
+ close(): void;
3067
+ send(message: ClientMessage): void;
3068
+ get isConnected(): boolean;
3069
+ }
3070
+
3071
+ declare function mapEntity(ei: Types.entity_info): Ship | Warehouse | Container;
3072
+ declare function parseWireEntity(raw: WireEntity): Types.entity_info;
3073
+
3074
+ declare function setSubscriptionsDebug(on: boolean): void;
3075
+ declare function isSubscriptionsDebugEnabled(): boolean;
2472
3076
 
2473
3077
  type movement_stats = Types.movement_stats;
2474
3078
  type energy_stats = Types.energy_stats;
@@ -2477,12 +3081,10 @@ type task = Types.task;
2477
3081
  type cargo_item = Types.cargo_item;
2478
3082
  type warehouse_row = Types.warehouse_row;
2479
3083
  type container_row = Types.container_row;
2480
- type extractor_stats = Types.extractor_stats;
2481
- type mixture_info = Types.mixture_info;
2482
- type mixture_component = Types.mixture_component;
3084
+ type gatherer_stats = Types.gatherer_stats;
2483
3085
  type location_static = Types.location_static;
2484
3086
  type location_epoch = Types.location_epoch;
2485
3087
  type location_derived = Types.location_derived;
2486
3088
  type location_row = Types.location_row;
2487
3089
 
2488
- 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, Deal, DiscountedGoodInfo, 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, GOOD_DOES_NOT_EXIST, GOOD_NOT_AVAILABLE_AT_LOCATION, GameState, Good, GoodPrice, 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_GOOD_QUANTITY, INSUFFICIENT_GOOD_SUPPLY, INVALID_AMOUNT, InventoryAccessor, LoadTimeBreakdown, LoaderCapability, Location, LocationType, LocationsManager, MAX_ORBITAL_ALTITUDE, MIN_ORBITAL_ALTITUDE, MassCapability, MovementCapability, 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, ScheduleAccessor, ScheduleCapability, ScheduleData, Scheduleable, server as ServerContract, Ship, ShipEntity, ShipLike, ShipStateInput, Shipload, StorageCapability, 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, deriveLocation, deriveLocationEpoch, deriveLocationMixture, deriveLocationStatic, distanceBetweenCoordinates, distanceBetweenPoints, energyPercent, energy_stats, estimateDealTravelTime, estimateTravelTime, extractor_stats, findBestDeal, findBestGoodToTrade, findDealsForShip, findNearbyPlanets, getCurrentEpoch, getDestinationLocation, getEpochInfo, getFlightOrigin, getGood, getGoods, getLocationType, getPositionAt, getRarity, getSystemName, goodIds, hasEnergy, hasEnergyForDistance, hasExtractor, hasLoaders, hasMass, hasSchedule, hasSpace$1 as hasSpace, hasSpaceForMass, hasStorage, hasSystem, hasTrade, hash, hash512, isExtractableLocation, isFull$1 as isFull, isFullFromMass, isProfitable, lerp, loader_stats, location_derived, location_epoch, location_row, location_static, makeContainer, makeShip, makeWarehouse, marketPrice, marketPrices, maxTravelDistance, mixture_component, mixture_info, movement_stats, needsRecharge, projectEntity, projectEntityAt, rotation, schedule, task, toLocation, warehouse_row };
3090
+ export { AckMessage, ActionsManager, AnyEntity, BASE_ORBITAL_MASS, BLEND_INPUTS_MUST_MATCH, BLEND_REQUIRES_MULTIPLE, BLEND_STAT_LESS_NOT_SUPPORTED, BoundingBox, BoundsDeltaMessage, BoundsSubscriptionHandle, CANCEL_CONTAINS_GROUPED_TASK, CANCEL_PAIRED_HAS_PENDING, CATEGORY_LABELS, COMMIT_ALREADY_SET, COMMIT_CANNOT_MATCH, COMMIT_NOT_SET, COMPANY_NOT_FOUND, CONTAINER_CAPACITY_EXCEEDED, CONTAINER_NOT_FOUND, CONTAINER_Z, CRAFT_ENERGY_DIVISOR, CRAFT_EXCEEDS_ENERGY_CAPACITY, CRAFT_NOT_ENOUGH_ENERGY, CapabilityAttribute, CapabilityInput, CargoData, CargoMassInfo, CargoStack, CategoryIconShape, CategoryInfo, CategoryStacks, ClientMessage, ConnectionState, Container, ContainerEntity, ContainerStateInput, Coordinates, CoordinatesType, CraftedItemCategory, CrafterCapability, DEPLOY_ENTITY_HAS_SCHEDULE, DEPTH_THRESHOLD_T1, DEPTH_THRESHOLD_T2, DEPTH_THRESHOLD_T3, DEPTH_THRESHOLD_T4, DEPTH_THRESHOLD_T5, DESTINATION_CAPACITY_EXCEEDED, DescribeOptions, Distance, ENTITY_CAPACITY_EXCEEDED, ENTITY_NO_CRAFTER, EPOCH_NON_ZERO, EPOCH_NOT_READY, ERROR_SYSTEM_ALREADY_INITIALIZED, ERROR_SYSTEM_DISABLED, ERROR_SYSTEM_NOT_INITIALIZED, EnergyCapability, EntitiesManager, Entity, EntityCapabilities, EntityInfo, EntityInstance, EntityInventory, EntityLayout, EntityRefInput, EntitySlot, EntityState, EntitySubscriptionHandle, EntityType, EntityTypeName, EpochInfo, EpochsManager, ErrorMessage, EstimateTravelTimeOptions, EstimatedTravelTime, EventCatchupCompleteMessage, EventMessage, GAME_NOT_FOUND, GAME_SEED_NOT_SET, GATHER_EXCEEDS_ENERGY_CAPACITY, GATHER_NOT_ENOUGH_ENERGY, GROUP_DUPLICATE_ENTITY, GROUP_EMPTY, GROUP_ENTITY_NOT_MOVABLE, GROUP_HAUL_CAPACITY_EXCEEDED, GROUP_NOT_FOUND, GROUP_NOT_SAME_LOCATION, GROUP_NOT_SAME_OWNER, GROUP_NO_THRUST, GameState, GathererCapability, HasCapacity, HasCargo, HasCargomass, HasScheduleAndLocation, INSUFFICIENT_BALANCE, INSUFFICIENT_ITEM_QUANTITY, INSUFFICIENT_ITEM_SUPPLY, INVALID_AMOUNT, ITEM_BIOMASS_T1, ITEM_BIOMASS_T10, ITEM_BIOMASS_T2, ITEM_BIOMASS_T3, ITEM_BIOMASS_T4, ITEM_BIOMASS_T5, ITEM_BIOMASS_T6, ITEM_BIOMASS_T7, ITEM_BIOMASS_T8, ITEM_BIOMASS_T9, ITEM_CARGO_ARM, ITEM_CARGO_LINING, ITEM_CARGO_LINING_T2, ITEM_CONTAINER_T1_PACKED, ITEM_CONTAINER_T2_PACKED, ITEM_CRAFTER_T1, ITEM_CRYSTAL_T1, ITEM_CRYSTAL_T10, ITEM_CRYSTAL_T2, ITEM_CRYSTAL_T3, ITEM_CRYSTAL_T4, ITEM_CRYSTAL_T5, ITEM_CRYSTAL_T6, ITEM_CRYSTAL_T7, ITEM_CRYSTAL_T8, ITEM_CRYSTAL_T9, ITEM_DOES_NOT_EXIST, ITEM_ENGINE_T1, ITEM_FOCUSING_ARRAY, ITEM_GAS_T1, ITEM_GAS_T10, ITEM_GAS_T2, ITEM_GAS_T3, ITEM_GAS_T4, ITEM_GAS_T5, ITEM_GAS_T6, ITEM_GAS_T7, ITEM_GAS_T8, ITEM_GAS_T9, ITEM_GATHERER_T1, ITEM_GENERATOR_T1, ITEM_HAULER_T1, ITEM_HULL_PLATES, ITEM_HULL_PLATES_T2, ITEM_LOADER_T1, ITEM_MATTER_CONDUIT, ITEM_NOT_AVAILABLE_AT_LOCATION, ITEM_NOT_DEPLOYABLE, ITEM_NOT_PACKED_ENTITY, ITEM_ORE_T1, ITEM_ORE_T10, ITEM_ORE_T2, ITEM_ORE_T3, ITEM_ORE_T4, ITEM_ORE_T5, ITEM_ORE_T6, ITEM_ORE_T7, ITEM_ORE_T8, ITEM_ORE_T9, ITEM_POWER_CELL, ITEM_REACTION_CHAMBER, ITEM_REGOLITH_T1, ITEM_REGOLITH_T10, ITEM_REGOLITH_T2, ITEM_REGOLITH_T3, ITEM_REGOLITH_T4, ITEM_REGOLITH_T5, ITEM_REGOLITH_T6, ITEM_REGOLITH_T7, ITEM_REGOLITH_T8, ITEM_REGOLITH_T9, ITEM_SHIP_T1_PACKED, ITEM_STORAGE_T1, ITEM_SURVEY_PROBE, ITEM_THRUSTER_CORE, ITEM_TOOL_BIT, ITEM_TYPE_COMPONENT, ITEM_TYPE_ENTITY, ITEM_TYPE_MODULE, ITEM_TYPE_RESOURCE, ITEM_WAREHOUSE_T1_PACKED, InventoryAccessor, Item, ItemType, LOCATION_MAX_DEPTH, LOCATION_MIN_DEPTH, LoadTimeBreakdown, LoaderCapability, Location, LocationType, LocationsManager, MAX_ORBITAL_ALTITUDE, MIN_ORBITAL_ALTITUDE, MODULE_ANY, MODULE_CARGO_NOT_FOUND, MODULE_CRAFTER, MODULE_ENGINE, MODULE_ENTITY_BUSY, MODULE_GATHERER, MODULE_GENERATOR, MODULE_HAULER, MODULE_LAUNCHER, MODULE_LOADER, MODULE_NOT_MODULE, MODULE_SLOT_EMPTY, MODULE_SLOT_INVALID, MODULE_SLOT_OCCUPIED, MODULE_STORAGE, MODULE_TYPE_MISMATCH, MODULE_WARP, MassCapability, ModuleDescription, ModuleEntry, ModuleType, MovementCapability, index as NFT, NFTCargoItem, NFTCommonBase, NFTInstalledModule, NFTModuleSlot, NO_SCHEDULE, NamedStats, 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, PLAYER_NOT_JOINED, PRECISION, PackedModule, PackedModuleInput, PingMessage, PlanetSubtypeInfo, platform as PlatformContract, Player, PlayerStateInput, PlayersManager, PongMessage, Projectable, ProjectedEntity, ProjectionOptions, RECIPE_INPUTS_EXCESS, RECIPE_INPUTS_INSUFFICIENT, RECIPE_INPUTS_INVALID, RECIPE_INPUTS_MIXED, RECIPE_NOT_FOUND, REQUIRES_MORE_THAN_ONE, REQUIRES_POSITIVE_VALUE, RESERVE_TIERS, RESOLVE_COUNT_EXCEEDS_COMPLETED, Recipe, RecipeInput, RecipeInputCategory, RecipeInputItemId, RecipeSlotInput, RenderDescriptionOptions, ReserveTier, ResolvedAttributeGroup, ResolvedItem, ResolvedItemStat, ResolvedItemType, ResolvedModuleSlot, ResourceCategory, ResourceStats, ResourceTier, SHIP_ALREADY_THERE, SHIP_ALREADY_TRAVELING, SHIP_CANNOT_BUY_TRAVELING, SHIP_CANNOT_CANCEL_TASK, SHIP_CANNOT_UPDATE_TRAVELING, SHIP_CAPACITY_EXCEEDED, 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, STARTER_ALREADY_CLAIMED, ScheduleAccessor, ScheduleCapability, ScheduleData, Scheduleable, server as ServerContract, ServerMessage, Ship, ShipCapabilities, ShipEntity, ShipLike, ShipStateInput, Shipload, SnapshotMessage, StackInput, StatDefinition, StatMapping, StatSlot, StorageCapability, StratumInfo, SubscribeEntityMessage, SubscribeEventsMessage, SubscribeMessage, SubscriptionEntityType, SubscriptionsManager, SubscriptionsOptions, TIER_ADJECTIVES, TIER_ROLL_MAX, TRAVEL_MAX_DURATION, TaskCancelable, TaskType, TextSpan, TierRange, TransferEntity, UnsubscribeEntityMessage, UnsubscribeEventsMessage, UnsubscribeMessage, UpdateBoundsMessage, UpdateMessage, WAREHOUSE_ALREADY_AT_LOCATION, WAREHOUSE_CAPACITY_EXCEEDED, WAREHOUSE_NOT_FOUND, WAREHOUSE_Z, WARP_HAS_CARGO, WARP_HAS_SCHEDULE, WARP_NOT_FULL_ENERGY, WARP_NO_CAPABILITY, WARP_OUT_OF_RANGE, Warehouse, WarehouseEntity, WarehouseStateInput, WebSocketConnection, WebSocketConnectionOptions, WireCoordinates, WireEntity, availableCapacity$1 as availableCapacity, availableCapacityFromMass, blendCargoStacks, blendComponentStacks, blendCrossGroup, blendStacks, buildEntityDescription, calcCargoItemMass, calcCargoMass, calcEnergyUsage, calcLoadDuration, calcStacksMass, calc_acceleration, calc_craft_duration, calc_craft_energy, calc_energyusage, calc_flighttime, calc_gather_duration, calc_gather_energy, 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, calculateFlightTime, calculateLoadTimeBreakdown, calculateRefuelingTime, calculateTransferTime, canMove, capabilityAttributes, capabilityNames, capsHasCrafter, capsHasGatherer, capsHasHauler, capsHasLoaders, capsHasMass, capsHasMovement, capsHasStorage, cargoItemToStack, cargoUtils, cargo_item, categoryColors, categoryIconShapes, categoryIcons, componentIcon, computeBaseCapacityShip, computeBaseCapacityWarehouse, computeBaseHullmass, computeComponentStats, computeContainerCapabilities, computeContainerT2Capabilities, computeCraftedOutputStats, computeCrafterCapabilities, computeCrafterDrain, computeCrafterSpeed, computeEngineCapabilities, computeEngineDrain, computeEngineThrust, computeEntityStats, computeGathererCapabilities, computeGathererDepth, computeGathererDrain, computeGathererSpeed, computeGathererYield, computeGeneratorCap, computeGeneratorCapabilities, computeGeneratorRech, computeHaulPenalty, computeHaulerCapabilities, computeHaulerDrain, computeInputMass, computeLoaderCapabilities, computeLoaderMass, computeLoaderThrust, computeShipCapabilities, computeShipHullCapabilities, computeStorageCapabilities, computeWarehouseCapabilities, computeWarehouseHullCapabilities, container_row, coordsToLocationId, createInventoryAccessor, createProjectedEntity, createScheduleAccessor, decodeCraftedItemStats, decodeStat, decodeStats, Shipload as default, deriveLocation, deriveLocationEpoch, deriveLocationSize, deriveLocationStatic, deriveResourceStats, deriveStratum, describeItem, describeModule, describeModuleForItem, describeModuleForSlot, deserializeAsset, deserializeComponent, deserializeEntity, deserializeModule, deserializeResource, displayName, distanceBetweenCoordinates, distanceBetweenPoints, encodeGatheredCargoStats, encodeStats, energyPercent, energy_stats, entityDisplayName, estimateDealTravelTime, estimateTravelTime, findItemByCategoryAndTier, findNearbyPlanets, formatMass, formatMassDelta, formatModuleLine, formatTier, gatherer_stats, getCapabilityAttributes, getCategoryInfo, getCurrentEpoch, getDepthThreshold, getDestinationLocation, getEligibleResources, getEntityLayout, getEpochInfo, getFlightOrigin, getItem, getItems, getLocationCandidates, getLocationType, getLocationTypeName, getModuleCapabilityType, getPlanetSubtype, getPlanetSubtypes, getPositionAt, getRecipe, getResourceTier, getResourceWeight, getStatDefinitions, getStatMappings, getStatMappingsForCapability, getStatMappingsForStat, getStatName, getSystemName, hasEnergy, hasEnergyForDistance, hasGatherer, hasLoaders, hasMass, hasSchedule, hasSpace$1 as hasSpace, hasSpaceForMass, hasStorage, hasSystem, hash, hash512, isCraftedItem, isFull$1 as isFull, isFullFromMass, isGatherableLocation, isInvertedAttribute, isModuleItem, isRelatedItem, isSubscriptionsDebugEnabled, itemAbbreviations, itemCategory, itemIds, itemOffset, itemTier, itemTypeCode, lerp, loader_stats, location_derived, location_epoch, location_row, location_static, makeContainer, makeShip, makeWarehouse, mapEntity, maxTravelDistance, mergeStacks, moduleAccepts, moduleDisplayName, moduleIcon, moduleSlotTypeToCode, movement_stats, needsRecharge, parseWireEntity, projectEntity, projectEntityAt, readCommonBase, removeFromStacks, renderDescription, resolveItem, resolveStats, rollTier, rollWithinTier, rotation, schedule, setSubscriptionsDebug, stackKey, stackToCargoItem, stacksEqual, statMappings, task, tierColors, tierLabels, tierNumber, toLocation, validateSchedule, warehouse_row };