@shipload/sdk 2.0.0-rc2 → 2.0.0-rc4

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 (39) hide show
  1. package/lib/shipload.d.ts +319 -137
  2. package/lib/shipload.js +3253 -1812
  3. package/lib/shipload.js.map +1 -1
  4. package/lib/shipload.m.js +2657 -1131
  5. package/lib/shipload.m.js.map +1 -1
  6. package/package.json +1 -1
  7. package/src/capabilities/extraction.ts +14 -21
  8. package/src/capabilities/storage.ts +2 -2
  9. package/src/contracts/server.ts +311 -120
  10. package/src/data/items.json +16 -0
  11. package/src/data/nebula-adjectives.json +211 -0
  12. package/src/data/nebula-nouns.json +151 -0
  13. package/src/data/syllables.json +1386 -780
  14. package/src/derivation/index.ts +25 -0
  15. package/src/derivation/location-size.ts +15 -0
  16. package/src/derivation/resources.ts +141 -0
  17. package/src/derivation/stratum.ts +118 -0
  18. package/src/entities/cargo-utils.ts +8 -8
  19. package/src/entities/entity-inventory.ts +13 -9
  20. package/src/entities/inventory-accessor.ts +2 -2
  21. package/src/entities/location.ts +10 -10
  22. package/src/entities/ship.ts +10 -6
  23. package/src/entities/warehouse.ts +2 -2
  24. package/src/errors.ts +4 -4
  25. package/src/index-module.ts +31 -6
  26. package/src/managers/actions.ts +21 -9
  27. package/src/managers/locations.ts +7 -7
  28. package/src/managers/trades.ts +5 -5
  29. package/src/market/items.ts +31 -0
  30. package/src/market/market.ts +9 -9
  31. package/src/scheduling/projection.ts +7 -7
  32. package/src/trading/collect.ts +25 -25
  33. package/src/trading/deal.ts +8 -8
  34. package/src/trading/trade.ts +9 -9
  35. package/src/travel/travel.ts +6 -6
  36. package/src/types.ts +17 -7
  37. package/src/utils/system.ts +51 -52
  38. package/src/data/goods.json +0 -23
  39. package/src/market/goods.ts +0 -31
package/lib/shipload.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as _wharfkit_antelope from '@wharfkit/antelope';
2
- import { Blob, ABI, Struct, Name, UInt64, Checksum256, UInt32, TimePointSec, Checksum256Type, UInt32Type, NameType, UInt64Type, Action, UInt16, 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, UInt16, UInt8, TimePoint, Int64, UInt16Type, UInt8Type, TimePointType, Int64Type, Checksum512, APIClient } from '@wharfkit/antelope';
3
3
  import * as _wharfkit_contract from '@wharfkit/contract';
4
4
  import { Contract as Contract$2, PartialBy, ContractArgs, ActionOptions, Table } from '@wharfkit/contract';
5
5
  import { ChainDefinition } from '@wharfkit/session';
@@ -167,10 +167,10 @@ declare namespace Types {
167
167
  ship_id: UInt64;
168
168
  name: string;
169
169
  }
170
- class buygoods extends Struct {
170
+ class buyitems extends Struct {
171
171
  entity_type: Name;
172
172
  id: UInt64;
173
- good_id: UInt16;
173
+ item_id: UInt16;
174
174
  quantity: UInt32;
175
175
  }
176
176
  class buyship extends Struct {
@@ -199,25 +199,23 @@ declare namespace Types {
199
199
  entitygroup?: UInt64;
200
200
  group_members?: entity_ref[];
201
201
  }
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
202
  class cargo_item extends Struct {
210
- good_id: UInt16;
203
+ item_id: UInt16;
211
204
  quantity: UInt32;
212
205
  unit_cost: UInt64;
213
- mixture?: mixture_info;
206
+ seed?: UInt64;
214
207
  }
215
208
  class cargo_row extends Struct {
216
209
  id: UInt64;
217
210
  entity_id: UInt64;
218
- good_id: UInt64;
211
+ item_id: UInt64;
219
212
  quantity: UInt64;
220
213
  unit_cost: UInt64;
214
+ seed: UInt64;
215
+ }
216
+ class cleanrsvp extends Struct {
217
+ epoch: UInt64;
218
+ max_rows: UInt64;
221
219
  }
222
220
  class cleartable extends Struct {
223
221
  table_name: Name;
@@ -227,6 +225,63 @@ declare namespace Types {
227
225
  class commit extends Struct {
228
226
  commit: Checksum256;
229
227
  }
228
+ class movement_stats extends Struct {
229
+ thrust: UInt32;
230
+ drain: UInt16;
231
+ }
232
+ class energy_stats extends Struct {
233
+ capacity: UInt16;
234
+ recharge: UInt16;
235
+ }
236
+ class loader_stats extends Struct {
237
+ mass: UInt32;
238
+ thrust: UInt16;
239
+ quantity: UInt8;
240
+ }
241
+ class trade_stats extends Struct {
242
+ margin: UInt16;
243
+ }
244
+ class extractor_stats extends Struct {
245
+ rate: UInt16;
246
+ drain: UInt16;
247
+ efficiency: UInt16;
248
+ depth: UInt16;
249
+ drill: UInt16;
250
+ }
251
+ class warp_stats extends Struct {
252
+ range: UInt32;
253
+ }
254
+ class entity_defaults extends Struct {
255
+ ship_hullmass: UInt32;
256
+ ship_capacity: UInt32;
257
+ ship_energy: UInt16;
258
+ ship_z: UInt16;
259
+ ship_engines: movement_stats;
260
+ ship_generator: energy_stats;
261
+ ship_loaders: loader_stats;
262
+ ship_trade: trade_stats;
263
+ ship_extractor: extractor_stats;
264
+ ship_warp: warp_stats;
265
+ warehouse_capacity: UInt32;
266
+ warehouse_z: UInt16;
267
+ warehouse_loaders: loader_stats;
268
+ container_hullmass: UInt32;
269
+ container_capacity: UInt32;
270
+ container_z: UInt16;
271
+ }
272
+ class item_def extends Struct {
273
+ id: UInt16;
274
+ base_price: UInt32;
275
+ mass: UInt32;
276
+ }
277
+ class game_config extends Struct {
278
+ version: UInt32;
279
+ defaults: entity_defaults;
280
+ items: item_def[];
281
+ }
282
+ class configlog extends Struct {
283
+ config: game_config;
284
+ }
230
285
  class coordinates extends Struct {
231
286
  x: Int64;
232
287
  y: Int64;
@@ -260,28 +315,10 @@ declare namespace Types {
260
315
  class enable extends Struct {
261
316
  enabled: boolean;
262
317
  }
263
- class energy_stats extends Struct {
264
- capacity: UInt16;
265
- recharge: UInt16;
266
- }
267
318
  class entity_current_state extends Struct {
268
319
  coordinates: coordinates;
269
320
  energy: UInt16;
270
321
  }
271
- class loader_stats extends Struct {
272
- mass: UInt32;
273
- thrust: UInt16;
274
- quantity: UInt8;
275
- }
276
- class movement_stats extends Struct {
277
- thrust: UInt32;
278
- drain: UInt16;
279
- }
280
- class extractor_stats extends Struct {
281
- rate: UInt16;
282
- drain: UInt16;
283
- efficiency: UInt16;
284
- }
285
322
  class entity_info extends Struct {
286
323
  type: Name;
287
324
  id: UInt64;
@@ -297,6 +334,7 @@ declare namespace Types {
297
334
  generator?: energy_stats;
298
335
  capacity?: UInt32;
299
336
  extractor?: extractor_stats;
337
+ warp?: warp_stats;
300
338
  is_idle: boolean;
301
339
  current_task?: task;
302
340
  current_task_elapsed: UInt32;
@@ -326,7 +364,12 @@ declare namespace Types {
326
364
  participants: entity_ref[];
327
365
  }
328
366
  class extract extends Struct {
329
- ship_id: UInt64;
367
+ entity_type: Name;
368
+ id: UInt64;
369
+ stratum: UInt16;
370
+ quantity: UInt32;
371
+ }
372
+ class getconfig extends Struct {
330
373
  }
331
374
  class getentities extends Struct {
332
375
  owner: Name;
@@ -336,7 +379,7 @@ declare namespace Types {
336
379
  entity_type: Name;
337
380
  entity_id: UInt64;
338
381
  }
339
- class getgoods extends Struct {
382
+ class getitems extends Struct {
340
383
  }
341
384
  class getlocation extends Struct {
342
385
  x: Int64;
@@ -356,18 +399,15 @@ declare namespace Types {
356
399
  }
357
400
  class getstarter extends Struct {
358
401
  }
402
+ class getstratum extends Struct {
403
+ x: Int64;
404
+ y: Int64;
405
+ stratum: UInt16;
406
+ }
359
407
  class getsummaries extends Struct {
360
408
  owner: Name;
361
409
  entity_type?: Name;
362
410
  }
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
411
  class grouptravel extends Struct {
372
412
  entities: entity_ref[];
373
413
  x: Int64;
@@ -383,6 +423,9 @@ declare namespace Types {
383
423
  class init extends Struct {
384
424
  seed: Checksum256;
385
425
  }
426
+ class items_info extends Struct {
427
+ items: item_def[];
428
+ }
386
429
  class join extends Struct {
387
430
  account: Name;
388
431
  }
@@ -401,8 +444,9 @@ declare namespace Types {
401
444
  class location_derived extends Struct {
402
445
  static_props: location_static;
403
446
  epoch_props: location_epoch;
447
+ size: UInt16;
404
448
  }
405
- class location_good extends Struct {
449
+ class location_item extends Struct {
406
450
  id: UInt16;
407
451
  price: UInt32;
408
452
  supply: UInt16;
@@ -412,7 +456,7 @@ declare namespace Types {
412
456
  class location_info extends Struct {
413
457
  coords: coordinates;
414
458
  is_system: boolean;
415
- goods: location_good[];
459
+ items: location_item[];
416
460
  }
417
461
  class location_row extends Struct {
418
462
  id: UInt64;
@@ -445,11 +489,6 @@ declare namespace Types {
445
489
  starts_at: TimePoint;
446
490
  completes_at: TimePoint;
447
491
  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
492
  }
454
493
  class notify extends Struct {
455
494
  event: task_event;
@@ -486,6 +525,10 @@ declare namespace Types {
486
525
  entity_type: Name;
487
526
  id: UInt64;
488
527
  }
528
+ class reserve_row extends Struct {
529
+ id: UInt64;
530
+ remaining: UInt32;
531
+ }
489
532
  class resolve extends Struct {
490
533
  entity_type: Name;
491
534
  id: UInt64;
@@ -499,22 +542,25 @@ declare namespace Types {
499
542
  entitygroup?: UInt64;
500
543
  group_members?: entity_ref[];
501
544
  }
545
+ class resource_stats extends Struct {
546
+ purity: UInt16;
547
+ density: UInt16;
548
+ reactivity: UInt16;
549
+ resonance: UInt16;
550
+ }
502
551
  class salt extends Struct {
503
552
  salt: UInt64;
504
553
  }
505
- class sellgoods extends Struct {
554
+ class sellitems extends Struct {
506
555
  entity_type: Name;
507
556
  id: UInt64;
508
- good_id: UInt16;
557
+ item_id: UInt16;
509
558
  quantity: UInt32;
510
559
  }
511
560
  class sequence_row extends Struct {
512
561
  key: Name;
513
562
  value: UInt64;
514
563
  }
515
- class trade_stats extends Struct {
516
- margin: UInt16;
517
- }
518
564
  class ship_row extends Struct {
519
565
  id: UInt64;
520
566
  owner: Name;
@@ -529,6 +575,7 @@ declare namespace Types {
529
575
  loaders: loader_stats;
530
576
  trade?: trade_stats;
531
577
  extractor?: extractor_stats;
578
+ warp?: warp_stats;
532
579
  schedule?: schedule;
533
580
  }
534
581
  class starter_info extends Struct {
@@ -544,11 +591,21 @@ declare namespace Types {
544
591
  seed: Checksum256;
545
592
  commit: Checksum256;
546
593
  }
594
+ class stratum_info extends Struct {
595
+ item_id: UInt16;
596
+ seed: UInt64;
597
+ richness: UInt16;
598
+ reserve: UInt32;
599
+ }
600
+ class stratum_data extends Struct {
601
+ stratum: stratum_info;
602
+ stats: resource_stats;
603
+ }
547
604
  class supply_row extends Struct {
548
605
  id: UInt64;
549
606
  coordinates: coordinates;
550
607
  epoch: UInt64;
551
- good_id: UInt16;
608
+ item_id: UInt16;
552
609
  supply: UInt16;
553
610
  }
554
611
  class takeloan extends Struct {
@@ -563,7 +620,7 @@ declare namespace Types {
563
620
  source_id: UInt64;
564
621
  dest_type: Name;
565
622
  dest_id: UInt64;
566
- good_id: UInt16;
623
+ item_id: UInt16;
567
624
  quantity: UInt32;
568
625
  }
569
626
  class travel extends Struct {
@@ -577,6 +634,7 @@ declare namespace Types {
577
634
  id: UInt64;
578
635
  entity_summary_type: entity_summary;
579
636
  starter_info_type: starter_info;
637
+ game_config_type: game_config;
580
638
  }
581
639
  class updatecredit extends Struct {
582
640
  account: Name;
@@ -596,6 +654,12 @@ declare namespace Types {
596
654
  loaders: loader_stats;
597
655
  schedule?: schedule;
598
656
  }
657
+ class warp extends Struct {
658
+ entity_type: Name;
659
+ id: UInt64;
660
+ x: Int64;
661
+ y: Int64;
662
+ }
599
663
  class wipe extends Struct {
600
664
  }
601
665
  class wipesequence extends Struct {
@@ -607,6 +671,7 @@ declare const TableMap: {
607
671
  entitygroup: typeof Types.entitygroup_row;
608
672
  location: typeof Types.location_row;
609
673
  player: typeof Types.player_row;
674
+ reserve: typeof Types.reserve_row;
610
675
  sequence: typeof Types.sequence_row;
611
676
  ship: typeof Types.ship_row;
612
677
  state: typeof Types.state_row;
@@ -620,6 +685,7 @@ interface TableTypes {
620
685
  entitygroup: Types.entitygroup_row;
621
686
  location: Types.location_row;
622
687
  player: Types.player_row;
688
+ reserve: Types.reserve_row;
623
689
  sequence: Types.sequence_row;
624
690
  ship: Types.ship_row;
625
691
  state: Types.state_row;
@@ -631,6 +697,60 @@ type RowType<T> = T extends keyof TableTypes ? TableTypes[T] : any;
631
697
  type TableNames = keyof TableTypes;
632
698
  declare namespace ActionParams {
633
699
  namespace Type {
700
+ interface game_config {
701
+ version: UInt32Type;
702
+ defaults: Type.entity_defaults;
703
+ items: Type.item_def[];
704
+ }
705
+ interface entity_defaults {
706
+ ship_hullmass: UInt32Type;
707
+ ship_capacity: UInt32Type;
708
+ ship_energy: UInt16Type;
709
+ ship_z: UInt16Type;
710
+ ship_engines: Type.movement_stats;
711
+ ship_generator: Type.energy_stats;
712
+ ship_loaders: Type.loader_stats;
713
+ ship_trade: Type.trade_stats;
714
+ ship_extractor: Type.extractor_stats;
715
+ ship_warp: Type.warp_stats;
716
+ warehouse_capacity: UInt32Type;
717
+ warehouse_z: UInt16Type;
718
+ warehouse_loaders: Type.loader_stats;
719
+ container_hullmass: UInt32Type;
720
+ container_capacity: UInt32Type;
721
+ container_z: UInt16Type;
722
+ }
723
+ interface movement_stats {
724
+ thrust: UInt32Type;
725
+ drain: UInt16Type;
726
+ }
727
+ interface energy_stats {
728
+ capacity: UInt16Type;
729
+ recharge: UInt16Type;
730
+ }
731
+ interface loader_stats {
732
+ mass: UInt32Type;
733
+ thrust: UInt16Type;
734
+ quantity: UInt8Type;
735
+ }
736
+ interface trade_stats {
737
+ margin: UInt16Type;
738
+ }
739
+ interface extractor_stats {
740
+ rate: UInt16Type;
741
+ drain: UInt16Type;
742
+ efficiency: UInt16Type;
743
+ depth: UInt16Type;
744
+ drill: UInt16Type;
745
+ }
746
+ interface warp_stats {
747
+ range: UInt32Type;
748
+ }
749
+ interface item_def {
750
+ id: UInt16Type;
751
+ base_price: UInt32Type;
752
+ mass: UInt32Type;
753
+ }
634
754
  interface entity_ref {
635
755
  entity_type: NameType;
636
756
  entity_id: UInt64Type;
@@ -645,11 +765,6 @@ declare namespace ActionParams {
645
765
  starts_at: TimePointType;
646
766
  completes_at: TimePointType;
647
767
  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
768
  }
654
769
  interface task {
655
770
  type: UInt8Type;
@@ -668,17 +783,10 @@ declare namespace ActionParams {
668
783
  z?: UInt16Type;
669
784
  }
670
785
  interface cargo_item {
671
- good_id: UInt16Type;
786
+ item_id: UInt16Type;
672
787
  quantity: UInt32Type;
673
788
  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;
789
+ seed?: UInt64Type;
682
790
  }
683
791
  }
684
792
  interface advance {
@@ -690,10 +798,10 @@ declare namespace ActionParams {
690
798
  ship_id: UInt64Type;
691
799
  name: string;
692
800
  }
693
- interface buygoods {
801
+ interface buyitems {
694
802
  entity_type: NameType;
695
803
  id: UInt64Type;
696
- good_id: UInt16Type;
804
+ item_id: UInt16Type;
697
805
  quantity: UInt32Type;
698
806
  }
699
807
  interface buyship {
@@ -710,6 +818,10 @@ declare namespace ActionParams {
710
818
  id: UInt64Type;
711
819
  count: UInt64Type;
712
820
  }
821
+ interface cleanrsvp {
822
+ epoch: UInt64Type;
823
+ max_rows: UInt64Type;
824
+ }
713
825
  interface cleartable {
714
826
  table_name: NameType;
715
827
  scope?: NameType;
@@ -718,11 +830,19 @@ declare namespace ActionParams {
718
830
  interface commit {
719
831
  commit: Checksum256Type;
720
832
  }
833
+ interface configlog {
834
+ config: Type.game_config;
835
+ }
721
836
  interface enable {
722
837
  enabled: boolean;
723
838
  }
724
839
  interface extract {
725
- ship_id: UInt64Type;
840
+ entity_type: NameType;
841
+ id: UInt64Type;
842
+ stratum: UInt16Type;
843
+ quantity: UInt32Type;
844
+ }
845
+ interface getconfig {
726
846
  }
727
847
  interface getentities {
728
848
  owner: NameType;
@@ -732,7 +852,7 @@ declare namespace ActionParams {
732
852
  entity_type: NameType;
733
853
  entity_id: UInt64Type;
734
854
  }
735
- interface getgoods {
855
+ interface getitems {
736
856
  }
737
857
  interface getlocation {
738
858
  x: Int64Type;
@@ -752,6 +872,11 @@ declare namespace ActionParams {
752
872
  }
753
873
  interface getstarter {
754
874
  }
875
+ interface getstratum {
876
+ x: Int64Type;
877
+ y: Int64Type;
878
+ stratum: UInt16Type;
879
+ }
755
880
  interface getsummaries {
756
881
  owner: NameType;
757
882
  entity_type?: NameType;
@@ -796,10 +921,10 @@ declare namespace ActionParams {
796
921
  interface salt {
797
922
  salt: UInt64Type;
798
923
  }
799
- interface sellgoods {
924
+ interface sellitems {
800
925
  entity_type: NameType;
801
926
  id: UInt64Type;
802
- good_id: UInt16Type;
927
+ item_id: UInt16Type;
803
928
  quantity: UInt32Type;
804
929
  }
805
930
  interface takeloan {
@@ -811,7 +936,7 @@ declare namespace ActionParams {
811
936
  source_id: UInt64Type;
812
937
  dest_type: NameType;
813
938
  dest_id: UInt64Type;
814
- good_id: UInt16Type;
939
+ item_id: UInt16Type;
815
940
  quantity: UInt32Type;
816
941
  }
817
942
  interface travel {
@@ -829,6 +954,12 @@ declare namespace ActionParams {
829
954
  account: NameType;
830
955
  amount: Int64Type;
831
956
  }
957
+ interface warp {
958
+ entity_type: NameType;
959
+ id: UInt64Type;
960
+ x: Int64Type;
961
+ y: Int64Type;
962
+ }
832
963
  interface wipe {
833
964
  }
834
965
  interface wipesequence {
@@ -837,22 +968,26 @@ declare namespace ActionParams {
837
968
  interface ActionNameParams {
838
969
  advance: ActionParams.advance;
839
970
  buycontainer: ActionParams.buycontainer;
840
- buygoods: ActionParams.buygoods;
971
+ buyitems: ActionParams.buyitems;
841
972
  buyship: ActionParams.buyship;
842
973
  buywarehouse: ActionParams.buywarehouse;
843
974
  cancel: ActionParams.cancel;
975
+ cleanrsvp: ActionParams.cleanrsvp;
844
976
  cleartable: ActionParams.cleartable;
845
977
  commit: ActionParams.commit;
978
+ configlog: ActionParams.configlog;
846
979
  enable: ActionParams.enable;
847
980
  extract: ActionParams.extract;
981
+ getconfig: ActionParams.getconfig;
848
982
  getentities: ActionParams.getentities;
849
983
  getentity: ActionParams.getentity;
850
- getgoods: ActionParams.getgoods;
984
+ getitems: ActionParams.getitems;
851
985
  getlocation: ActionParams.getlocation;
852
986
  getlocdata: ActionParams.getlocdata;
853
987
  getnearby: ActionParams.getnearby;
854
988
  getplayer: ActionParams.getplayer;
855
989
  getstarter: ActionParams.getstarter;
990
+ getstratum: ActionParams.getstratum;
856
991
  getsummaries: ActionParams.getsummaries;
857
992
  grouptravel: ActionParams.grouptravel;
858
993
  hash: ActionParams.hash;
@@ -865,37 +1000,41 @@ interface ActionNameParams {
865
1000
  recharge: ActionParams.recharge;
866
1001
  resolve: ActionParams.resolve;
867
1002
  salt: ActionParams.salt;
868
- sellgoods: ActionParams.sellgoods;
1003
+ sellitems: ActionParams.sellitems;
869
1004
  takeloan: ActionParams.takeloan;
870
1005
  transfer: ActionParams.transfer;
871
1006
  travel: ActionParams.travel;
872
1007
  updatecredit: ActionParams.updatecredit;
873
1008
  updatedebt: ActionParams.updatedebt;
1009
+ warp: ActionParams.warp;
874
1010
  wipe: ActionParams.wipe;
875
1011
  wipesequence: ActionParams.wipesequence;
876
1012
  }
877
1013
  type ActionNames = keyof ActionNameParams;
878
1014
  interface ActionReturnValues {
879
- buygoods: Types.task_results;
1015
+ buyitems: Types.task_results;
880
1016
  cancel: Types.cancel_results;
881
1017
  extract: Types.task_results;
1018
+ getconfig: Types.game_config;
882
1019
  getentities: Types.entity_info[];
883
1020
  getentity: Types.entity_info;
884
- getgoods: Types.goods_info;
1021
+ getitems: Types.items_info;
885
1022
  getlocation: Types.location_info;
886
1023
  getlocdata: Types.location_derived;
887
1024
  getnearby: Types.nearby_info;
888
1025
  getplayer: Types.player_info;
889
1026
  getstarter: Types.starter_info;
1027
+ getstratum: Types.stratum_data;
890
1028
  getsummaries: Types.entity_summary[];
891
1029
  grouptravel: Types.task_results;
892
1030
  hash: Checksum256;
893
1031
  hash512: Checksum512;
894
1032
  recharge: Types.task_results;
895
1033
  resolve: Types.resolve_results;
896
- sellgoods: Types.task_results;
1034
+ sellitems: Types.task_results;
897
1035
  transfer: Types.task_results;
898
1036
  travel: Types.task_results;
1037
+ warp: Types.task_results;
899
1038
  }
900
1039
  type ActionReturnNames = keyof ActionReturnValues;
901
1040
  declare class Contract extends Contract$2 {
@@ -948,11 +1087,11 @@ declare const ERROR_SYSTEM_DISABLED = "This game is currently disabled.";
948
1087
  declare const ERROR_SYSTEM_NOT_INITIALIZED = "This game has not been initialized.";
949
1088
  declare const GAME_NOT_FOUND = "Cannot find game for given account name.";
950
1089
  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.";
1090
+ declare const ITEM_DOES_NOT_EXIST = "Item does not exist.";
1091
+ declare const ITEM_NOT_AVAILABLE_AT_LOCATION = "Item is not tradeable at ship location.";
953
1092
  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.";
1093
+ declare const INSUFFICIENT_ITEM_QUANTITY = "Insufficient quantity in cargo.";
1094
+ declare const INSUFFICIENT_ITEM_SUPPLY = "Insufficient supply of item at location.";
956
1095
  declare const INVALID_AMOUNT = "Invalid amount.";
957
1096
  declare const REQUIRES_MORE_THAN_ONE = "A value greater than one is required.";
958
1097
  declare const REQUIRES_POSITIVE_VALUE = "Value must be greater than zero.";
@@ -1015,7 +1154,7 @@ interface ShipLike {
1015
1154
  capacity: UInt32;
1016
1155
  }
1017
1156
  interface CargoMassInfo {
1018
- good_id: UInt16Type;
1157
+ item_id: UInt16Type;
1019
1158
  quantity: UInt32Type;
1020
1159
  }
1021
1160
  declare enum TaskType {
@@ -1024,7 +1163,8 @@ declare enum TaskType {
1024
1163
  RECHARGE = 2,
1025
1164
  LOAD = 3,
1026
1165
  UNLOAD = 4,
1027
- EXTRACT = 5
1166
+ EXTRACT = 5,
1167
+ WARP = 6
1028
1168
  }
1029
1169
  declare enum LocationType {
1030
1170
  EMPTY = 0,
@@ -1058,16 +1198,21 @@ interface Distance {
1058
1198
  destination: ActionParams.Type.coordinates;
1059
1199
  distance: UInt16;
1060
1200
  }
1061
- declare class Good extends Struct {
1201
+ type ResourceCategory = 'metal' | 'gas' | 'mineral' | 'organic';
1202
+ type ResourceRarity = 'common' | 'uncommon' | 'rare' | 'epic' | 'legendary';
1203
+ declare class Item extends Struct {
1062
1204
  id: UInt16;
1063
1205
  name: string;
1064
1206
  description: string;
1065
1207
  base_price: UInt32;
1066
1208
  mass: UInt32;
1209
+ category: ResourceCategory;
1210
+ rarity: ResourceRarity;
1211
+ color: string;
1067
1212
  }
1068
- declare class GoodPrice extends Struct {
1213
+ declare class ItemPrice extends Struct {
1069
1214
  id: UInt16;
1070
- good: Good;
1215
+ item: Item;
1071
1216
  price: UInt32;
1072
1217
  supply: UInt16;
1073
1218
  }
@@ -1323,15 +1468,15 @@ declare class Location {
1323
1468
  /**
1324
1469
  * Set cached market prices for this location
1325
1470
  */
1326
- setMarketPrices(prices: GoodPrice[]): void;
1471
+ setMarketPrices(prices: ItemPrice[]): void;
1327
1472
  /**
1328
1473
  * Get cached market prices (returns undefined if not cached)
1329
1474
  */
1330
- get marketPrices(): GoodPrice[] | undefined;
1475
+ get marketPrices(): ItemPrice[] | undefined;
1331
1476
  /**
1332
1477
  * Get price for a specific good (from cache)
1333
1478
  */
1334
- getPrice(goodId: UInt16Type): GoodPrice | undefined;
1479
+ getPrice(goodId: UInt16Type): ItemPrice | undefined;
1335
1480
  /**
1336
1481
  * Find nearby planets from this location
1337
1482
  */
@@ -1403,9 +1548,9 @@ declare class Location {
1403
1548
  declare function toLocation(coords: CoordinatesType | Location): Location;
1404
1549
 
1405
1550
  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[]>;
1551
+ getMarketPrice(location: CoordinatesType, goodId: number): Promise<ItemPrice>;
1552
+ getMarketPrices(location: CoordinatesType): Promise<ItemPrice[]>;
1553
+ getMarketPricesWithSupply(location: CoordinatesType): Promise<ItemPrice[]>;
1409
1554
  hasSystem(location: CoordinatesType): Promise<boolean>;
1410
1555
  findNearbyPlanets(origin: CoordinatesType, maxDistance?: UInt16Type): Promise<Distance[]>;
1411
1556
  getSupplyRows(location: CoordinatesType): Promise<any[]>;
@@ -1629,8 +1774,9 @@ declare class ScheduleAccessor {
1629
1774
  declare function createScheduleAccessor(entity: ScheduleData): ScheduleAccessor;
1630
1775
 
1631
1776
  declare class EntityInventory extends Types.cargo_item {
1632
- private _good?;
1633
- get good(): Good;
1777
+ private _item?;
1778
+ get item(): Item;
1779
+ get good(): Item;
1634
1780
  get name(): string;
1635
1781
  get unitMass(): UInt32;
1636
1782
  get totalMass(): UInt64;
@@ -1664,7 +1810,7 @@ declare class InventoryAccessor {
1664
1810
  get items(): EntityInventory[];
1665
1811
  get totalMass(): UInt64;
1666
1812
  get totalValue(): UInt64;
1667
- forGood(goodId: UInt64Type): EntityInventory | undefined;
1813
+ forItem(goodId: UInt64Type): EntityInventory | undefined;
1668
1814
  get sellable(): EntityInventory[];
1669
1815
  get hasSellable(): boolean;
1670
1816
  get sellableCount(): number;
@@ -1676,7 +1822,7 @@ interface CargoData {
1676
1822
  }
1677
1823
  declare function totalCargoMass(cargo: EntityInventory[]): UInt64;
1678
1824
  declare function cargoValue(cargo: EntityInventory[]): UInt64;
1679
- declare function getCargoForGood(cargo: EntityInventory[], goodId: UInt64Type): EntityInventory | undefined;
1825
+ declare function getCargoForItem(cargo: EntityInventory[], goodId: UInt64Type): EntityInventory | undefined;
1680
1826
  declare function hasSpace(currentMass: UInt64, maxCapacity: UInt64, goodMass: UInt64, quantity: number): boolean;
1681
1827
  declare function availableCapacity(currentMass: UInt64, maxCapacity: UInt64): UInt64;
1682
1828
  declare function isFull(currentMass: UInt64, maxCapacity: UInt64): boolean;
@@ -1687,38 +1833,38 @@ interface SaleValue {
1687
1833
  }
1688
1834
  declare function calculateSaleValue(cargo: Types.cargo_item[], prices: Map<number, UInt64>): SaleValue;
1689
1835
  declare function calculateSaleValueFromArray(cargo: Types.cargo_item[], prices: UInt64[]): SaleValue;
1690
- declare function afterSellGoods(cargo: Types.cargo_item[], goodsToSell: Array<{
1836
+ declare function afterSellItems(cargo: Types.cargo_item[], goodsToSell: Array<{
1691
1837
  goodId: number;
1692
1838
  quantity: number;
1693
1839
  }>): EntityInventory[];
1694
- declare function afterSellAllGoods(cargo: Types.cargo_item[]): EntityInventory[];
1840
+ declare function afterSellAllItems(cargo: Types.cargo_item[]): EntityInventory[];
1695
1841
 
1696
1842
  type cargoUtils_CargoData = CargoData;
1697
1843
  declare const cargoUtils_totalCargoMass: typeof totalCargoMass;
1698
1844
  declare const cargoUtils_cargoValue: typeof cargoValue;
1699
- declare const cargoUtils_getCargoForGood: typeof getCargoForGood;
1845
+ declare const cargoUtils_getCargoForItem: typeof getCargoForItem;
1700
1846
  declare const cargoUtils_hasSpace: typeof hasSpace;
1701
1847
  declare const cargoUtils_availableCapacity: typeof availableCapacity;
1702
1848
  declare const cargoUtils_isFull: typeof isFull;
1703
1849
  type cargoUtils_SaleValue = SaleValue;
1704
1850
  declare const cargoUtils_calculateSaleValue: typeof calculateSaleValue;
1705
1851
  declare const cargoUtils_calculateSaleValueFromArray: typeof calculateSaleValueFromArray;
1706
- declare const cargoUtils_afterSellGoods: typeof afterSellGoods;
1707
- declare const cargoUtils_afterSellAllGoods: typeof afterSellAllGoods;
1852
+ declare const cargoUtils_afterSellItems: typeof afterSellItems;
1853
+ declare const cargoUtils_afterSellAllItems: typeof afterSellAllItems;
1708
1854
  declare namespace cargoUtils {
1709
1855
  export {
1710
1856
  cargoUtils_CargoData as CargoData,
1711
1857
  cargoUtils_totalCargoMass as totalCargoMass,
1712
1858
  cargoUtils_cargoValue as cargoValue,
1713
- cargoUtils_getCargoForGood as getCargoForGood,
1859
+ cargoUtils_getCargoForItem as getCargoForItem,
1714
1860
  cargoUtils_hasSpace as hasSpace,
1715
1861
  cargoUtils_availableCapacity as availableCapacity,
1716
1862
  cargoUtils_isFull as isFull,
1717
1863
  cargoUtils_SaleValue as SaleValue,
1718
1864
  cargoUtils_calculateSaleValue as calculateSaleValue,
1719
1865
  cargoUtils_calculateSaleValueFromArray as calculateSaleValueFromArray,
1720
- cargoUtils_afterSellGoods as afterSellGoods,
1721
- cargoUtils_afterSellAllGoods as afterSellAllGoods,
1866
+ cargoUtils_afterSellItems as afterSellItems,
1867
+ cargoUtils_afterSellAllItems as afterSellAllItems,
1722
1868
  };
1723
1869
  }
1724
1870
 
@@ -1758,6 +1904,7 @@ declare class Ship extends Types.entity_info {
1758
1904
  isUnloading(now: Date): boolean;
1759
1905
  isExtracting(now: Date): boolean;
1760
1906
  get hasExtractor(): boolean;
1907
+ get hasWarp(): boolean;
1761
1908
  project(): ProjectedEntity;
1762
1909
  projectAt(now: Date): ProjectedEntity;
1763
1910
  get location(): Location;
@@ -1767,7 +1914,7 @@ declare class Ship extends Types.entity_info {
1767
1914
  get maxCapacity(): UInt64;
1768
1915
  hasSpace(goodMass: UInt64, quantity: number): boolean;
1769
1916
  get availableCapacity(): UInt64;
1770
- getCargoForGood(goodId: UInt64Type): EntityInventory | undefined;
1917
+ getCargoForItem(goodId: UInt64Type): EntityInventory | undefined;
1771
1918
  get sellableCargo(): EntityInventory[];
1772
1919
  get hasSellableCargo(): boolean;
1773
1920
  get sellableGoodsCount(): number;
@@ -1777,11 +1924,11 @@ declare class Ship extends Types.entity_info {
1777
1924
  hasEnergyFor(distance: UInt64): boolean;
1778
1925
  calculateSaleValue(prices: Map<number, UInt64>): SaleValue;
1779
1926
  calculateSaleValueFromArray(prices: UInt64[]): SaleValue;
1780
- afterSellGoods(goodsToSell: Array<{
1927
+ afterSellItems(goodsToSell: Array<{
1781
1928
  goodId: number;
1782
1929
  quantity: number;
1783
1930
  }>): EntityInventory[];
1784
- afterSellAllGoods(): EntityInventory[];
1931
+ afterSellAllItems(): EntityInventory[];
1785
1932
  }
1786
1933
 
1787
1934
  /**
@@ -1873,8 +2020,8 @@ interface Deal {
1873
2020
  origin: Location;
1874
2021
  /** Destination location */
1875
2022
  destination: Location;
1876
- /** Good to trade */
1877
- good: GoodPrice;
2023
+ /** Item to trade */
2024
+ item: ItemPrice;
1878
2025
  /** Distance between origin and destination */
1879
2026
  distance: UInt64;
1880
2027
  /** Available supply at origin */
@@ -1918,11 +2065,11 @@ interface FindDealsOptions {
1918
2065
  /**
1919
2066
  * Calculate deals for a ship from a specific origin location
1920
2067
  */
1921
- declare function findDealsForShip(ship: Ship, originLocation: Coordinates, getNearbyLocations: (origin: Coordinates, maxDistance: number) => Promise<Location[]>, getMarketPrices: (location: Coordinates) => Promise<GoodPrice[]>, options?: FindDealsOptions): Promise<Deal[]>;
2068
+ declare function findDealsForShip(ship: Ship, originLocation: Coordinates, getNearbyLocations: (origin: Coordinates, maxDistance: number) => Promise<Location[]>, getMarketPrices: (location: Coordinates) => Promise<ItemPrice[]>, options?: FindDealsOptions): Promise<Deal[]>;
1922
2069
  /**
1923
2070
  * Find the single best deal for a ship from a specific origin location
1924
2071
  */
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>;
2072
+ declare function findBestDeal(ship: Ship, originLocation: Coordinates, getNearbyLocations: (origin: Coordinates, maxDistance: number) => Promise<Location[]>, getMarketPrices: (location: Coordinates) => Promise<ItemPrice[]>, options?: FindDealsOptions): Promise<Deal | undefined>;
1926
2073
 
1927
2074
  /**
1928
2075
  * Types of collect actions available to the player
@@ -1973,7 +2120,7 @@ interface CollectOption {
1973
2120
  /** Detailed breakdown of travel time components */
1974
2121
  travelTimeBreakdown?: EstimatedTravelTime;
1975
2122
  /** Info about a discounted good at the destination (for explore options) */
1976
- discountedGood?: DiscountedGoodInfo;
2123
+ discountedGood?: DiscountedItemInfo;
1977
2124
  /** Top potential deals available at destination (for explore options) */
1978
2125
  potentialDeals?: PotentialDeal[];
1979
2126
  /** Details of cargo being sold (if selling cargo) */
@@ -2086,7 +2233,7 @@ interface CargoSaleItem {
2086
2233
  /**
2087
2234
  * Info about a discounted good for explore options
2088
2235
  */
2089
- interface DiscountedGoodInfo {
2236
+ interface DiscountedItemInfo {
2090
2237
  goodId: number;
2091
2238
  name: string;
2092
2239
  rarity: string;
@@ -2105,13 +2252,13 @@ interface PotentialDeal {
2105
2252
  /**
2106
2253
  * Create an "Explore" option (travel to find opportunities)
2107
2254
  */
2108
- declare function createExploreOption(destination: Location, travelTime?: UInt32, discountedGood?: DiscountedGoodInfo, travelTimeBreakdown?: EstimatedTravelTime, potentialDeals?: PotentialDeal[]): CollectOption;
2255
+ declare function createExploreOption(destination: Location, travelTime?: UInt32, discountedGood?: DiscountedItemInfo, travelTimeBreakdown?: EstimatedTravelTime, potentialDeals?: PotentialDeal[]): CollectOption;
2109
2256
  /**
2110
2257
  * Callbacks for collect analysis (provided by manager)
2111
2258
  */
2112
2259
  interface CollectAnalysisCallbacks {
2113
2260
  getNearbyLocations: (origin: Coordinates, maxDistance: number) => Promise<Location[]>;
2114
- getMarketPrices: (location: Coordinates) => Promise<GoodPrice[]>;
2261
+ getMarketPrices: (location: Coordinates) => Promise<ItemPrice[]>;
2115
2262
  getGameSeed?: () => Checksum256Type;
2116
2263
  getState?: () => Types.state_row;
2117
2264
  }
@@ -2142,7 +2289,7 @@ declare class EpochsManager extends BaseManager {
2142
2289
  }
2143
2290
 
2144
2291
  interface SellableCargo {
2145
- good_id: {
2292
+ item_id: {
2146
2293
  toNumber(): number;
2147
2294
  } | number;
2148
2295
  quantity: {
@@ -2161,8 +2308,8 @@ declare class ActionsManager extends BaseManager {
2161
2308
  cancel(entityId: UInt64Type, count: UInt64Type, entityType?: EntityTypeName): Action;
2162
2309
  recharge(shipId: UInt64Type): Action;
2163
2310
  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;
2311
+ buyItems(entityId: UInt64Type, goodId: UInt64Type, quantity: UInt64Type, entityType?: EntityTypeName): Action;
2312
+ sellItems(entityId: UInt64Type, goodId: UInt64Type, quantity: UInt64Type, entityType?: EntityTypeName): Action;
2166
2313
  buyShip(account: NameType, name: string): Action;
2167
2314
  buyWarehouse(account: NameType, shipId: UInt64Type, name: string): Action;
2168
2315
  buyContainer(account: NameType, shipId: UInt64Type, name: string): Action;
@@ -2171,6 +2318,7 @@ declare class ActionsManager extends BaseManager {
2171
2318
  foundCompany(account: NameType, name: string): Action;
2172
2319
  join(account: NameType): Action;
2173
2320
  extract(shipId: UInt64Type): Action;
2321
+ warp(shipId: UInt64Type, destination: CoordinatesType): Action;
2174
2322
  joinGame(account: NameType, companyName: string): Action[];
2175
2323
  sellAllCargo(ship: Ship | UInt64Type, cargo?: SellableCargo[]): Action[];
2176
2324
  }
@@ -2241,7 +2389,7 @@ declare class Warehouse extends Types.entity_info {
2241
2389
  get availableCapacity(): UInt64;
2242
2390
  hasSpace(goodMass: UInt64, quantity: number): boolean;
2243
2391
  get isFull(): boolean;
2244
- getCargoForGood(goodId: UInt64Type): EntityInventory | undefined;
2392
+ getCargoForItem(goodId: UInt64Type): EntityInventory | undefined;
2245
2393
  get orbitalAltitude(): number;
2246
2394
  }
2247
2395
 
@@ -2323,9 +2471,9 @@ declare function makeShip(state: ShipStateInput): Ship;
2323
2471
  declare function makeWarehouse(state: WarehouseStateInput): Warehouse;
2324
2472
  declare function makeContainer(state: ContainerStateInput): Container;
2325
2473
 
2326
- declare const goodIds: number[];
2327
- declare function getGood(goodId: UInt16Type): Good;
2328
- declare function getGoods(): Good[];
2474
+ declare const itemIds: UInt16[];
2475
+ declare function getItem(itemId: UInt16Type): Item;
2476
+ declare function getItems(): Item[];
2329
2477
 
2330
2478
  declare enum Rarities {
2331
2479
  legendary = "LEGENDARY",
@@ -2341,8 +2489,8 @@ interface Rarity {
2341
2489
  maxMultiplier: number;
2342
2490
  }
2343
2491
  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[];
2492
+ declare function marketPrice(location: ActionParams.Type.coordinates, goodId: UInt16Type, gameSeed: Checksum256Type, state: Types.state_row): ItemPrice;
2493
+ declare function marketPrices(location: ActionParams.Type.coordinates, gameSeed: Checksum256Type, state: Types.state_row): ItemPrice[];
2346
2494
 
2347
2495
  declare function getLocationType(gameSeed: Checksum256Type, coordinates: CoordinatesType): LocationType;
2348
2496
  declare function isExtractableLocation(locationType: LocationType): boolean;
@@ -2351,7 +2499,43 @@ declare function hasSystem(gameSeed: Checksum256Type, coordinates: CoordinatesTy
2351
2499
  declare function deriveLocationStatic(gameSeed: Checksum256Type, coordinates: CoordinatesType): Types.location_static;
2352
2500
  declare function deriveLocationEpoch(epochSeed: Checksum256Type, coordinates: CoordinatesType): Types.location_epoch;
2353
2501
  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;
2502
+
2503
+ interface StratumInfo {
2504
+ itemId: number;
2505
+ seed: bigint;
2506
+ richness: number;
2507
+ reserve: number;
2508
+ }
2509
+ interface ResourceStats {
2510
+ purity: number;
2511
+ density: number;
2512
+ reactivity: number;
2513
+ resonance: number;
2514
+ }
2515
+ declare function deriveStratum(epochSeed: Checksum256Type, coords: CoordinatesType, stratum: number, locationType: number, subtype: number, _maxDepth: number): StratumInfo;
2516
+ declare function deriveResourceStats(seed: bigint): ResourceStats;
2517
+
2518
+ declare function deriveLocationSize(loc: Types.location_static): number;
2519
+
2520
+ declare const DEPTH_THRESHOLD_COMMON = 0;
2521
+ declare const DEPTH_THRESHOLD_UNCOMMON = 2000;
2522
+ declare const DEPTH_THRESHOLD_RARE = 10000;
2523
+ declare const DEPTH_THRESHOLD_EPIC = 30000;
2524
+ declare const DEPTH_THRESHOLD_LEGENDARY = 55000;
2525
+ declare const LOCATION_MIN_DEPTH = 500;
2526
+ declare const LOCATION_MAX_DEPTH = 65535;
2527
+ declare const PLANET_SUBTYPE_GAS_GIANT = 0;
2528
+ declare const PLANET_SUBTYPE_ROCKY = 1;
2529
+ declare const PLANET_SUBTYPE_TERRESTRIAL = 2;
2530
+ declare const PLANET_SUBTYPE_ICY = 3;
2531
+ declare const PLANET_SUBTYPE_OCEAN = 4;
2532
+ declare const PLANET_SUBTYPE_INDUSTRIAL = 5;
2533
+ declare function getDepthThreshold(rarity: ResourceRarity): number;
2534
+ declare function getResourceRarity(itemId: number): ResourceRarity;
2535
+ declare function getResourceWeight(itemId: number, stratum: number): number;
2536
+ declare function getLocationCandidates(locationType: number, subtype: number): number[];
2537
+ declare function getEligibleResources(locationType: number, subtype: number, stratum: number): number[];
2538
+ declare function depthScaleFactor(stratum: number): number;
2355
2539
 
2356
2540
  declare function hash(seed: Checksum256Type, string: string): Checksum256;
2357
2541
  declare function hash512(seed: Checksum256Type, string: string): Checksum512;
@@ -2391,7 +2575,7 @@ declare function calculateUpdatedCargoCost(currentPaid: UInt64, currentOwned: UI
2391
2575
  * Calculate the maximum quantity of a good a ship can buy
2392
2576
  * considering both space and player balance
2393
2577
  */
2394
- declare function calculateMaxTradeQuantity(ship: Ship, player: Player, goodPrice: GoodPrice): TradeCalculation;
2578
+ declare function calculateMaxTradeQuantity(ship: Ship, player: Player, goodPrice: ItemPrice): TradeCalculation;
2395
2579
  /**
2396
2580
  * Trade profit calculation result
2397
2581
  */
@@ -2416,8 +2600,8 @@ declare function calculateProfitPerSecond(profit: Int64Type, travelTimeSeconds:
2416
2600
  /**
2417
2601
  * Find the best good to trade between two locations
2418
2602
  */
2419
- declare function findBestGoodToTrade(ship: Ship, player: Player, originPrices: GoodPrice[], destPrices: GoodPrice[], travelTimeSeconds: UInt32Type): {
2420
- good: GoodPrice;
2603
+ declare function findBestItemToTrade(ship: Ship, player: Player, originPrices: ItemPrice[], destPrices: ItemPrice[], travelTimeSeconds: UInt32Type): {
2604
+ item: ItemPrice;
2421
2605
  quantity: number;
2422
2606
  profit: number;
2423
2607
  profitPerSecond: number;
@@ -2467,7 +2651,7 @@ declare function needsRecharge(entity: MovementCapability & EnergyCapability): b
2467
2651
 
2468
2652
  declare function calcLoadDuration(entity: LoaderCapability, cargoMass: UInt64): UInt32;
2469
2653
 
2470
- declare function calc_extraction_duration(extractor: Types.extractor_stats, loaders: Types.loader_stats, shipZ: number, batchMass: number): UInt32;
2654
+ declare function calc_extraction_duration(extractor: Types.extractor_stats, cargoMass: number, stratum: number, richness: number): UInt32;
2471
2655
  declare function calc_extraction_energy(extractor: Types.extractor_stats, duration: number): UInt16;
2472
2656
 
2473
2657
  type movement_stats = Types.movement_stats;
@@ -2478,11 +2662,9 @@ type cargo_item = Types.cargo_item;
2478
2662
  type warehouse_row = Types.warehouse_row;
2479
2663
  type container_row = Types.container_row;
2480
2664
  type extractor_stats = Types.extractor_stats;
2481
- type mixture_info = Types.mixture_info;
2482
- type mixture_component = Types.mixture_component;
2483
2665
  type location_static = Types.location_static;
2484
2666
  type location_epoch = Types.location_epoch;
2485
2667
  type location_derived = Types.location_derived;
2486
2668
  type location_row = Types.location_row;
2487
2669
 
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 };
2670
+ export { ActionsManager, AnyEntity, BetterSaleLocation, COMMIT_ALREADY_SET, COMMIT_CANNOT_MATCH, COMMIT_NOT_SET, COMPANY_NOT_FOUND, CONTAINER_Z, CargoData, CargoMassInfo, CargoSaleItem, CollectActionType, CollectAnalysis, CollectAnalysisCallbacks, CollectAnalysisOptions, CollectOption, Container, ContainerEntity, ContainerStateInput, Coordinates, CoordinatesType, DEPTH_THRESHOLD_COMMON, DEPTH_THRESHOLD_EPIC, DEPTH_THRESHOLD_LEGENDARY, DEPTH_THRESHOLD_RARE, DEPTH_THRESHOLD_UNCOMMON, Deal, DiscountedItemInfo, Distance, EPOCH_NON_ZERO, EPOCH_NOT_READY, ERROR_SYSTEM_ALREADY_INITIALIZED, ERROR_SYSTEM_DISABLED, ERROR_SYSTEM_NOT_INITIALIZED, EnergyCapability, EntitiesManager, Entity, EntityCapabilities, EntityInventory, EntityRefInput, EntityState, EntityType, EntityTypeName, EpochInfo, EpochsManager, EstimateTravelTimeOptions, EstimatedTravelTime, ExtractorCapability, FindDealsOptions, GAME_NOT_FOUND, GAME_SEED_NOT_SET, GameState, HasCapacity, HasCargo, HasCargomass, HasScheduleAndLocation, INITIAL_CONTAINER_CAPACITY, INITIAL_CONTAINER_HULLMASS, INITIAL_EXTRACTOR_DRAIN, INITIAL_EXTRACTOR_EFFICIENCY, INITIAL_EXTRACTOR_RATE, INITIAL_LOADER_MASS, INITIAL_LOADER_QUANTITY, INITIAL_LOADER_THRUST, INITIAL_SHIP_CAPACITY, INITIAL_SHIP_DRAIN, INITIAL_SHIP_ENERGY, INITIAL_SHIP_GENERATOR_CAPACITY, INITIAL_SHIP_HULLMASS, INITIAL_SHIP_MASS, INITIAL_SHIP_RECHARGE, INITIAL_SHIP_THRUST, INITIAL_SHIP_Z, INITIAL_WAREHOUSE_CAPACITY, INSUFFICIENT_BALANCE, INSUFFICIENT_ITEM_QUANTITY, INSUFFICIENT_ITEM_SUPPLY, INVALID_AMOUNT, ITEM_DOES_NOT_EXIST, ITEM_NOT_AVAILABLE_AT_LOCATION, InventoryAccessor, Item, ItemPrice, LOCATION_MAX_DEPTH, LOCATION_MIN_DEPTH, LoadTimeBreakdown, LoaderCapability, Location, LocationType, LocationsManager, MAX_ORBITAL_ALTITUDE, MIN_ORBITAL_ALTITUDE, MassCapability, MovementCapability, NO_SCHEDULE, PLANET_SUBTYPE_GAS_GIANT, PLANET_SUBTYPE_ICY, PLANET_SUBTYPE_INDUSTRIAL, PLANET_SUBTYPE_OCEAN, PLANET_SUBTYPE_ROCKY, PLANET_SUBTYPE_TERRESTRIAL, PLAYER_ALREADY_JOINED, PLAYER_NOT_FOUND, PRECISION, platform as PlatformContract, Player, PlayerStateInput, PlayersManager, PotentialDeal, Projectable, ProjectedEntity, REQUIRES_MORE_THAN_ONE, REQUIRES_POSITIVE_VALUE, Rarities, Rarity, RepositionLocation, ResourceCategory, ResourceRarity, ResourceStats, SHIP_ALREADY_THERE, SHIP_ALREADY_TRAVELING, SHIP_CANNOT_BUY_TRAVELING, SHIP_CANNOT_CANCEL_TASK, SHIP_CANNOT_UPDATE_TRAVELING, SHIP_CARGO_NOT_LOADED, SHIP_CARGO_NOT_OWNED, SHIP_INVALID_CARGO, SHIP_INVALID_DESTINATION, SHIP_INVALID_TRAVEL_DURATION, SHIP_NOT_ARRIVED, SHIP_NOT_ENOUGH_ENERGY, SHIP_NOT_ENOUGH_ENERGY_CAPACITY, SHIP_NOT_FOUND, SHIP_NOT_IDLE, SHIP_NOT_OWNED, SHIP_NO_COMPLETED_TASKS, SHIP_NO_TASKS_TO_CANCEL, ScheduleAccessor, ScheduleCapability, ScheduleData, Scheduleable, server as ServerContract, Ship, ShipEntity, ShipLike, ShipStateInput, Shipload, StorageCapability, StratumInfo, TRAVEL_MAX_DURATION, TaskCancelable, TaskType, TradeCalculation, TradeCapability, TradeProfitResult, TradesManager, TransferEntity, WAREHOUSE_ALREADY_AT_LOCATION, WAREHOUSE_CAPACITY_EXCEEDED, WAREHOUSE_NOT_FOUND, WAREHOUSE_Z, Warehouse, WarehouseEntity, WarehouseStateInput, analyzeCargoSale, analyzeCollectOptions, availableCapacity$1 as availableCapacity, availableCapacityFromMass, calcCargoMass, calcCargoValue, calcEnergyUsage, calcLoadDuration, calc_acceleration, calc_energyusage, calc_extraction_duration, calc_extraction_energy, calc_flighttime, calc_loader_acceleration, calc_loader_flighttime, calc_orbital_altitude, calc_rechargetime, calc_ship_acceleration, calc_ship_flighttime, calc_ship_mass, calc_ship_rechargetime, calc_transfer_duration, calculateBreakEvenPrice, calculateFlightTime, calculateLoadTimeBreakdown, calculateMaxTradeQuantity, calculateProfitPerMass, calculateProfitPerSecond, calculateROI, calculateRefuelingTime, calculateTradeProfit, calculateTransferTime, calculateUpdatedCargoCost, canMove, capsHasExtractor, capsHasLoaders, capsHasMass, capsHasMovement, capsHasStorage, capsHasTrade, cargoUtils, cargo_item, container_row, coordsToLocationId, createExploreOption, createInventoryAccessor, createProjectedEntity, createScheduleAccessor, createSellAndRepositionOption, createSellAndStayOption, createSellAndTradeOption, createTravelToSellOption, Shipload as default, depthScaleFactor, deriveLocation, deriveLocationEpoch, deriveLocationSize, deriveLocationStatic, deriveResourceStats, deriveStratum, distanceBetweenCoordinates, distanceBetweenPoints, energyPercent, energy_stats, estimateDealTravelTime, estimateTravelTime, extractor_stats, findBestDeal, findBestItemToTrade, findDealsForShip, findNearbyPlanets, getCurrentEpoch, getDepthThreshold, getDestinationLocation, getEligibleResources, getEpochInfo, getFlightOrigin, getItem, getItems, getLocationCandidates, getLocationType, getPositionAt, getRarity, getResourceRarity, getResourceWeight, getSystemName, hasEnergy, hasEnergyForDistance, hasExtractor, hasLoaders, hasMass, hasSchedule, hasSpace$1 as hasSpace, hasSpaceForMass, hasStorage, hasSystem, hasTrade, hash, hash512, isExtractableLocation, isFull$1 as isFull, isFullFromMass, isProfitable, itemIds, lerp, loader_stats, location_derived, location_epoch, location_row, location_static, makeContainer, makeShip, makeWarehouse, marketPrice, marketPrices, maxTravelDistance, movement_stats, needsRecharge, projectEntity, projectEntityAt, rotation, schedule, task, toLocation, warehouse_row };