@shipload/sdk 2.0.0-rc1 → 2.0.0-rc10

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 (74) hide show
  1. package/lib/shipload.d.ts +1591 -1101
  2. package/lib/shipload.js +6735 -3491
  3. package/lib/shipload.js.map +1 -1
  4. package/lib/shipload.m.js +6421 -3275
  5. package/lib/shipload.m.js.map +1 -1
  6. package/package.json +6 -6
  7. package/src/capabilities/crafting.ts +26 -0
  8. package/src/capabilities/extraction.ts +36 -0
  9. package/src/capabilities/guards.ts +38 -0
  10. package/src/capabilities/hauling.ts +22 -0
  11. package/src/capabilities/index.ts +8 -0
  12. package/src/capabilities/loading.ts +8 -0
  13. package/src/capabilities/modules.ts +57 -0
  14. package/src/capabilities/movement.ts +29 -0
  15. package/src/capabilities/storage.ts +72 -0
  16. package/src/contracts/server.ts +890 -309
  17. package/src/data/capabilities.ts +408 -0
  18. package/src/data/categories.ts +58 -0
  19. package/src/data/colors.ts +52 -0
  20. package/src/data/items.json +17 -0
  21. package/src/data/locations.ts +53 -0
  22. package/src/data/nebula-adjectives.json +211 -0
  23. package/src/data/nebula-nouns.json +151 -0
  24. package/src/data/recipes.ts +571 -0
  25. package/src/data/syllables.json +1386 -780
  26. package/src/data/tiers.ts +45 -0
  27. package/src/derivation/crafting.ts +197 -0
  28. package/src/derivation/index.ts +28 -0
  29. package/src/derivation/location-size.ts +15 -0
  30. package/src/derivation/resources.ts +142 -0
  31. package/src/derivation/stats.ts +146 -0
  32. package/src/derivation/stratum.ts +118 -0
  33. package/src/entities/cargo-utils.ts +46 -9
  34. package/src/entities/container.ts +106 -0
  35. package/src/entities/entity-inventory.ts +13 -13
  36. package/src/entities/inventory-accessor.ts +42 -0
  37. package/src/entities/location.ts +7 -188
  38. package/src/entities/makers.ts +72 -0
  39. package/src/entities/player.ts +1 -273
  40. package/src/entities/ship-deploy.ts +263 -0
  41. package/src/entities/ship.ts +93 -453
  42. package/src/entities/warehouse.ts +34 -148
  43. package/src/errors.ts +4 -4
  44. package/src/index-module.ts +225 -42
  45. package/src/managers/actions.ts +107 -78
  46. package/src/managers/context.ts +0 -9
  47. package/src/managers/entities.ts +22 -5
  48. package/src/managers/index.ts +0 -1
  49. package/src/managers/locations.ts +15 -79
  50. package/src/market/items.ts +30 -0
  51. package/src/nft/description.ts +175 -0
  52. package/src/nft/deserializers.ts +81 -0
  53. package/src/nft/index.ts +2 -0
  54. package/src/resolution/resolve-item.ts +313 -0
  55. package/src/scheduling/accessor.ts +82 -0
  56. package/src/scheduling/projection.ts +158 -54
  57. package/src/scheduling/schedule.ts +24 -0
  58. package/src/shipload.ts +0 -5
  59. package/src/travel/travel.ts +93 -19
  60. package/src/types/capabilities.ts +71 -0
  61. package/src/types/entity-traits.ts +69 -0
  62. package/src/types/entity.ts +39 -0
  63. package/src/types/index.ts +3 -0
  64. package/src/types.ts +76 -33
  65. package/src/utils/hash.ts +1 -1
  66. package/src/utils/system.ts +139 -11
  67. package/src/data/goods.json +0 -23
  68. package/src/managers/trades.ts +0 -119
  69. package/src/market/goods.ts +0 -31
  70. package/src/market/market.ts +0 -209
  71. package/src/market/rolls.ts +0 -8
  72. package/src/trading/collect.ts +0 -939
  73. package/src/trading/deal.ts +0 -208
  74. 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, Int64, UInt8, TimePoint, UInt8Type, TimePointType, Int64Type, UInt16Type, Checksum512, APIClient } from '@wharfkit/antelope';
2
+ import { Blob, ABI, Struct, Name, UInt64, Checksum256, UInt32, TimePointSec, Checksum256Type, UInt32Type, NameType, UInt64Type, Action, 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,68 +158,69 @@ 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 buygoods extends Struct {
166
- ship_id: UInt64;
167
- good_id: UInt16;
168
- quantity: UInt32;
177
+ class cargo_seed extends Struct {
178
+ item_id: UInt16;
179
+ seed: UInt64;
169
180
  }
170
- class buyship extends Struct {
171
- account: Name;
172
- name: string;
181
+ class module_entry extends Struct {
182
+ type: UInt8;
183
+ installed?: cargo_seed;
173
184
  }
174
- class buywarehouse extends Struct {
175
- account: Name;
176
- ship_id: UInt64;
177
- name: string;
185
+ class cargo_item extends Struct {
186
+ item_id: UInt16;
187
+ quantity: UInt32;
188
+ seed?: UInt64;
189
+ modules: module_entry[];
190
+ }
191
+ class blend extends Struct {
192
+ entity_type: Name;
193
+ id: UInt64;
194
+ inputs: cargo_item[];
178
195
  }
179
196
  class cancel extends Struct {
180
197
  entity_type: Name;
181
198
  id: UInt64;
182
199
  count: UInt64;
183
200
  }
184
- class coordinates extends Struct {
185
- x: Int64;
186
- y: Int64;
187
- z?: UInt16;
188
- }
189
- class cargo_item extends Struct {
190
- good_id: UInt16;
191
- quantity: UInt32;
192
- unit_cost: UInt64;
193
- }
194
- class task extends Struct {
195
- type: UInt8;
196
- duration: UInt32;
197
- cancelable: UInt8;
198
- location?: coordinates;
199
- cargo: cargo_item[];
200
- entity?: UInt64;
201
- credits?: Int64;
202
- }
203
- class cancel_log extends Struct {
204
- owner: Name;
201
+ class entity_ref extends Struct {
205
202
  entity_type: Name;
206
203
  entity_id: UInt64;
207
- task_index: UInt8;
208
- task: task;
209
- started_at: TimePoint;
210
204
  }
211
205
  class cancel_results extends Struct {
212
206
  entity_id: UInt64;
213
207
  entity_type: Name;
214
208
  cancelled_count: UInt8;
215
209
  schedule_started?: TimePoint;
210
+ entitygroup?: UInt64;
211
+ group_members?: entity_ref[];
216
212
  }
217
213
  class cargo_row extends Struct {
218
214
  id: UInt64;
219
215
  entity_id: UInt64;
220
- good_id: UInt64;
216
+ item_id: UInt64;
221
217
  quantity: UInt64;
222
- unit_cost: UInt64;
218
+ seed: UInt64;
219
+ modules: module_entry[];
220
+ }
221
+ class cleanrsvp extends Struct {
222
+ epoch: UInt64;
223
+ max_rows: UInt64;
223
224
  }
224
225
  class cleartable extends Struct {
225
226
  table_name: Name;
@@ -229,6 +230,82 @@ declare namespace Types {
229
230
  class commit extends Struct {
230
231
  commit: Checksum256;
231
232
  }
233
+ class entity_defaults extends Struct {
234
+ warehouse_capacity: UInt32;
235
+ warehouse_z: UInt16;
236
+ container_hullmass: UInt32;
237
+ container_capacity: UInt32;
238
+ container_z: UInt16;
239
+ }
240
+ class item_def extends Struct {
241
+ id: UInt16;
242
+ mass: UInt32;
243
+ type: UInt8;
244
+ subtype: UInt8;
245
+ tier: UInt8;
246
+ }
247
+ class game_config extends Struct {
248
+ version: UInt32;
249
+ defaults: entity_defaults;
250
+ items: item_def[];
251
+ }
252
+ class configlog extends Struct {
253
+ config: game_config;
254
+ }
255
+ class coordinates extends Struct {
256
+ x: Int64;
257
+ y: Int64;
258
+ z?: UInt16;
259
+ }
260
+ class task extends Struct {
261
+ type: UInt8;
262
+ duration: UInt32;
263
+ cancelable: UInt8;
264
+ coordinates?: coordinates;
265
+ cargo: cargo_item[];
266
+ entitytarget?: entity_ref;
267
+ entitygroup?: UInt64;
268
+ energy_cost?: UInt16;
269
+ }
270
+ class schedule extends Struct {
271
+ started: TimePoint;
272
+ tasks: task[];
273
+ }
274
+ class container_row extends Struct {
275
+ id: UInt64;
276
+ owner: Name;
277
+ name: string;
278
+ coordinates: coordinates;
279
+ hullmass: UInt32;
280
+ capacity: UInt32;
281
+ cargomass: UInt32;
282
+ schedule?: schedule;
283
+ }
284
+ class craft extends Struct {
285
+ entity_type: Name;
286
+ id: UInt64;
287
+ recipe_id: UInt16;
288
+ quantity: UInt32;
289
+ inputs: cargo_item[];
290
+ }
291
+ class crafter_stats extends Struct {
292
+ speed: UInt16;
293
+ drain: UInt16;
294
+ }
295
+ class createentity extends Struct {
296
+ owner: Name;
297
+ entity_type: Name;
298
+ entity_name: string;
299
+ x: Int64;
300
+ y: Int64;
301
+ }
302
+ class deploy extends Struct {
303
+ entity_type: Name;
304
+ id: UInt64;
305
+ packed_item_id: UInt16;
306
+ seed: UInt64;
307
+ entity_name: string;
308
+ }
232
309
  class enable extends Struct {
233
310
  enabled: boolean;
234
311
  }
@@ -236,6 +313,10 @@ declare namespace Types {
236
313
  capacity: UInt16;
237
314
  recharge: UInt16;
238
315
  }
316
+ class entity_current_state extends Struct {
317
+ coordinates: coordinates;
318
+ energy: UInt16;
319
+ }
239
320
  class loader_stats extends Struct {
240
321
  mass: UInt32;
241
322
  thrust: UInt16;
@@ -245,24 +326,38 @@ declare namespace Types {
245
326
  thrust: UInt32;
246
327
  drain: UInt16;
247
328
  }
248
- class schedule extends Struct {
249
- started: TimePoint;
250
- tasks: task[];
329
+ class extractor_stats extends Struct {
330
+ rate: UInt16;
331
+ drain: UInt16;
332
+ depth: UInt16;
333
+ drill: UInt16;
334
+ }
335
+ class hauler_stats extends Struct {
336
+ capacity: UInt8;
337
+ efficiency: UInt16;
338
+ drain: UInt16;
339
+ }
340
+ class warp_stats extends Struct {
341
+ range: UInt32;
251
342
  }
252
343
  class entity_info extends Struct {
253
344
  type: Name;
254
345
  id: UInt64;
255
346
  owner: Name;
256
347
  entity_name: string;
257
- location: coordinates;
348
+ coordinates: coordinates;
258
349
  cargomass: UInt32;
259
350
  cargo: cargo_item[];
260
351
  loaders?: loader_stats;
261
352
  energy?: UInt16;
262
- mass?: UInt32;
353
+ hullmass?: UInt32;
263
354
  engines?: movement_stats;
264
355
  generator?: energy_stats;
265
356
  capacity?: UInt32;
357
+ extractor?: extractor_stats;
358
+ hauler?: hauler_stats;
359
+ warp?: warp_stats;
360
+ crafter?: crafter_stats;
266
361
  is_idle: boolean;
267
362
  current_task?: task;
268
363
  current_task_elapsed: UInt32;
@@ -271,16 +366,12 @@ declare namespace Types {
271
366
  idle_at?: TimePoint;
272
367
  schedule?: schedule;
273
368
  }
274
- class entity_state extends Struct {
275
- location: coordinates;
276
- energy: UInt16;
277
- }
278
369
  class entity_summary extends Struct {
279
370
  type: Name;
280
371
  id: UInt64;
281
372
  owner: Name;
282
373
  entity_name: string;
283
- location: coordinates;
374
+ coordinates: coordinates;
284
375
  is_idle: boolean;
285
376
  resolved_count: UInt32;
286
377
  pending_count: UInt32;
@@ -291,6 +382,18 @@ declare namespace Types {
291
382
  task_count: UInt8;
292
383
  schedule_started: TimePoint;
293
384
  }
385
+ class entitygroup_row extends Struct {
386
+ id: UInt64;
387
+ participants: entity_ref[];
388
+ }
389
+ class extract extends Struct {
390
+ entity_type: Name;
391
+ id: UInt64;
392
+ stratum: UInt16;
393
+ quantity: UInt32;
394
+ }
395
+ class getconfig extends Struct {
396
+ }
294
397
  class getentities extends Struct {
295
398
  owner: Name;
296
399
  entity_type?: Name;
@@ -299,31 +402,53 @@ declare namespace Types {
299
402
  entity_type: Name;
300
403
  entity_id: UInt64;
301
404
  }
302
- class getgoods extends Struct {
405
+ class getitemdata extends Struct {
406
+ }
407
+ class getitems extends Struct {
303
408
  }
304
409
  class getlocation extends Struct {
305
410
  x: Int64;
306
411
  y: Int64;
307
412
  }
413
+ class getlocdata extends Struct {
414
+ x: Int64;
415
+ y: Int64;
416
+ }
417
+ class getmodules extends Struct {
418
+ }
308
419
  class getnearby extends Struct {
309
420
  entity_type: Name;
310
421
  entity_id: UInt64;
311
422
  recharge: boolean;
312
423
  }
424
+ class getnftinfo extends Struct {
425
+ }
313
426
  class getplayer extends Struct {
314
427
  account: Name;
315
428
  }
429
+ class getrecipe extends Struct {
430
+ output_item_id: UInt16;
431
+ }
432
+ class getrecipes extends Struct {
433
+ lower_bound: UInt16;
434
+ limit: UInt8;
435
+ }
436
+ class getresources extends Struct {
437
+ }
438
+ class getstratum extends Struct {
439
+ x: Int64;
440
+ y: Int64;
441
+ stratum: UInt16;
442
+ }
316
443
  class getsummaries extends Struct {
317
444
  owner: Name;
318
445
  entity_type?: Name;
319
446
  }
320
- class good extends Struct {
321
- id: UInt16;
322
- base_price: UInt32;
323
- mass: UInt32;
324
- }
325
- class goods_info extends Struct {
326
- goods: good[];
447
+ class grouptravel extends Struct {
448
+ entities: entity_ref[];
449
+ x: Int64;
450
+ y: Int64;
451
+ recharge: boolean;
327
452
  }
328
453
  class hash extends Struct {
329
454
  value: string;
@@ -334,48 +459,81 @@ declare namespace Types {
334
459
  class init extends Struct {
335
460
  seed: Checksum256;
336
461
  }
462
+ class recipe_input extends Struct {
463
+ item_id: UInt16;
464
+ category: UInt8;
465
+ quantity: UInt32;
466
+ }
467
+ class stat_source extends Struct {
468
+ input_index: UInt8;
469
+ input_stat_index: UInt8;
470
+ }
471
+ class stat_slot_response extends Struct {
472
+ sources: stat_source[];
473
+ }
474
+ class recipe_item_info extends Struct {
475
+ id: UInt16;
476
+ mass: UInt32;
477
+ }
478
+ class recipe_response extends Struct {
479
+ output_item_id: UInt16;
480
+ output_mass: UInt32;
481
+ inputs: recipe_input[];
482
+ stat_slots: stat_slot_response[];
483
+ blend_weights: Bytes;
484
+ output_item: recipe_item_info;
485
+ input_items: recipe_item_info[];
486
+ }
487
+ class recipes_result extends Struct {
488
+ recipes: recipe_response[];
489
+ }
490
+ class itemdata_result extends Struct {
491
+ items: item_def[];
492
+ recipes: recipes_result;
493
+ }
494
+ class items_info extends Struct {
495
+ items: item_def[];
496
+ }
337
497
  class join extends Struct {
338
498
  account: Name;
339
499
  }
340
- class location_good extends Struct {
341
- id: UInt16;
342
- price: UInt32;
343
- supply: UInt16;
344
- rarity_multiplier: UInt32;
345
- location_multiplier: UInt32;
500
+ class location_static extends Struct {
501
+ coords: coordinates;
502
+ type: UInt8;
503
+ subtype: UInt8;
504
+ seed0: UInt8;
505
+ seed1: UInt8;
506
+ }
507
+ class location_epoch extends Struct {
508
+ active: boolean;
509
+ seed0: UInt8;
510
+ seed1: UInt8;
511
+ }
512
+ class location_derived extends Struct {
513
+ static_props: location_static;
514
+ epoch_props: location_epoch;
515
+ size: UInt16;
346
516
  }
347
517
  class location_info extends Struct {
348
518
  coords: coordinates;
349
519
  is_system: boolean;
350
- goods: location_good[];
351
520
  }
352
521
  class location_row extends Struct {
353
522
  id: UInt64;
523
+ owner: Name;
354
524
  coordinates: coordinates;
355
- epoch: UInt64;
356
- good_id: UInt16;
357
- supply: UInt16;
358
- }
359
- class logcancel extends Struct {
360
- log: cancel_log;
525
+ cargomass: UInt32;
526
+ cargo: cargo_item[];
527
+ schedule?: schedule;
361
528
  }
362
- class resolve_log extends Struct {
363
- owner: Name;
364
- entity_type: Name;
365
- entity_id: UInt64;
366
- task_index: UInt8;
367
- task: task;
368
- started_at: TimePoint;
369
- completed_at: TimePoint;
370
- new_energy?: UInt16;
371
- new_location?: coordinates;
372
- cargomass_delta: Int64;
373
- cargo_added: cargo_item[];
374
- cargo_removed: cargo_item[];
375
- credits?: Int64;
529
+ class module_info extends Struct {
530
+ id: UInt16;
531
+ mass: UInt32;
532
+ module_type: UInt8;
533
+ tier: UInt8;
376
534
  }
377
- class logresolve extends Struct {
378
- log: resolve_log;
535
+ class modules_result extends Struct {
536
+ modules: module_info[];
379
537
  }
380
538
  class nearby_system extends Struct {
381
539
  distance: UInt64;
@@ -385,76 +543,150 @@ declare namespace Types {
385
543
  }
386
544
  class nearby_info extends Struct {
387
545
  can_travel: boolean;
388
- current: entity_state;
389
- projected: entity_state;
546
+ current: entity_current_state;
547
+ projected: entity_current_state;
390
548
  max_energy: UInt16;
391
549
  systems: nearby_system[];
392
550
  }
393
- class payloan extends Struct {
394
- account: Name;
395
- amount: UInt64;
551
+ class nexus_row extends Struct {
552
+ id: UInt64;
553
+ owner: Name;
554
+ name: string;
555
+ coordinates: coordinates;
556
+ }
557
+ class schema_field extends Struct {
558
+ name: string;
559
+ field_type: string;
560
+ }
561
+ class nft_schema_def extends Struct {
562
+ schema_name: Name;
563
+ fields: schema_field[];
564
+ }
565
+ class nft_template_def extends Struct {
566
+ item_id: UInt16;
567
+ schema_name: Name;
568
+ }
569
+ class nftconfig_row extends Struct {
570
+ item_id: UInt16;
571
+ template_id: Int32;
572
+ schema_name: Name;
573
+ }
574
+ class nftinfo_result extends Struct {
575
+ schemas: nft_schema_def[];
576
+ templates: nft_template_def[];
577
+ }
578
+ class task_event extends Struct {
579
+ event_type: UInt8;
580
+ owner: Name;
581
+ entity_type: Name;
582
+ entity_id: UInt64;
583
+ task_index: UInt8;
584
+ task: task;
585
+ starts_at: TimePoint;
586
+ completes_at: TimePoint;
587
+ new_energy?: UInt16;
588
+ }
589
+ class notify extends Struct {
590
+ event: task_event;
396
591
  }
397
592
  class player_info extends Struct {
398
593
  owner: Name;
399
594
  is_player: boolean;
400
595
  company_name: string;
401
- balance: UInt64;
402
- debt: UInt32;
403
- networth: Int64;
404
- available_loan: UInt64;
405
- next_ship_price: UInt64;
406
- next_warehouse_price: UInt64;
407
596
  ship_count: UInt64;
408
597
  warehouse_count: UInt64;
598
+ container_count: UInt64;
409
599
  }
410
600
  class player_row extends Struct {
411
601
  owner: Name;
412
- balance: UInt64;
413
- debt: UInt32;
414
- networth: Int64;
415
- }
416
- class purgesupply extends Struct {
417
- max_rows?: UInt64;
418
602
  }
419
603
  class recharge extends Struct {
420
604
  entity_type: Name;
421
605
  id: UInt64;
422
606
  }
607
+ class reserve_row extends Struct {
608
+ id: UInt64;
609
+ remaining: UInt32;
610
+ }
423
611
  class resolve extends Struct {
424
612
  entity_type: Name;
425
613
  id: UInt64;
614
+ count?: UInt64;
426
615
  }
427
616
  class resolve_results extends Struct {
428
617
  entity_id: UInt64;
429
618
  entity_type: Name;
430
619
  resolved_count: UInt8;
431
620
  new_schedule_started?: TimePoint;
621
+ entitygroup?: UInt64;
622
+ group_members?: entity_ref[];
623
+ }
624
+ class resource_info extends Struct {
625
+ id: UInt16;
626
+ mass: UInt32;
627
+ category: UInt8;
628
+ tier: UInt8;
629
+ }
630
+ class resource_stats extends Struct {
631
+ stat1: UInt16;
632
+ stat2: UInt16;
633
+ stat3: UInt16;
634
+ }
635
+ class resources_result extends Struct {
636
+ resources: resource_info[];
637
+ }
638
+ class rmmodule extends Struct {
639
+ entity_type: Name;
640
+ entity_id: UInt64;
641
+ module_index: UInt8;
642
+ target_cargo_id: UInt64;
643
+ }
644
+ class rmnftcfg extends Struct {
645
+ item_id: UInt16;
432
646
  }
433
647
  class salt extends Struct {
434
648
  salt: UInt64;
435
649
  }
436
- class sellgoods extends Struct {
437
- ship_id: UInt64;
438
- good_id: UInt16;
439
- quantity: UInt32;
440
- }
441
650
  class sequence_row extends Struct {
442
651
  key: Name;
443
652
  value: UInt64;
444
653
  }
654
+ class setnftcfg extends Struct {
655
+ item_id: UInt16;
656
+ template_id: Int32;
657
+ schema_name: Name;
658
+ }
445
659
  class ship_row extends Struct {
446
660
  id: UInt64;
447
661
  owner: Name;
448
662
  name: string;
449
- location: coordinates;
450
- mass: UInt32;
451
- capacity: UInt32;
452
- energy: UInt16;
453
- engines: movement_stats;
454
- generator: energy_stats;
455
- loaders: loader_stats;
663
+ seed: UInt64;
664
+ coordinates: coordinates;
665
+ hullmass?: UInt32;
666
+ capacity?: UInt32;
667
+ energy?: UInt16;
668
+ cargomass: UInt32;
669
+ engines?: movement_stats;
670
+ generator?: energy_stats;
671
+ loaders?: loader_stats;
672
+ extractor?: extractor_stats;
673
+ hauler?: hauler_stats;
674
+ warp?: warp_stats;
675
+ crafter?: crafter_stats;
676
+ modules: module_entry[];
456
677
  schedule?: schedule;
457
678
  }
679
+ class spawncargo extends Struct {
680
+ entity_id: UInt64;
681
+ item_id: UInt64;
682
+ quantity: UInt64;
683
+ }
684
+ class spawnseeded extends Struct {
685
+ entity_id: UInt64;
686
+ item_id: UInt64;
687
+ quantity: UInt64;
688
+ seed: UInt64;
689
+ }
458
690
  class state_row extends Struct {
459
691
  enabled: boolean;
460
692
  epoch: UInt32;
@@ -463,9 +695,15 @@ declare namespace Types {
463
695
  seed: Checksum256;
464
696
  commit: Checksum256;
465
697
  }
466
- class takeloan extends Struct {
467
- account: Name;
468
- amount: UInt64;
698
+ class stratum_info extends Struct {
699
+ item_id: UInt16;
700
+ seed: UInt64;
701
+ richness: UInt16;
702
+ reserve: UInt32;
703
+ }
704
+ class stratum_data extends Struct {
705
+ stratum: stratum_info;
706
+ stats: resource_stats;
469
707
  }
470
708
  class task_results extends Struct {
471
709
  entities: entity_task_info[];
@@ -475,7 +713,7 @@ declare namespace Types {
475
713
  source_id: UInt64;
476
714
  dest_type: Name;
477
715
  dest_id: UInt64;
478
- good_id: UInt16;
716
+ item_id: UInt16;
479
717
  quantity: UInt32;
480
718
  }
481
719
  class travel extends Struct {
@@ -488,33 +726,48 @@ declare namespace Types {
488
726
  class types_row extends Struct {
489
727
  id: UInt64;
490
728
  entity_summary_type: entity_summary;
491
- }
492
- class updatecredit extends Struct {
493
- account: Name;
494
- amount: Int64;
495
- }
496
- class updatedebt extends Struct {
497
- account: Name;
498
- amount: Int64;
729
+ game_config_type: game_config;
499
730
  }
500
731
  class warehouse_row extends Struct {
501
732
  id: UInt64;
502
733
  owner: Name;
503
734
  name: string;
504
- location: coordinates;
505
- capacity: UInt32;
506
- loaders: loader_stats;
735
+ seed: UInt64;
736
+ coordinates: coordinates;
737
+ hullmass?: UInt32;
738
+ capacity?: UInt32;
739
+ cargomass: UInt32;
740
+ loaders?: loader_stats;
741
+ modules: module_entry[];
507
742
  schedule?: schedule;
508
743
  }
744
+ class warp extends Struct {
745
+ entity_type: Name;
746
+ id: UInt64;
747
+ x: Int64;
748
+ y: Int64;
749
+ }
509
750
  class wipe extends Struct {
510
751
  }
511
752
  class wipesequence extends Struct {
512
753
  }
754
+ class wrap extends Struct {
755
+ owner: Name;
756
+ entity_type: Name;
757
+ entity_id: UInt64;
758
+ cargo_id: UInt64;
759
+ quantity: UInt64;
760
+ }
513
761
  }
514
762
  declare const TableMap: {
515
763
  cargo: typeof Types.cargo_row;
764
+ container: typeof Types.container_row;
765
+ entitygroup: typeof Types.entitygroup_row;
516
766
  location: typeof Types.location_row;
767
+ nexus: typeof Types.nexus_row;
768
+ nftconfig: typeof Types.nftconfig_row;
517
769
  player: typeof Types.player_row;
770
+ reserve: typeof Types.reserve_row;
518
771
  sequence: typeof Types.sequence_row;
519
772
  ship: typeof Types.ship_row;
520
773
  state: typeof Types.state_row;
@@ -523,8 +776,13 @@ declare const TableMap: {
523
776
  };
524
777
  interface TableTypes {
525
778
  cargo: Types.cargo_row;
779
+ container: Types.container_row;
780
+ entitygroup: Types.entitygroup_row;
526
781
  location: Types.location_row;
782
+ nexus: Types.nexus_row;
783
+ nftconfig: Types.nftconfig_row;
527
784
  player: Types.player_row;
785
+ reserve: Types.reserve_row;
528
786
  sequence: Types.sequence_row;
529
787
  ship: Types.ship_row;
530
788
  state: Types.state_row;
@@ -535,72 +793,100 @@ type RowType<T> = T extends keyof TableTypes ? TableTypes[T] : any;
535
793
  type TableNames = keyof TableTypes;
536
794
  declare namespace ActionParams {
537
795
  namespace Type {
538
- interface cancel_log {
796
+ interface cargo_item {
797
+ item_id: UInt16Type;
798
+ quantity: UInt32Type;
799
+ seed?: UInt64Type;
800
+ modules: Type.module_entry[];
801
+ }
802
+ interface module_entry {
803
+ type: UInt8Type;
804
+ installed?: Type.cargo_seed;
805
+ }
806
+ interface cargo_seed {
807
+ item_id: UInt16Type;
808
+ seed: UInt64Type;
809
+ }
810
+ interface game_config {
811
+ version: UInt32Type;
812
+ defaults: Type.entity_defaults;
813
+ items: Type.item_def[];
814
+ }
815
+ interface entity_defaults {
816
+ warehouse_capacity: UInt32Type;
817
+ warehouse_z: UInt16Type;
818
+ container_hullmass: UInt32Type;
819
+ container_capacity: UInt32Type;
820
+ container_z: UInt16Type;
821
+ }
822
+ interface item_def {
823
+ id: UInt16Type;
824
+ mass: UInt32Type;
825
+ type: UInt8Type;
826
+ subtype: UInt8Type;
827
+ tier: UInt8Type;
828
+ }
829
+ interface entity_ref {
830
+ entity_type: NameType;
831
+ entity_id: UInt64Type;
832
+ }
833
+ interface task_event {
834
+ event_type: UInt8Type;
539
835
  owner: NameType;
540
836
  entity_type: NameType;
541
837
  entity_id: UInt64Type;
542
838
  task_index: UInt8Type;
543
839
  task: Type.task;
544
- started_at: TimePointType;
840
+ starts_at: TimePointType;
841
+ completes_at: TimePointType;
842
+ new_energy?: UInt16Type;
545
843
  }
546
844
  interface task {
547
845
  type: UInt8Type;
548
846
  duration: UInt32Type;
549
847
  cancelable: UInt8Type;
550
- location?: Type.coordinates;
848
+ coordinates?: Type.coordinates;
551
849
  cargo: Type.cargo_item[];
552
- entity?: UInt64Type;
553
- credits?: Int64Type;
850
+ entitytarget?: Type.entity_ref;
851
+ entitygroup?: UInt64Type;
852
+ energy_cost?: UInt16Type;
554
853
  }
555
854
  interface coordinates {
556
855
  x: Int64Type;
557
856
  y: Int64Type;
558
857
  z?: UInt16Type;
559
858
  }
560
- interface cargo_item {
561
- good_id: UInt16Type;
562
- quantity: UInt32Type;
563
- unit_cost: UInt64Type;
564
- }
565
- interface resolve_log {
566
- owner: NameType;
567
- entity_type: NameType;
568
- entity_id: UInt64Type;
569
- task_index: UInt8Type;
570
- task: Type.task;
571
- started_at: TimePointType;
572
- completed_at: TimePointType;
573
- new_energy?: UInt16Type;
574
- new_location?: Type.coordinates;
575
- cargomass_delta: Int64Type;
576
- cargo_added: Type.cargo_item[];
577
- cargo_removed: Type.cargo_item[];
578
- credits?: Int64Type;
579
- }
859
+ }
860
+ interface addmodule {
861
+ entity_type: NameType;
862
+ entity_id: UInt64Type;
863
+ module_index: UInt8Type;
864
+ module_cargo_id: UInt64Type;
865
+ target_cargo_id: UInt64Type;
866
+ }
867
+ interface addnexus {
868
+ nexus_name: string;
869
+ x: Int64Type;
870
+ y: Int64Type;
580
871
  }
581
872
  interface advance {
582
873
  reveal: string;
583
874
  commit: Checksum256Type;
584
875
  }
585
- interface buygoods {
586
- ship_id: UInt64Type;
587
- good_id: UInt16Type;
588
- quantity: UInt32Type;
589
- }
590
- interface buyship {
591
- account: NameType;
592
- name: string;
593
- }
594
- interface buywarehouse {
595
- account: NameType;
596
- ship_id: UInt64Type;
597
- name: string;
876
+ interface blend {
877
+ entity_type: NameType;
878
+ id: UInt64Type;
879
+ inputs: Type.cargo_item[];
598
880
  }
599
881
  interface cancel {
600
882
  entity_type: NameType;
601
883
  id: UInt64Type;
602
884
  count: UInt64Type;
603
885
  }
886
+ interface cleanrsvp {
887
+ epoch: UInt64Type;
888
+ max_rows: UInt64Type;
889
+ }
604
890
  interface cleartable {
605
891
  table_name: NameType;
606
892
  scope?: NameType;
@@ -609,9 +895,41 @@ declare namespace ActionParams {
609
895
  interface commit {
610
896
  commit: Checksum256Type;
611
897
  }
898
+ interface configlog {
899
+ config: Type.game_config;
900
+ }
901
+ interface craft {
902
+ entity_type: NameType;
903
+ id: UInt64Type;
904
+ recipe_id: UInt16Type;
905
+ quantity: UInt32Type;
906
+ inputs: Type.cargo_item[];
907
+ }
908
+ interface createentity {
909
+ owner: NameType;
910
+ entity_type: NameType;
911
+ entity_name: string;
912
+ x: Int64Type;
913
+ y: Int64Type;
914
+ }
915
+ interface deploy {
916
+ entity_type: NameType;
917
+ id: UInt64Type;
918
+ packed_item_id: UInt16Type;
919
+ seed: UInt64Type;
920
+ entity_name: string;
921
+ }
612
922
  interface enable {
613
923
  enabled: boolean;
614
924
  }
925
+ interface extract {
926
+ entity_type: NameType;
927
+ id: UInt64Type;
928
+ stratum: UInt16Type;
929
+ quantity: UInt32Type;
930
+ }
931
+ interface getconfig {
932
+ }
615
933
  interface getentities {
616
934
  owner: NameType;
617
935
  entity_type?: NameType;
@@ -620,24 +938,54 @@ declare namespace ActionParams {
620
938
  entity_type: NameType;
621
939
  entity_id: UInt64Type;
622
940
  }
623
- interface getgoods {
941
+ interface getitemdata {
942
+ }
943
+ interface getitems {
624
944
  }
625
945
  interface getlocation {
626
946
  x: Int64Type;
627
947
  y: Int64Type;
628
948
  }
949
+ interface getlocdata {
950
+ x: Int64Type;
951
+ y: Int64Type;
952
+ }
953
+ interface getmodules {
954
+ }
629
955
  interface getnearby {
630
956
  entity_type: NameType;
631
957
  entity_id: UInt64Type;
632
958
  recharge: boolean;
633
959
  }
960
+ interface getnftinfo {
961
+ }
634
962
  interface getplayer {
635
963
  account: NameType;
636
964
  }
965
+ interface getrecipe {
966
+ output_item_id: UInt16Type;
967
+ }
968
+ interface getrecipes {
969
+ lower_bound: UInt16Type;
970
+ limit: UInt8Type;
971
+ }
972
+ interface getresources {
973
+ }
974
+ interface getstratum {
975
+ x: Int64Type;
976
+ y: Int64Type;
977
+ stratum: UInt16Type;
978
+ }
637
979
  interface getsummaries {
638
980
  owner: NameType;
639
981
  entity_type?: NameType;
640
982
  }
983
+ interface grouptravel {
984
+ entities: Type.entity_ref[];
985
+ x: Int64Type;
986
+ y: Int64Type;
987
+ recharge: boolean;
988
+ }
641
989
  interface hash {
642
990
  value: string;
643
991
  }
@@ -650,18 +998,8 @@ declare namespace ActionParams {
650
998
  interface join {
651
999
  account: NameType;
652
1000
  }
653
- interface logcancel {
654
- log: Type.cancel_log;
655
- }
656
- interface logresolve {
657
- log: Type.resolve_log;
658
- }
659
- interface payloan {
660
- account: NameType;
661
- amount: UInt64Type;
662
- }
663
- interface purgesupply {
664
- max_rows?: UInt64Type;
1001
+ interface notify {
1002
+ event: Type.task_event;
665
1003
  }
666
1004
  interface recharge {
667
1005
  entity_type: NameType;
@@ -670,25 +1008,42 @@ declare namespace ActionParams {
670
1008
  interface resolve {
671
1009
  entity_type: NameType;
672
1010
  id: UInt64Type;
1011
+ count?: UInt64Type;
1012
+ }
1013
+ interface rmmodule {
1014
+ entity_type: NameType;
1015
+ entity_id: UInt64Type;
1016
+ module_index: UInt8Type;
1017
+ target_cargo_id: UInt64Type;
1018
+ }
1019
+ interface rmnftcfg {
1020
+ item_id: UInt16Type;
673
1021
  }
674
1022
  interface salt {
675
1023
  salt: UInt64Type;
676
1024
  }
677
- interface sellgoods {
678
- ship_id: UInt64Type;
679
- good_id: UInt16Type;
680
- quantity: UInt32Type;
1025
+ interface setnftcfg {
1026
+ item_id: UInt16Type;
1027
+ template_id: Int32Type;
1028
+ schema_name: NameType;
681
1029
  }
682
- interface takeloan {
683
- account: NameType;
684
- amount: UInt64Type;
1030
+ interface spawncargo {
1031
+ entity_id: UInt64Type;
1032
+ item_id: UInt64Type;
1033
+ quantity: UInt64Type;
1034
+ }
1035
+ interface spawnseeded {
1036
+ entity_id: UInt64Type;
1037
+ item_id: UInt64Type;
1038
+ quantity: UInt64Type;
1039
+ seed: UInt64Type;
685
1040
  }
686
1041
  interface transfer {
687
1042
  source_type: NameType;
688
1043
  source_id: UInt64Type;
689
1044
  dest_type: NameType;
690
1045
  dest_id: UInt64Type;
691
- good_id: UInt16Type;
1046
+ item_id: UInt16Type;
692
1047
  quantity: UInt32Type;
693
1048
  }
694
1049
  interface travel {
@@ -698,73 +1053,107 @@ declare namespace ActionParams {
698
1053
  y: Int64Type;
699
1054
  recharge: boolean;
700
1055
  }
701
- interface updatecredit {
702
- account: NameType;
703
- amount: Int64Type;
704
- }
705
- interface updatedebt {
706
- account: NameType;
707
- amount: Int64Type;
1056
+ interface warp {
1057
+ entity_type: NameType;
1058
+ id: UInt64Type;
1059
+ x: Int64Type;
1060
+ y: Int64Type;
708
1061
  }
709
1062
  interface wipe {
710
1063
  }
711
1064
  interface wipesequence {
712
1065
  }
1066
+ interface wrap {
1067
+ owner: NameType;
1068
+ entity_type: NameType;
1069
+ entity_id: UInt64Type;
1070
+ cargo_id: UInt64Type;
1071
+ quantity: UInt64Type;
1072
+ }
713
1073
  }
714
1074
  interface ActionNameParams {
1075
+ addmodule: ActionParams.addmodule;
1076
+ addnexus: ActionParams.addnexus;
715
1077
  advance: ActionParams.advance;
716
- buygoods: ActionParams.buygoods;
717
- buyship: ActionParams.buyship;
718
- buywarehouse: ActionParams.buywarehouse;
1078
+ blend: ActionParams.blend;
719
1079
  cancel: ActionParams.cancel;
1080
+ cleanrsvp: ActionParams.cleanrsvp;
720
1081
  cleartable: ActionParams.cleartable;
721
1082
  commit: ActionParams.commit;
1083
+ configlog: ActionParams.configlog;
1084
+ craft: ActionParams.craft;
1085
+ createentity: ActionParams.createentity;
1086
+ deploy: ActionParams.deploy;
722
1087
  enable: ActionParams.enable;
1088
+ extract: ActionParams.extract;
1089
+ getconfig: ActionParams.getconfig;
723
1090
  getentities: ActionParams.getentities;
724
1091
  getentity: ActionParams.getentity;
725
- getgoods: ActionParams.getgoods;
1092
+ getitemdata: ActionParams.getitemdata;
1093
+ getitems: ActionParams.getitems;
726
1094
  getlocation: ActionParams.getlocation;
1095
+ getlocdata: ActionParams.getlocdata;
1096
+ getmodules: ActionParams.getmodules;
727
1097
  getnearby: ActionParams.getnearby;
1098
+ getnftinfo: ActionParams.getnftinfo;
728
1099
  getplayer: ActionParams.getplayer;
1100
+ getrecipe: ActionParams.getrecipe;
1101
+ getrecipes: ActionParams.getrecipes;
1102
+ getresources: ActionParams.getresources;
1103
+ getstratum: ActionParams.getstratum;
729
1104
  getsummaries: ActionParams.getsummaries;
1105
+ grouptravel: ActionParams.grouptravel;
730
1106
  hash: ActionParams.hash;
731
1107
  hash512: ActionParams.hash512;
732
1108
  init: ActionParams.init;
733
1109
  join: ActionParams.join;
734
- logcancel: ActionParams.logcancel;
735
- logresolve: ActionParams.logresolve;
736
- payloan: ActionParams.payloan;
737
- purgesupply: ActionParams.purgesupply;
1110
+ notify: ActionParams.notify;
738
1111
  recharge: ActionParams.recharge;
739
1112
  resolve: ActionParams.resolve;
1113
+ rmmodule: ActionParams.rmmodule;
1114
+ rmnftcfg: ActionParams.rmnftcfg;
740
1115
  salt: ActionParams.salt;
741
- sellgoods: ActionParams.sellgoods;
742
- takeloan: ActionParams.takeloan;
1116
+ setnftcfg: ActionParams.setnftcfg;
1117
+ spawncargo: ActionParams.spawncargo;
1118
+ spawnseeded: ActionParams.spawnseeded;
743
1119
  transfer: ActionParams.transfer;
744
1120
  travel: ActionParams.travel;
745
- updatecredit: ActionParams.updatecredit;
746
- updatedebt: ActionParams.updatedebt;
1121
+ warp: ActionParams.warp;
747
1122
  wipe: ActionParams.wipe;
748
1123
  wipesequence: ActionParams.wipesequence;
1124
+ wrap: ActionParams.wrap;
749
1125
  }
750
1126
  type ActionNames = keyof ActionNameParams;
751
1127
  interface ActionReturnValues {
752
- buygoods: Types.task_results;
753
1128
  cancel: Types.cancel_results;
1129
+ craft: Types.task_results;
1130
+ deploy: Types.task_results;
1131
+ extract: Types.task_results;
1132
+ getconfig: Types.game_config;
754
1133
  getentities: Types.entity_info[];
755
1134
  getentity: Types.entity_info;
756
- getgoods: Types.goods_info;
1135
+ getitemdata: Types.itemdata_result;
1136
+ getitems: Types.items_info;
757
1137
  getlocation: Types.location_info;
1138
+ getlocdata: Types.location_derived;
1139
+ getmodules: Types.modules_result;
758
1140
  getnearby: Types.nearby_info;
1141
+ getnftinfo: Types.nftinfo_result;
759
1142
  getplayer: Types.player_info;
1143
+ getrecipe: Types.recipes_result;
1144
+ getrecipes: Types.recipes_result;
1145
+ getresources: Types.resources_result;
1146
+ getstratum: Types.stratum_data;
760
1147
  getsummaries: Types.entity_summary[];
1148
+ grouptravel: Types.task_results;
761
1149
  hash: Checksum256;
762
1150
  hash512: Checksum512;
763
1151
  recharge: Types.task_results;
764
1152
  resolve: Types.resolve_results;
765
- sellgoods: Types.task_results;
766
1153
  transfer: Types.task_results;
767
1154
  travel: Types.task_results;
1155
+ warp: Types.task_results;
1156
+ wrap: Types.task_results;
768
1157
  }
769
1158
  type ActionReturnNames = keyof ActionReturnValues;
770
1159
  declare class Contract extends Contract$2 {
@@ -817,11 +1206,11 @@ declare const ERROR_SYSTEM_DISABLED = "This game is currently disabled.";
817
1206
  declare const ERROR_SYSTEM_NOT_INITIALIZED = "This game has not been initialized.";
818
1207
  declare const GAME_NOT_FOUND = "Cannot find game for given account name.";
819
1208
  declare const GAME_SEED_NOT_SET = "This game has not initialized an epoch seed value.";
820
- declare const GOOD_DOES_NOT_EXIST = "Good does not exist.";
821
- declare const GOOD_NOT_AVAILABLE_AT_LOCATION = "Good is not tradeable at ship location.";
1209
+ declare const ITEM_DOES_NOT_EXIST = "Item does not exist.";
1210
+ declare const ITEM_NOT_AVAILABLE_AT_LOCATION = "Item is not tradeable at ship location.";
822
1211
  declare const INSUFFICIENT_BALANCE = "Insufficient balance.";
823
- declare const INSUFFICIENT_GOOD_QUANTITY = "Insufficient quantity in cargo.";
824
- declare const INSUFFICIENT_GOOD_SUPPLY = "Insufficient supply of good at location.";
1212
+ declare const INSUFFICIENT_ITEM_QUANTITY = "Insufficient quantity in cargo.";
1213
+ declare const INSUFFICIENT_ITEM_SUPPLY = "Insufficient supply of item at location.";
825
1214
  declare const INVALID_AMOUNT = "Invalid amount.";
826
1215
  declare const REQUIRES_MORE_THAN_ONE = "A value greater than one is required.";
827
1216
  declare const REQUIRES_POSITIVE_VALUE = "Value must be greater than zero.";
@@ -851,27 +1240,47 @@ declare const WAREHOUSE_ALREADY_AT_LOCATION = "Warehouse already exists at this
851
1240
  declare const WAREHOUSE_CAPACITY_EXCEEDED = "Warehouse capacity would be exceeded.";
852
1241
 
853
1242
  declare const PRECISION = 10000;
854
- declare const INITIAL_SHIP_MASS = 500000;
1243
+ declare const CRAFT_ENERGY_DIVISOR = 150000;
1244
+ declare const WAREHOUSE_Z = 500;
1245
+ declare const INITIAL_WAREHOUSE_CAPACITY = 10000000;
1246
+ declare const CONTAINER_Z = 300;
1247
+ declare const INITIAL_CONTAINER_HULLMASS = 50000;
1248
+ declare const INITIAL_CONTAINER_CAPACITY = 2000000;
1249
+ declare const TRAVEL_MAX_DURATION = 86400;
855
1250
  declare const MIN_ORBITAL_ALTITUDE = 800;
856
1251
  declare const MAX_ORBITAL_ALTITUDE = 3000;
1252
+ declare const BASE_ORBITAL_MASS = 100000;
857
1253
  interface ShipLike {
858
- location: Types.coordinates;
859
- mass: UInt32;
860
- energy: UInt16;
861
- engines: Types.movement_stats;
862
- generator: Types.energy_stats;
863
- loaders: Types.loader_stats;
864
- capacity: UInt32;
1254
+ coordinates: Types.coordinates;
1255
+ hullmass?: UInt32;
1256
+ energy?: UInt16;
1257
+ engines?: Types.movement_stats;
1258
+ generator?: Types.energy_stats;
1259
+ loaders?: Types.loader_stats;
1260
+ hauler?: Types.hauler_stats;
1261
+ capacity?: UInt32;
865
1262
  }
866
1263
  interface CargoMassInfo {
867
- good_id: UInt16Type;
1264
+ item_id: UInt16Type;
868
1265
  quantity: UInt32Type;
869
1266
  }
870
1267
  declare enum TaskType {
871
- RECHARGE = 0,
872
- LOAD = 1,
873
- UNLOAD = 2,
874
- FLIGHT = 3
1268
+ IDLE = 0,
1269
+ TRAVEL = 1,
1270
+ RECHARGE = 2,
1271
+ LOAD = 3,
1272
+ UNLOAD = 4,
1273
+ EXTRACT = 5,
1274
+ WARP = 6,
1275
+ CRAFT = 7,
1276
+ DEPLOY = 8,
1277
+ DEPLOY_SHIP = 9
1278
+ }
1279
+ declare enum LocationType {
1280
+ EMPTY = 0,
1281
+ PLANET = 1,
1282
+ ASTEROID = 2,
1283
+ NEBULA = 3
875
1284
  }
876
1285
  declare enum TaskCancelable {
877
1286
  NEVER = 0,
@@ -881,6 +1290,7 @@ declare enum TaskCancelable {
881
1290
  declare const EntityType$1: {
882
1291
  readonly SHIP: Name;
883
1292
  readonly WAREHOUSE: Name;
1293
+ readonly CONTAINER: Name;
884
1294
  };
885
1295
  type EntityTypeName = (typeof EntityType$1)[keyof typeof EntityType$1];
886
1296
  type CoordinatesType = Coordinates | Types.coordinates | {
@@ -890,24 +1300,24 @@ type CoordinatesType = Coordinates | Types.coordinates | {
890
1300
  declare class Coordinates extends Types.coordinates {
891
1301
  static from(value: CoordinatesType): Coordinates;
892
1302
  equals(other: CoordinatesType): boolean;
1303
+ toLocationId(): UInt64;
893
1304
  }
1305
+ declare function coordsToLocationId(coords: CoordinatesType): UInt64;
894
1306
  interface Distance {
895
1307
  origin: ActionParams.Type.coordinates;
896
1308
  destination: ActionParams.Type.coordinates;
897
1309
  distance: UInt16;
898
1310
  }
899
- declare class Good extends Struct {
1311
+ type ResourceCategory = 'metal' | 'precious' | 'gas' | 'mineral' | 'organic';
1312
+ type ResourceTier = 't1' | 't2' | 't3' | 't4' | 't5';
1313
+ declare class Item extends Struct {
900
1314
  id: UInt16;
901
1315
  name: string;
902
1316
  description: string;
903
- base_price: UInt32;
904
1317
  mass: UInt32;
905
- }
906
- declare class GoodPrice extends Struct {
907
- id: UInt16;
908
- good: Good;
909
- price: UInt32;
910
- supply: UInt16;
1318
+ category: ResourceCategory;
1319
+ tier: ResourceTier;
1320
+ color: string;
911
1321
  }
912
1322
 
913
1323
  interface EpochInfo {
@@ -996,269 +1406,149 @@ declare class GameState extends Types.state_row {
996
1406
 
997
1407
  interface PlayerStateInput {
998
1408
  owner: NameType;
999
- balance: UInt64Type;
1000
- debt: UInt32Type;
1001
- networth: Int64Type;
1002
1409
  }
1003
- /**
1004
- * Player helper class extending player_row with computed financial properties.
1005
- * Provides easy access to balance, debt, networth, and loan calculations.
1006
- */
1007
1410
  declare class Player extends Types.player_row {
1008
- /**
1009
- * Construct a Player instance from individual state pieces.
1010
- * Used by UI's ReactivePlayer to reconstruct Player from reactive state.
1011
- */
1012
1411
  static fromState(state: PlayerStateInput): Player;
1013
- private static readonly MAX_LOAN;
1014
- private static readonly BASE_SHIP_COST;
1015
- private static readonly SHIP_COST_MULTIPLIER;
1016
- private _shipCount?;
1017
- /**
1018
- * Set the current ship count (needed for nextShipCost calculation)
1019
- */
1020
- setShipCount(count: number): void;
1021
- /**
1022
- * Get the current ship count (if set)
1023
- */
1024
- get shipCount(): number | undefined;
1025
- /**
1026
- * Calculate the cost of the next ship based on current ship count
1027
- * Matches contract: pow(5, sequence) * 100
1028
- * @param shipCount - Optional ship count (uses cached value if not provided)
1029
- */
1030
- getNextShipCost(shipCount?: number): UInt64;
1031
- /**
1032
- * Get the cost of the next ship based on cached ship count
1033
- */
1034
- get nextShipCost(): UInt64;
1035
- /**
1036
- * Check if player can afford to buy a ship
1037
- * @param shipCount - Optional ship count (uses cached value if not provided)
1038
- */
1039
- canBuyShip(shipCount?: number): boolean;
1040
- /**
1041
- * Calculate available loan amount (max loan - current debt)
1042
- */
1043
- get availableLoan(): UInt64;
1044
- /**
1045
- * Check if player can take out a loan
1046
- */
1047
- get canTakeLoan(): boolean;
1048
- /**
1049
- * Check if player can pay back loan
1050
- */
1051
- get canPayLoan(): boolean;
1052
- /**
1053
- * Calculate maximum payback amount (min of debt and balance)
1054
- */
1055
- get maxPayback(): UInt64;
1056
- /**
1057
- * Get the maximum loan amount (constant)
1058
- */
1059
- static get MAX_LOAN_LIMIT(): number;
1060
- /**
1061
- * Check if player is in debt
1062
- */
1063
- get hasDebt(): boolean;
1064
- /**
1065
- * Check if player is solvent (positive networth)
1066
- */
1067
- get isSolvent(): boolean;
1068
- /**
1069
- * Create an optimistic update for balance changes
1070
- * Uses integer math to match contract
1071
- * @param delta - Amount to change (can be negative)
1072
- */
1073
- withBalanceChange(delta: UInt64 | number): Player;
1074
- /**
1075
- * Create an optimistic update for debt changes
1076
- * Uses integer math to match contract
1077
- * @param delta - Amount to change (can be negative)
1078
- */
1079
- withDebtChange(delta: UInt64 | number): Player;
1080
- /**
1081
- * Create an optimistic update for taking a loan
1082
- */
1083
- withLoan(amount: UInt64): Player;
1084
- /**
1085
- * Create an optimistic update for paying back a loan
1086
- */
1087
- withLoanPayment(amount: UInt64): Player;
1088
- /**
1089
- * Simulate networth update from selling goods.
1090
- * Matches contract: networth += (sellPrice - paid * quantity)
1091
- * Contract reference: market.cpp:75
1092
- *
1093
- * @param sellPrice - Total revenue from sale (price * quantity)
1094
- * @param paidPerUnit - Average cost per unit paid (from cargo.paid)
1095
- * @param quantity - Quantity being sold
1096
- * @returns New player with updated networth
1097
- *
1098
- * @example
1099
- * // Sold 10 units at 150 each (revenue=1500), paid 100 per unit
1100
- * const newPlayer = player.withSaleNetworth(
1101
- * UInt64.from(1500),
1102
- * UInt64.from(100),
1103
- * UInt32.from(10)
1104
- * )
1105
- * // Networth increases by: 1500 - (100*10) = 500
1106
- */
1107
- withSaleNetworth(sellPrice: UInt64, paidPerUnit: UInt64, quantity: UInt64): Player;
1108
- /**
1109
- * Simulate complete sell goods transaction.
1110
- * Updates both balance (adds revenue) and networth (adds profit).
1111
- * Matches contract actions: update_balance + update_networth
1112
- *
1113
- * @param sellPrice - Total revenue from sale (price * quantity)
1114
- * @param paidPerUnit - Average cost per unit paid (from cargo.paid)
1115
- * @param quantity - Quantity being sold
1116
- * @returns New player with updated balance and networth
1117
- */
1118
- withSellGoods(sellPrice: UInt64, paidPerUnit: UInt64, quantity: UInt64): Player;
1119
- /**
1120
- * Simulate complete buy goods transaction.
1121
- * Updates balance (subtracts cost).
1122
- *
1123
- * @param purchaseCost - Total cost of purchase (price * quantity)
1124
- * @returns New player with updated balance
1125
- */
1126
- withBuyGoods(purchaseCost: UInt64): Player;
1127
1412
  }
1128
1413
 
1129
1414
  declare class PlayersManager extends BaseManager {
1130
1415
  getPlayer(account: NameType): Promise<Player | undefined>;
1131
1416
  }
1132
1417
 
1133
- /**
1134
- * Location helper class for working with game coordinates.
1135
- * Provides system detection, market price caching, nearby planet finding, and supply tracking.
1136
- */
1137
- declare class Location {
1138
- readonly coordinates: Coordinates;
1139
- private _marketPrices?;
1140
- private _gameSeed?;
1141
- private _hasSystem?;
1142
- private _locationRows?;
1143
- private _epoch?;
1144
- constructor(coordinates: CoordinatesType);
1145
- /**
1146
- * Create a Location from coordinates
1147
- */
1148
- static from(coordinates: CoordinatesType): Location;
1149
- /**
1150
- * Check if this location has a system (planet)
1151
- */
1152
- hasSystemAt(gameSeed: Checksum256Type): boolean;
1153
- /**
1154
- * Set cached market prices for this location
1155
- */
1156
- setMarketPrices(prices: GoodPrice[]): void;
1157
- /**
1158
- * Get cached market prices (returns undefined if not cached)
1159
- */
1160
- get marketPrices(): GoodPrice[] | undefined;
1161
- /**
1162
- * Get price for a specific good (from cache)
1163
- */
1164
- getPrice(goodId: UInt16Type): GoodPrice | undefined;
1165
- /**
1166
- * Find nearby planets from this location
1167
- */
1168
- findNearby(gameSeed: Checksum256Type, maxDistance?: UInt16Type): Distance[];
1169
- /**
1170
- * Check if this location equals another location
1171
- */
1172
- equals(other: CoordinatesType | Location): boolean;
1173
- /**
1174
- * Set location rows (supply data) for this location
1175
- */
1176
- setLocationRows(rows: Types.location_row[], epoch: UInt64): void;
1177
- /**
1178
- * Get cached location rows (supply data)
1179
- */
1180
- get locationRows(): Types.location_row[] | undefined;
1181
- /**
1182
- * Get supply for a specific good at this location
1183
- * Returns undefined if location rows not cached or good not found
1184
- */
1185
- getSupply(goodId: UInt16Type): UInt16 | undefined;
1186
- /**
1187
- * Get all available goods at this location (goods with supply > 0)
1188
- * Returns undefined if location rows not cached
1189
- */
1190
- get availableGoods(): Types.location_row[] | undefined;
1191
- /**
1192
- * Check if a specific good is available (has supply)
1193
- * Returns false if location rows not cached
1194
- */
1195
- hasGood(goodId: UInt16Type): boolean;
1196
- /**
1197
- * Get the epoch for cached location data
1198
- */
1199
- get epoch(): UInt64 | undefined;
1200
- /**
1201
- * Check if cached data exists
1202
- */
1203
- get hasCachedData(): boolean;
1204
- /**
1205
- * Check if supply data is cached
1206
- */
1207
- get hasSupplyData(): boolean;
1208
- /**
1209
- * Clear all cached data
1210
- */
1211
- clearCache(): void;
1212
- /**
1213
- * Create optimistic Location with updated supply after purchase/sale.
1214
- * Matches contract: update_location_supply (delta can be positive or negative)
1215
- * Contract reference: market.cpp:53, 123-151
1216
- *
1217
- * @param goodId - Good ID to update supply for
1218
- * @param quantityDelta - Change in supply (negative for purchase, positive for sale)
1219
- * @returns New Location with updated supply in cached data
1220
- *
1221
- * @example
1222
- * // After buying 10 units (supply decreases)
1223
- * const newLocation = location.withUpdatedSupply(1, -10)
1224
- *
1225
- * // After selling 5 units (supply increases)
1226
- * const newLocation = location.withUpdatedSupply(1, 5)
1227
- */
1228
- withUpdatedSupply(goodId: UInt16Type, quantityDelta: number): Location;
1229
- }
1230
- /**
1231
- * Helper function to convert various coordinate types to Location
1232
- */
1233
- declare function toLocation(coords: CoordinatesType | Location): Location;
1234
-
1235
1418
  declare class LocationsManager extends BaseManager {
1236
- getMarketPrice(location: CoordinatesType, goodId: number): Promise<GoodPrice>;
1237
- getMarketPrices(location: CoordinatesType): Promise<GoodPrice[]>;
1238
- getMarketPricesWithSupply(location: CoordinatesType): Promise<GoodPrice[]>;
1239
1419
  hasSystem(location: CoordinatesType): Promise<boolean>;
1240
1420
  findNearbyPlanets(origin: CoordinatesType, maxDistance?: UInt16Type): Promise<Distance[]>;
1241
- getLocation(location: CoordinatesType): Promise<any[]>;
1242
- getLocationWithPrices(coords: CoordinatesType): Promise<Location>;
1243
- getLocationWithSupply(coords: CoordinatesType): Promise<Location>;
1244
- getLocationComplete(coords: CoordinatesType): Promise<Location>;
1421
+ getLocationEntity(id: UInt64Type): Promise<Types.location_row | undefined>;
1422
+ getLocationEntityAt(coords: CoordinatesType): Promise<Types.location_row | undefined>;
1423
+ getAllLocationEntities(): Promise<Types.location_row[]>;
1424
+ }
1425
+
1426
+ declare class EpochsManager extends BaseManager {
1427
+ getCurrentHeight(): Promise<UInt64>;
1428
+ getCurrent(): Promise<EpochInfo>;
1429
+ getByHeight(height: UInt64Type): Promise<EpochInfo>;
1430
+ getTimeRemaining(): Promise<number>;
1431
+ getProgress(): Promise<number>;
1432
+ fitsInCurrentEpoch(durationMs: number): Promise<boolean>;
1433
+ }
1434
+
1435
+ type EntityRefInput = {
1436
+ entityType: EntityTypeName;
1437
+ entityId: UInt64Type;
1438
+ };
1439
+ declare class ActionsManager extends BaseManager {
1440
+ travel(shipId: UInt64Type, destination: CoordinatesType, recharge?: boolean): Action;
1441
+ grouptravel(entities: EntityRefInput[], destination: CoordinatesType, recharge?: boolean): Action;
1442
+ resolve(entityId: UInt64Type, entityType?: EntityTypeName): Action;
1443
+ cancel(entityId: UInt64Type, count: UInt64Type, entityType?: EntityTypeName): Action;
1444
+ recharge(shipId: UInt64Type): Action;
1445
+ transfer(sourceType: EntityTypeName, sourceId: UInt64Type, destType: EntityTypeName, destId: UInt64Type, goodId: UInt64Type, quantity: UInt64Type): Action;
1446
+ foundCompany(account: NameType, name: string): Action;
1447
+ join(account: NameType): Action;
1448
+ extract(shipId: UInt64Type): Action;
1449
+ warp(shipId: UInt64Type, destination: CoordinatesType): Action;
1450
+ craft(entityType: EntityTypeName, entityId: UInt64Type, recipeId: number, quantity: number, inputs: ActionParams.Type.cargo_item[]): Action;
1451
+ blend(entityType: EntityTypeName, entityId: UInt64Type, inputs: ActionParams.Type.cargo_item[]): Action;
1452
+ deploy(entityType: EntityTypeName, entityId: UInt64Type, packedItemId: number, seed: bigint, entityName: string): Action;
1453
+ addmodule(entityType: EntityTypeName, entityId: UInt64Type, moduleIndex: number, moduleCargoId: UInt64Type, targetCargoId?: UInt64Type): Action;
1454
+ rmmodule(entityType: EntityTypeName, entityId: UInt64Type, moduleIndex: number, targetCargoId?: UInt64Type): Action;
1455
+ joinGame(account: NameType, companyName: string): Action[];
1456
+ }
1457
+
1458
+ declare class GameContext {
1459
+ readonly client: APIClient;
1460
+ readonly server: Contract$2;
1461
+ readonly platform: Contract$2;
1462
+ private _entities?;
1463
+ private _players?;
1464
+ private _locations?;
1465
+ private _epochs?;
1466
+ private _actions?;
1467
+ private _gameCache?;
1468
+ private _stateCache?;
1469
+ constructor(client: APIClient, server: Contract$2, platform: Contract$2);
1470
+ get entities(): EntitiesManager;
1471
+ get players(): PlayersManager;
1472
+ get locations(): LocationsManager;
1473
+ get epochs(): EpochsManager;
1474
+ get actions(): ActionsManager;
1475
+ getGame(reload?: boolean): Promise<Types$1.game_row>;
1476
+ getState(reload?: boolean): Promise<GameState>;
1477
+ get cachedGame(): Types$1.game_row | undefined;
1478
+ get cachedState(): GameState | undefined;
1479
+ }
1480
+
1481
+ declare abstract class BaseManager {
1482
+ protected readonly context: GameContext;
1483
+ constructor(context: GameContext);
1484
+ protected get client(): _wharfkit_antelope.APIClient;
1485
+ protected get server(): _wharfkit_contract.Contract;
1486
+ protected get platform(): _wharfkit_contract.Contract;
1487
+ protected getGame(): Promise<Types$1.game_row>;
1488
+ protected getState(): Promise<GameState>;
1489
+ }
1490
+
1491
+ interface MovementCapability {
1492
+ engines: Types.movement_stats;
1493
+ generator: Types.energy_stats;
1494
+ }
1495
+ interface EnergyCapability {
1496
+ energy: UInt16;
1497
+ }
1498
+ interface StorageCapability {
1499
+ capacity: UInt32;
1500
+ cargomass: UInt32;
1501
+ cargo: Types.cargo_item[];
1245
1502
  }
1503
+ interface LoaderCapability {
1504
+ loaders: Types.loader_stats;
1505
+ }
1506
+ interface ExtractorCapability {
1507
+ extractor: Types.extractor_stats;
1508
+ }
1509
+ interface MassCapability {
1510
+ hullmass: UInt32;
1511
+ }
1512
+ interface ScheduleCapability {
1513
+ schedule?: Types.schedule;
1514
+ }
1515
+ interface EntityCapabilities {
1516
+ hullmass?: UInt32;
1517
+ capacity?: UInt32;
1518
+ engines?: Types.movement_stats;
1519
+ generator?: Types.energy_stats;
1520
+ loaders?: Types.loader_stats;
1521
+ extractor?: Types.extractor_stats;
1522
+ crafter?: Types.crafter_stats;
1523
+ }
1524
+ interface EntityState {
1525
+ owner: Name;
1526
+ location: Types.coordinates;
1527
+ energy?: UInt16;
1528
+ cargomass: UInt32;
1529
+ cargo: Types.cargo_item[];
1530
+ }
1531
+ declare function capsHasMovement(caps: EntityCapabilities): boolean;
1532
+ declare function capsHasStorage(caps: EntityCapabilities): boolean;
1533
+ declare function capsHasLoaders(caps: EntityCapabilities): boolean;
1534
+ declare function capsHasExtractor(caps: EntityCapabilities): boolean;
1535
+ declare function capsHasMass(caps: EntityCapabilities): boolean;
1246
1536
 
1247
1537
  type Schedule = Types.schedule;
1248
- type Task = Types.task;
1538
+ type Task$1 = Types.task;
1249
1539
  interface ScheduleData {
1250
1540
  schedule?: Schedule;
1251
1541
  }
1252
1542
  interface Scheduleable extends ScheduleData {
1253
1543
  hasSchedule: boolean;
1254
1544
  isIdle: boolean;
1255
- tasks: Task[];
1545
+ tasks: Task$1[];
1256
1546
  scheduleDuration(): number;
1257
1547
  scheduleElapsed(now: Date): number;
1258
1548
  scheduleRemaining(now: Date): number;
1259
1549
  scheduleComplete(now: Date): boolean;
1260
1550
  currentTaskIndex(now: Date): number;
1261
- currentTask(now: Date): Task | undefined;
1551
+ currentTask(now: Date): Task$1 | undefined;
1262
1552
  currentTaskType(now: Date): TaskType | undefined;
1263
1553
  getTaskStartTime(index: number): number;
1264
1554
  getTaskElapsed(index: number, now: Date): number;
@@ -1268,15 +1558,15 @@ interface Scheduleable extends ScheduleData {
1268
1558
  currentTaskProgress(now: Date): number;
1269
1559
  scheduleProgress(now: Date): number;
1270
1560
  }
1271
- declare function hasSchedule(entity: ScheduleData): boolean;
1561
+ declare function hasSchedule$1(entity: ScheduleData): boolean;
1272
1562
  declare function isIdle(entity: ScheduleData): boolean;
1273
- declare function getTasks(entity: ScheduleData): Task[];
1563
+ declare function getTasks(entity: ScheduleData): Task$1[];
1274
1564
  declare function scheduleDuration(entity: ScheduleData): number;
1275
1565
  declare function scheduleElapsed(entity: ScheduleData, now: Date): number;
1276
1566
  declare function scheduleRemaining(entity: ScheduleData, now: Date): number;
1277
1567
  declare function scheduleComplete(entity: ScheduleData, now: Date): boolean;
1278
1568
  declare function currentTaskIndex(entity: ScheduleData, now: Date): number;
1279
- declare function currentTask(entity: ScheduleData, now: Date): Task | undefined;
1569
+ declare function currentTask(entity: ScheduleData, now: Date): Task$1 | undefined;
1280
1570
  declare function currentTaskType(entity: ScheduleData, now: Date): TaskType | undefined;
1281
1571
  declare function getTaskStartTime(entity: ScheduleData, index: number): number;
1282
1572
  declare function getTaskElapsed(entity: ScheduleData, index: number, now: Date): number;
@@ -1285,10 +1575,15 @@ declare function isTaskComplete(entity: ScheduleData, index: number, now: Date):
1285
1575
  declare function isTaskInProgress(entity: ScheduleData, index: number, now: Date): boolean;
1286
1576
  declare function currentTaskProgress(entity: ScheduleData, now: Date): number;
1287
1577
  declare function scheduleProgress(entity: ScheduleData, now: Date): number;
1578
+ declare function isTaskType(entity: ScheduleData, taskType: TaskType, now: Date): boolean;
1579
+ declare function isInFlight(entity: ScheduleData, now: Date): boolean;
1580
+ declare function isRecharging(entity: ScheduleData, now: Date): boolean;
1581
+ declare function isLoading(entity: ScheduleData, now: Date): boolean;
1582
+ declare function isUnloading(entity: ScheduleData, now: Date): boolean;
1583
+ declare function isExtracting(entity: ScheduleData, now: Date): boolean;
1288
1584
 
1289
1585
  type schedule_ScheduleData = ScheduleData;
1290
1586
  type schedule_Scheduleable = Scheduleable;
1291
- declare const schedule_hasSchedule: typeof hasSchedule;
1292
1587
  declare const schedule_isIdle: typeof isIdle;
1293
1588
  declare const schedule_getTasks: typeof getTasks;
1294
1589
  declare const schedule_scheduleDuration: typeof scheduleDuration;
@@ -1305,11 +1600,17 @@ declare const schedule_isTaskComplete: typeof isTaskComplete;
1305
1600
  declare const schedule_isTaskInProgress: typeof isTaskInProgress;
1306
1601
  declare const schedule_currentTaskProgress: typeof currentTaskProgress;
1307
1602
  declare const schedule_scheduleProgress: typeof scheduleProgress;
1603
+ declare const schedule_isTaskType: typeof isTaskType;
1604
+ declare const schedule_isInFlight: typeof isInFlight;
1605
+ declare const schedule_isRecharging: typeof isRecharging;
1606
+ declare const schedule_isLoading: typeof isLoading;
1607
+ declare const schedule_isUnloading: typeof isUnloading;
1608
+ declare const schedule_isExtracting: typeof isExtracting;
1308
1609
  declare namespace schedule {
1309
1610
  export {
1310
1611
  schedule_ScheduleData as ScheduleData,
1311
1612
  schedule_Scheduleable as Scheduleable,
1312
- schedule_hasSchedule as hasSchedule,
1613
+ hasSchedule$1 as hasSchedule,
1313
1614
  schedule_isIdle as isIdle,
1314
1615
  schedule_getTasks as getTasks,
1315
1616
  schedule_scheduleDuration as scheduleDuration,
@@ -1326,24 +1627,15 @@ declare namespace schedule {
1326
1627
  schedule_isTaskInProgress as isTaskInProgress,
1327
1628
  schedule_currentTaskProgress as currentTaskProgress,
1328
1629
  schedule_scheduleProgress as scheduleProgress,
1630
+ schedule_isTaskType as isTaskType,
1631
+ schedule_isInFlight as isInFlight,
1632
+ schedule_isRecharging as isRecharging,
1633
+ schedule_isLoading as isLoading,
1634
+ schedule_isUnloading as isUnloading,
1635
+ schedule_isExtracting as isExtracting,
1329
1636
  };
1330
1637
  }
1331
1638
 
1332
- declare class EntityInventory extends Types.cargo_item {
1333
- private _good?;
1334
- get good(): Good;
1335
- get name(): string;
1336
- get unitMass(): UInt32;
1337
- get totalMass(): UInt64;
1338
- get totalCost(): UInt64;
1339
- get hasCargo(): boolean;
1340
- get isEmpty(): boolean;
1341
- }
1342
-
1343
- /**
1344
- * Projected state of an entity after scheduled tasks complete.
1345
- * Mirrors contract's projected_entity struct.
1346
- */
1347
1639
  interface ProjectedEntity {
1348
1640
  location: Coordinates;
1349
1641
  energy: UInt16;
@@ -1353,78 +1645,141 @@ interface ProjectedEntity {
1353
1645
  engines?: Types.movement_stats;
1354
1646
  loaders?: Types.loader_stats;
1355
1647
  generator?: Types.energy_stats;
1648
+ hauler?: Types.hauler_stats;
1356
1649
  readonly totalMass: UInt64;
1650
+ hasMovement(): boolean;
1651
+ hasStorage(): boolean;
1652
+ hasLoaders(): boolean;
1653
+ capabilities(): EntityCapabilities;
1654
+ state(): EntityState;
1357
1655
  }
1358
- /**
1359
- * Interface for entities that can be projected.
1360
- * Ships and Warehouses both implement this.
1361
- */
1362
1656
  interface Projectable extends ScheduleData {
1363
- location: Coordinates;
1364
- energy: UInt16;
1365
- mass: UInt32;
1657
+ coordinates: Coordinates | Types.coordinates;
1658
+ energy?: UInt16;
1659
+ hullmass?: UInt32;
1366
1660
  generator?: Types.energy_stats;
1367
1661
  engines?: Types.movement_stats;
1368
1662
  loaders?: Types.loader_stats;
1369
- capacity?: UInt64;
1370
- calcCargoMass(): UInt64;
1663
+ hauler?: Types.hauler_stats;
1664
+ capacity?: UInt32;
1665
+ cargo: Types.cargo_item[];
1666
+ cargomass: UInt32;
1667
+ owner?: Name;
1371
1668
  }
1372
- /**
1373
- * Create initial projected entity state from a projectable entity.
1374
- */
1375
1669
  declare function createProjectedEntity(entity: Projectable): ProjectedEntity;
1376
- /**
1377
- * Project entity state after all scheduled tasks complete.
1378
- * Mirrors contract's project_ship/project_warehouse methods.
1379
- */
1380
1670
  declare function projectEntity(entity: Projectable): ProjectedEntity;
1381
- /**
1382
- * Project entity state at a specific time (partial task execution).
1383
- */
1384
1671
  declare function projectEntityAt(entity: Projectable, now: Date): ProjectedEntity;
1385
1672
 
1673
+ declare class Location {
1674
+ readonly coordinates: Coordinates;
1675
+ private _gameSeed?;
1676
+ private _hasSystem?;
1677
+ private _epoch?;
1678
+ constructor(coordinates: CoordinatesType);
1679
+ static from(coordinates: CoordinatesType): Location;
1680
+ hasSystemAt(gameSeed: Checksum256Type): boolean;
1681
+ getLocationTypeAt(gameSeed: Checksum256Type): LocationType;
1682
+ isExtractableAt(gameSeed: Checksum256Type): boolean;
1683
+ findNearby(gameSeed: Checksum256Type, maxDistance?: UInt16Type): Distance[];
1684
+ equals(other: CoordinatesType | Location): boolean;
1685
+ get epoch(): UInt64 | undefined;
1686
+ clearCache(): void;
1687
+ }
1688
+ declare function toLocation(coords: CoordinatesType | Location): Location;
1689
+
1690
+ type Task = Types.task;
1691
+ declare class ScheduleAccessor {
1692
+ private entity;
1693
+ constructor(entity: ScheduleData);
1694
+ get hasSchedule(): boolean;
1695
+ get isIdle(): boolean;
1696
+ get tasks(): Task[];
1697
+ duration(): number;
1698
+ elapsed(now: Date): number;
1699
+ remaining(now: Date): number;
1700
+ complete(now: Date): boolean;
1701
+ currentTaskIndex(now: Date): number;
1702
+ currentTask(now: Date): Task | undefined;
1703
+ currentTaskType(now: Date): TaskType | undefined;
1704
+ taskStartTime(index: number): number;
1705
+ taskElapsed(index: number, now: Date): number;
1706
+ taskRemaining(index: number, now: Date): number;
1707
+ taskComplete(index: number, now: Date): boolean;
1708
+ taskInProgress(index: number, now: Date): boolean;
1709
+ currentTaskProgress(now: Date): number;
1710
+ progress(now: Date): number;
1711
+ }
1712
+ declare function createScheduleAccessor(entity: ScheduleData): ScheduleAccessor;
1713
+
1714
+ declare class EntityInventory extends Types.cargo_item {
1715
+ private _item?;
1716
+ get item(): Item;
1717
+ get good(): Item;
1718
+ get name(): string;
1719
+ get unitMass(): UInt32;
1720
+ get totalMass(): UInt64;
1721
+ get hasCargo(): boolean;
1722
+ get isEmpty(): boolean;
1723
+ }
1724
+
1725
+ interface HasCargo {
1726
+ cargo: Types.cargo_item[];
1727
+ }
1728
+ interface HasCapacity {
1729
+ capacity: UInt32;
1730
+ }
1731
+ interface HasCargomass {
1732
+ cargomass: UInt32;
1733
+ }
1734
+ declare function calcCargoItemMass(item: Types.cargo_item): UInt64;
1735
+ declare function calcCargoMass(entity: HasCargo): UInt64;
1736
+ declare function availableCapacity$1(entity: StorageCapability): UInt64;
1737
+ declare function availableCapacityFromMass(capacity: UInt64Type, cargoMass: UInt64Type): UInt64;
1738
+ declare function hasSpace$1(entity: StorageCapability, goodMass: UInt64, quantity: number): boolean;
1739
+ declare function hasSpaceForMass(capacity: UInt64Type, currentMass: UInt64Type, additionalMass: UInt64Type): boolean;
1740
+ declare function isFull$1(entity: HasCapacity & HasCargomass): boolean;
1741
+ declare function isFullFromMass(capacity: UInt64Type, cargoMass: UInt64Type): boolean;
1742
+
1743
+ declare class InventoryAccessor {
1744
+ private readonly entity;
1745
+ private _items?;
1746
+ constructor(entity: HasCargo);
1747
+ get items(): EntityInventory[];
1748
+ get totalMass(): UInt64;
1749
+ forItem(goodId: UInt64Type): EntityInventory | undefined;
1750
+ get sellable(): EntityInventory[];
1751
+ get hasSellable(): boolean;
1752
+ get sellableCount(): number;
1753
+ }
1754
+ declare function createInventoryAccessor(entity: HasCargo): InventoryAccessor;
1755
+
1386
1756
  interface ShipStateInput {
1387
1757
  id: UInt64Type;
1388
- owner: NameType;
1758
+ owner: string;
1389
1759
  name: string;
1390
- location: CoordinatesType | {
1760
+ coordinates: CoordinatesType | {
1391
1761
  x: number;
1392
1762
  y: number;
1393
1763
  z?: number;
1394
1764
  };
1395
- mass: number;
1396
- capacity: number;
1397
- energy: number;
1398
- engines: Types.movement_stats;
1399
- generator: Types.energy_stats;
1400
- loaders: Types.loader_stats;
1765
+ hullmass?: number;
1766
+ capacity?: number;
1767
+ energy?: number;
1768
+ engines?: Types.movement_stats;
1769
+ generator?: Types.energy_stats;
1770
+ loaders?: Types.loader_stats;
1401
1771
  schedule?: Types.schedule;
1402
1772
  cargo?: Types.cargo_item[];
1403
1773
  }
1404
- declare class Ship extends Types.entity_info implements Scheduleable {
1405
- static fromState(state: ShipStateInput): Ship;
1406
- private _location?;
1407
- private _inventory?;
1774
+ declare class Ship extends Types.entity_info {
1775
+ private _sched?;
1776
+ private _inv?;
1408
1777
  get name(): string;
1778
+ get inv(): InventoryAccessor;
1409
1779
  get inventory(): EntityInventory[];
1780
+ get sched(): ScheduleAccessor;
1410
1781
  get maxDistance(): UInt32;
1411
- get hasSchedule(): boolean;
1412
1782
  get isIdle(): boolean;
1413
- get tasks(): Types.task[];
1414
- scheduleDuration(): number;
1415
- scheduleElapsed(now: Date): number;
1416
- scheduleRemaining(now: Date): number;
1417
- scheduleComplete(now: Date): boolean;
1418
- currentTaskIndex(now: Date): number;
1419
- currentTask(now: Date): Types.task | undefined;
1420
- currentTaskType(now: Date): TaskType | undefined;
1421
- getTaskStartTime(index: number): number;
1422
- getTaskElapsed(index: number, now: Date): number;
1423
- getTaskRemaining(index: number, now: Date): number;
1424
- isTaskComplete(index: number, now: Date): boolean;
1425
- isTaskInProgress(index: number, now: Date): boolean;
1426
- currentTaskProgress(now: Date): number;
1427
- scheduleProgress(now: Date): number;
1428
1783
  getFlightOrigin(flightTaskIndex: number): Coordinates;
1429
1784
  destinationLocation(): Coordinates | undefined;
1430
1785
  positionAt(now: Date): Coordinates;
@@ -1432,20 +1787,20 @@ declare class Ship extends Types.entity_info implements Scheduleable {
1432
1787
  isRecharging(now: Date): boolean;
1433
1788
  isLoading(now: Date): boolean;
1434
1789
  isUnloading(now: Date): boolean;
1435
- calcCargoMass(): UInt64;
1436
- private createProjectedEntity;
1790
+ isExtracting(now: Date): boolean;
1791
+ get hasEngines(): boolean;
1792
+ get hasGenerator(): boolean;
1793
+ get hasExtractor(): boolean;
1794
+ get hasWarp(): boolean;
1437
1795
  project(): ProjectedEntity;
1438
1796
  projectAt(now: Date): ProjectedEntity;
1439
- get currentLocation(): Coordinates;
1797
+ get location(): Location;
1440
1798
  get totalCargoMass(): UInt64;
1441
- get cargoValue(): UInt64;
1442
1799
  get totalMass(): UInt64;
1443
1800
  get maxCapacity(): UInt64;
1444
1801
  hasSpace(goodMass: UInt64, quantity: number): boolean;
1445
1802
  get availableCapacity(): UInt64;
1446
- get locationObject(): Location;
1447
- setLocation(location: Location): void;
1448
- getCargoForGood(goodId: UInt64Type): EntityInventory | undefined;
1803
+ getCargoForItem(goodId: UInt64Type): EntityInventory | undefined;
1449
1804
  get sellableCargo(): EntityInventory[];
1450
1805
  get hasSellableCargo(): boolean;
1451
1806
  get sellableGoodsCount(): number;
@@ -1453,23 +1808,238 @@ declare class Ship extends Types.entity_info implements Scheduleable {
1453
1808
  get energyPercent(): number;
1454
1809
  get needsRecharge(): boolean;
1455
1810
  hasEnergyFor(distance: UInt64): boolean;
1456
- calculateSaleValue(prices: Map<number, UInt64>): {
1457
- revenue: UInt64;
1458
- profit: UInt64;
1459
- cost: UInt64;
1811
+ }
1812
+
1813
+ interface WarehouseStateInput {
1814
+ id: UInt64Type;
1815
+ owner: string;
1816
+ name: string;
1817
+ coordinates: CoordinatesType | {
1818
+ x: number;
1819
+ y: number;
1820
+ z?: number;
1460
1821
  };
1461
- calculateSaleValueFromArray(prices: UInt64[]): {
1462
- revenue: UInt64;
1463
- profit: UInt64;
1464
- cost: UInt64;
1822
+ hullmass?: number;
1823
+ capacity: number;
1824
+ loaders?: Types.loader_stats;
1825
+ schedule?: Types.schedule;
1826
+ cargo?: Types.cargo_item[];
1827
+ }
1828
+ declare class Warehouse extends Types.entity_info {
1829
+ private _sched?;
1830
+ private _inv?;
1831
+ get name(): string;
1832
+ get inv(): InventoryAccessor;
1833
+ get inventory(): EntityInventory[];
1834
+ get sched(): ScheduleAccessor;
1835
+ get isIdle(): boolean;
1836
+ isLoading(now: Date): boolean;
1837
+ isUnloading(now: Date): boolean;
1838
+ get location(): Location;
1839
+ get totalCargoMass(): UInt64;
1840
+ get maxCapacity(): UInt64;
1841
+ get availableCapacity(): UInt64;
1842
+ hasSpace(goodMass: UInt64, quantity: number): boolean;
1843
+ get isFull(): boolean;
1844
+ getCargoForItem(goodId: UInt64Type): EntityInventory | undefined;
1845
+ get orbitalAltitude(): number;
1846
+ get totalMass(): UInt64;
1847
+ }
1848
+
1849
+ interface ContainerStateInput {
1850
+ id: UInt64Type;
1851
+ owner: string;
1852
+ name: string;
1853
+ coordinates: CoordinatesType | {
1854
+ x: number;
1855
+ y: number;
1856
+ z?: number;
1465
1857
  };
1466
- afterSellGoods(goodsToSell: Array<{
1467
- goodId: number;
1468
- quantity: number;
1469
- }>): EntityInventory[];
1470
- afterSellAllGoods(): EntityInventory[];
1858
+ hullmass: number;
1859
+ capacity: number;
1860
+ cargomass?: number;
1861
+ schedule?: Types.schedule;
1862
+ }
1863
+ declare class Container extends Types.entity_info {
1864
+ private _sched?;
1865
+ get name(): string;
1866
+ get sched(): ScheduleAccessor;
1867
+ get isIdle(): boolean;
1868
+ isLoading(now: Date): boolean;
1869
+ isUnloading(now: Date): boolean;
1870
+ get location(): Location;
1871
+ get totalMass(): UInt64;
1872
+ get maxCapacity(): UInt64;
1873
+ get availableCapacity(): UInt64;
1874
+ hasSpace(additionalMass: UInt64): boolean;
1875
+ get isFull(): boolean;
1876
+ get orbitalAltitude(): number;
1877
+ }
1878
+ declare function computeContainerCapabilities(stats: Record<string, number>): {
1879
+ hullmass: number;
1880
+ capacity: number;
1881
+ };
1882
+ declare function computeContainerT2Capabilities(stats: Record<string, number>): {
1883
+ hullmass: number;
1884
+ capacity: number;
1885
+ };
1886
+
1887
+ type EntityType = 'ship' | 'warehouse' | 'container' | 'location';
1888
+ declare class EntitiesManager extends BaseManager {
1889
+ getEntity(type: EntityType, id: UInt64Type): Promise<Ship | Warehouse | Container>;
1890
+ getEntities(owner: NameType | Types.player_row, type?: EntityType): Promise<(Ship | Warehouse | Container)[]>;
1891
+ getSummaries(owner: NameType | Types.player_row, type?: EntityType): Promise<Types.entity_summary[]>;
1892
+ getShip(id: UInt64Type): Promise<Ship>;
1893
+ getWarehouse(id: UInt64Type): Promise<Warehouse>;
1894
+ getContainer(id: UInt64Type): Promise<Container>;
1895
+ getShips(owner: NameType | Types.player_row): Promise<Ship[]>;
1896
+ getWarehouses(owner: NameType | Types.player_row): Promise<Warehouse[]>;
1897
+ getContainers(owner: NameType | Types.player_row): Promise<Container[]>;
1898
+ getShipSummaries(owner: NameType | Types.player_row): Promise<Types.entity_summary[]>;
1899
+ getWarehouseSummaries(owner: NameType | Types.player_row): Promise<Types.entity_summary[]>;
1900
+ getContainerSummaries(owner: NameType | Types.player_row): Promise<Types.entity_summary[]>;
1901
+ private wrapEntity;
1902
+ private resolveOwner;
1903
+ }
1904
+
1905
+ interface ShiploadOptions {
1906
+ platformContractName?: string;
1907
+ serverContractName?: string;
1908
+ client?: APIClient;
1909
+ }
1910
+ interface ShiploadConstructorOptions extends ShiploadOptions {
1911
+ platformContract?: Contract$2;
1912
+ serverContract?: Contract$2;
1913
+ }
1914
+ declare class Shipload {
1915
+ private readonly _context;
1916
+ constructor(chain: ChainDefinition, constructorOptions?: ShiploadConstructorOptions);
1917
+ static load(chain: ChainDefinition, shiploadOptions?: ShiploadOptions): Promise<Shipload>;
1918
+ get client(): APIClient;
1919
+ get server(): Contract$2;
1920
+ get platform(): Contract$2;
1921
+ get entities(): EntitiesManager;
1922
+ get players(): PlayersManager;
1923
+ get locations(): LocationsManager;
1924
+ get epochs(): EpochsManager;
1925
+ get actions(): ActionsManager;
1926
+ getGame(reload?: boolean): Promise<Types$1.game_row>;
1927
+ getState(reload?: boolean): Promise<GameState>;
1471
1928
  }
1472
1929
 
1930
+ declare function makeShip(state: ShipStateInput): Ship;
1931
+ declare function makeWarehouse(state: WarehouseStateInput): Warehouse;
1932
+ declare function makeContainer(state: ContainerStateInput): Container;
1933
+
1934
+ declare const itemIds: UInt16[];
1935
+ declare function getItem(itemId: UInt16Type): Item;
1936
+ declare function getItems(): Item[];
1937
+
1938
+ declare function getLocationType(gameSeed: Checksum256Type, coordinates: CoordinatesType): LocationType;
1939
+ declare function isExtractableLocation(locationType: LocationType): boolean;
1940
+ declare function getSystemName(gameSeed: Checksum256Type, location: CoordinatesType): string;
1941
+ declare function hasSystem(gameSeed: Checksum256Type, coordinates: CoordinatesType): boolean;
1942
+ declare function deriveLocationStatic(gameSeed: Checksum256Type, coordinates: CoordinatesType): Types.location_static;
1943
+ declare function deriveLocationEpoch(epochSeed: Checksum256Type, coordinates: CoordinatesType): Types.location_epoch;
1944
+ declare function deriveLocation(gameSeed: Checksum256Type, epochSeed: Checksum256Type, coordinates: CoordinatesType): Types.location_derived;
1945
+
1946
+ interface StratumInfo {
1947
+ itemId: number;
1948
+ seed: bigint;
1949
+ richness: number;
1950
+ reserve: number;
1951
+ }
1952
+ interface ResourceStats {
1953
+ stat1: number;
1954
+ stat2: number;
1955
+ stat3: number;
1956
+ }
1957
+ declare function deriveStratum(epochSeed: Checksum256Type, coords: CoordinatesType, stratum: number, locationType: number, subtype: number, _maxDepth: number): StratumInfo;
1958
+ declare function deriveResourceStats(seed: bigint): ResourceStats;
1959
+
1960
+ declare function deriveLocationSize(loc: Types.location_static): number;
1961
+
1962
+ declare const DEPTH_THRESHOLD_T1 = 0;
1963
+ declare const DEPTH_THRESHOLD_T2 = 2000;
1964
+ declare const DEPTH_THRESHOLD_T3 = 10000;
1965
+ declare const DEPTH_THRESHOLD_T4 = 30000;
1966
+ declare const DEPTH_THRESHOLD_T5 = 55000;
1967
+ declare const LOCATION_MIN_DEPTH = 500;
1968
+ declare const LOCATION_MAX_DEPTH = 65535;
1969
+ declare const PLANET_SUBTYPE_GAS_GIANT = 0;
1970
+ declare const PLANET_SUBTYPE_ROCKY = 1;
1971
+ declare const PLANET_SUBTYPE_TERRESTRIAL = 2;
1972
+ declare const PLANET_SUBTYPE_ICY = 3;
1973
+ declare const PLANET_SUBTYPE_OCEAN = 4;
1974
+ declare const PLANET_SUBTYPE_INDUSTRIAL = 5;
1975
+ declare function getDepthThreshold(tier: ResourceTier): number;
1976
+ declare function getResourceTier(itemId: number): ResourceTier;
1977
+ declare function getResourceWeight(itemId: number, stratum: number): number;
1978
+ declare function getLocationCandidates(locationType: number, subtype: number): number[];
1979
+ declare function getEligibleResources(locationType: number, subtype: number, stratum: number): number[];
1980
+ declare function depthScaleFactor(stratum: number): number;
1981
+
1982
+ interface StatDefinition {
1983
+ key: string;
1984
+ label: string;
1985
+ abbreviation: string;
1986
+ purpose: string;
1987
+ inverted?: boolean;
1988
+ }
1989
+ declare function getStatDefinitions(category: ResourceCategory): StatDefinition[];
1990
+ declare function getStatName(category: ResourceCategory, index: 0 | 1 | 2): StatDefinition;
1991
+ interface NamedStats {
1992
+ definitions: StatDefinition[];
1993
+ values: [number, number, number];
1994
+ }
1995
+ declare function resolveStats(category: ResourceCategory, stats: {
1996
+ stat1: number;
1997
+ stat2: number;
1998
+ stat3: number;
1999
+ }): NamedStats;
2000
+
2001
+ interface StackInput {
2002
+ quantity: number;
2003
+ stats: Record<string, number>;
2004
+ }
2005
+ interface CategoryStacks {
2006
+ category: ResourceCategory;
2007
+ stacks: StackInput[];
2008
+ }
2009
+ declare function encodeStats(values: number[]): bigint;
2010
+ declare function decodeStat(seed: bigint, index: number): number;
2011
+ declare function decodeStats(seed: bigint, count: number): number[];
2012
+ declare function decodeCraftedItemStats(itemId: number, seed: bigint): Record<string, number>;
2013
+ declare function blendStacks(stacks: StackInput[], statKey: string): number;
2014
+ declare function computeComponentStats(componentId: number, categoryStacks: CategoryStacks[]): {
2015
+ key: string;
2016
+ value: number;
2017
+ }[];
2018
+ declare function blendComponentStacks(stacks: {
2019
+ quantity: number;
2020
+ stats: Record<string, number>;
2021
+ }[]): Record<string, number>;
2022
+ declare function computeEntityStats(entityRecipeId: string, componentStacks: Record<number, {
2023
+ quantity: number;
2024
+ stats: Record<string, number>;
2025
+ }[]>): {
2026
+ key: string;
2027
+ value: number;
2028
+ }[];
2029
+ declare const categoryItemMass: Record<string, number>;
2030
+ declare function computeInputMass(itemId: string | number, itemType: 'component' | 'module' | 'entity'): number;
2031
+ declare function blendCrossGroup(sources: {
2032
+ value: number;
2033
+ weight: number;
2034
+ }[]): number;
2035
+ declare function blendCargoStacks(itemId: number, stacks: {
2036
+ quantity: number;
2037
+ seed: UInt64;
2038
+ }[]): UInt64;
2039
+
2040
+ declare function hash(seed: Checksum256Type, string: string): Checksum256;
2041
+ declare function hash512(seed: Checksum256Type, string: string): Checksum512;
2042
+
1473
2043
  /**
1474
2044
  * Travel calculations for ship movement, energy usage, and flight times.
1475
2045
  *
@@ -1542,578 +2112,492 @@ interface TransferEntity {
1542
2112
  } | number;
1543
2113
  };
1544
2114
  }
1545
- declare function calc_transfer_duration(source: TransferEntity, dest: TransferEntity, cargoMass: number): number;
1546
-
1547
- /**
1548
- * Trading deal interface representing a profitable trade opportunity
1549
- */
1550
- interface Deal {
1551
- /** Origin location */
1552
- origin: Location;
1553
- /** Destination location */
1554
- destination: Location;
1555
- /** Good to trade */
1556
- good: GoodPrice;
1557
- /** Distance between origin and destination */
1558
- distance: UInt64;
1559
- /** Available supply at origin */
1560
- supply: UInt16;
1561
- /** Buy price at origin */
1562
- buyPrice: UInt32;
1563
- /** Sell price at destination */
1564
- sellPrice: UInt32;
1565
- /** Profit per unit */
1566
- profitPerUnit: UInt32;
1567
- /** Maximum quantity that can be traded */
1568
- maxQuantity: UInt32;
1569
- /** Total profit for max quantity */
1570
- totalProfit: Int64;
1571
- /** Estimated travel time in seconds */
1572
- travelTime: UInt32;
1573
- /** Detailed breakdown of travel time components */
1574
- travelTimeBreakdown: EstimatedTravelTime;
1575
- /** Profit per second (floating point for UI display) */
1576
- profitPerSecond: number;
1577
- /** Profit margin percentage (floating point for UI display) */
1578
- marginPercent: number;
1579
- }
1580
- /**
1581
- * Options for finding deals
1582
- */
1583
- interface FindDealsOptions {
1584
- /** Maximum number of deals to return */
1585
- maxDeals?: number;
1586
- /** Maximum search distance */
1587
- maxDistance?: number;
1588
- /** Player's current balance (for affordability filtering) */
1589
- playerBalance?: UInt64Type;
1590
- /** Minimum profit per second threshold */
1591
- minProfitPerSecond?: number;
1592
- /** Minimum profit margin percentage */
1593
- minMarginPercent?: number;
1594
- /** Override available cargo space (in mass units). If provided, uses this instead of calculating from ship's current cargo. */
1595
- availableSpace?: number;
2115
+ interface HasScheduleAndLocation {
2116
+ coordinates: ActionParams.Type.coordinates;
2117
+ schedule?: Types.schedule;
1596
2118
  }
1597
- /**
1598
- * Calculate deals for a ship from a specific origin location
1599
- */
1600
- declare function findDealsForShip(ship: Ship, originLocation: Coordinates, getNearbyLocations: (origin: Coordinates, maxDistance: number) => Promise<Location[]>, getMarketPrices: (location: Coordinates) => Promise<GoodPrice[]>, options?: FindDealsOptions): Promise<Deal[]>;
1601
- /**
1602
- * Find the single best deal for a ship from a specific origin location
1603
- */
1604
- declare function findBestDeal(ship: Ship, originLocation: Coordinates, getNearbyLocations: (origin: Coordinates, maxDistance: number) => Promise<Location[]>, getMarketPrices: (location: Coordinates) => Promise<GoodPrice[]>, options?: FindDealsOptions): Promise<Deal | undefined>;
2119
+ declare function getFlightOrigin(entity: HasScheduleAndLocation, flightTaskIndex: number): ActionParams.Type.coordinates;
2120
+ declare function getDestinationLocation(entity: HasScheduleAndLocation): ActionParams.Type.coordinates | undefined;
2121
+ declare function getPositionAt(entity: HasScheduleAndLocation, taskIndex: number, taskProgress: number): ActionParams.Type.coordinates;
2122
+ declare function calc_transfer_duration(source: TransferEntity, dest: TransferEntity, cargoMass: number): number;
1605
2123
 
1606
- /**
1607
- * Types of collect actions available to the player
1608
- */
1609
- type CollectActionType = 'sell-and-trade' | 'sell-and-reposition' | 'travel-to-sell' | 'sell-and-stay' | 'explore' | 'orbit';
1610
- /**
1611
- * Represents a single collect option presented to the player
1612
- */
1613
- interface CollectOption {
1614
- /** Unique identifier for this option */
1615
- id: string;
1616
- /** Type of action sequence */
1617
- type: CollectActionType;
1618
- /** Human-readable title */
1619
- title: string;
1620
- /** Detailed description of what will happen */
1621
- description: string;
1622
- /** Brief explanation of why this option is worth considering */
1623
- reason: string;
1624
- /** Whether this is the recommended option (best profitPerSecond with quality threshold) */
1625
- recommended: boolean;
1626
- /** Whether this option has the highest absolute profit (may differ from recommended) */
1627
- highestProfit: boolean;
1628
- /** Estimated profit/loss from this action */
1629
- estimatedProfit: UInt64;
1630
- /** Revenue from selling cargo (if applicable) */
1631
- saleRevenue?: UInt64;
1632
- /** Cost of purchasing new cargo (if applicable) */
1633
- purchaseCost?: UInt64;
1634
- /** Expected profit from the next trade (if applicable) */
1635
- nextTradeProfit?: UInt64;
1636
- /** Profit per second for this option (floating point for display) */
1637
- profitPerSecond?: number;
1638
- /** Margin percentage for the deal (floating point for display) */
1639
- marginPercent?: number;
1640
- /** Destination location (if traveling) */
1641
- destination?: Location;
1642
- /** Deal to execute (if buying goods) */
1643
- deal?: Deal;
1644
- /** Sale location if different from current */
1645
- saleLocation?: Location;
1646
- /** Price per unit at sale location */
1647
- salePrice?: UInt32;
1648
- /** Price per unit at current location (for comparison) */
1649
- currentPrice?: UInt32;
1650
- /** Estimated travel time in seconds (undefined = instant/no travel) */
1651
- travelTime?: UInt32;
1652
- /** Detailed breakdown of travel time components */
1653
- travelTimeBreakdown?: EstimatedTravelTime;
1654
- /** Info about a discounted good at the destination (for explore options) */
1655
- discountedGood?: DiscountedGoodInfo;
1656
- /** Top potential deals available at destination (for explore options) */
1657
- potentialDeals?: PotentialDeal[];
1658
- /** Details of cargo being sold (if selling cargo) */
1659
- cargoSale?: CargoSaleItem[];
1660
- /** Total profit/loss from selling cargo */
1661
- cargoProfitLoss?: Int64;
1662
- }
1663
- /**
1664
- * Analysis result for collect options
1665
- */
1666
- interface CollectAnalysis {
1667
- /** Current location where ship arrived */
1668
- arrivedAt: Coordinates;
1669
- /** Ship being analyzed */
1670
- ship: Ship;
1671
- /** Current cargo on ship */
2124
+ interface CargoData {
1672
2125
  cargo: EntityInventory[];
1673
- /** Value of cargo if sold at current location */
1674
- cargoValueHere: UInt64;
1675
- /** All available options, sorted by estimated profit */
1676
- options: CollectOption[];
1677
- /** Whether any profitable options exist */
1678
- hasProfitableOptions: boolean;
1679
- }
1680
- /**
1681
- * Options for analyzing collect choices
1682
- */
1683
- interface CollectAnalysisOptions {
1684
- /** Player's current balance (defaults to Infinity) */
1685
- playerBalance?: number;
1686
- /** Maximum distance to search (defaults to ship's max range) */
1687
- maxDistance?: number;
1688
- /** Minimum profit improvement to suggest traveling elsewhere to sell */
1689
- minSaleImprovement?: number;
1690
- }
1691
- /**
1692
- * Find locations where current cargo could be sold for more
1693
- */
1694
- interface BetterSaleLocation {
1695
- location: Location;
1696
- /** Price per unit at this location */
1697
- price: UInt32;
1698
- /** Total revenue if sold here */
1699
- revenue: UInt64;
1700
- /** Difference vs selling at current location */
1701
- improvement: Int64;
1702
- /** Best deal available at this location after selling */
1703
- bestDealAfterSale?: Deal;
1704
- /** Distance to this location */
1705
- distance: UInt64;
1706
- /** Estimated travel time */
1707
- travelTime: UInt32;
1708
- /** Detailed breakdown of travel time components */
1709
- travelTimeBreakdown?: EstimatedTravelTime;
1710
- }
1711
- /**
1712
- * Find locations with good deals when current location has none
1713
- */
1714
- interface RepositionLocation {
1715
- location: Location;
1716
- /** Best deal available at this location */
1717
- bestDeal: Deal;
1718
- /** Distance to this location */
1719
- distance: UInt64;
1720
- /** Estimated travel time */
1721
- travelTime: UInt32;
1722
- /** Detailed breakdown of travel time components */
1723
- travelTimeBreakdown?: EstimatedTravelTime;
1724
- }
1725
- /**
1726
- * Analyze cargo sale value at a specific location
1727
- */
1728
- declare function analyzeCargoSale(cargo: EntityInventory[], prices: Map<number, UInt64>): {
1729
- revenue: UInt64;
1730
- cost: UInt64;
1731
- profit: Int64;
1732
- };
1733
- /**
1734
- * Create a "Sell & Trade" option (full loop)
1735
- */
1736
- declare function createSellAndTradeOption(saleRevenue: UInt64, saleCost: UInt64, deal: Deal, cargoSale?: CargoSaleItem[], unloadTime?: UInt32): CollectOption;
1737
- /**
1738
- * Create a "Travel to Sell" option (better market elsewhere)
1739
- */
1740
- declare function createTravelToSellOption(currentRevenue: UInt64, cargoCost: UInt64, betterSale: BetterSaleLocation, cargo: EntityInventory[], destPrices?: Map<number, UInt64>): CollectOption;
1741
- /**
1742
- * Create a "Sell & Reposition" option (sell here, travel empty to deals)
1743
- */
1744
- declare function createSellAndRepositionOption(saleRevenue: UInt64, saleCost: UInt64, reposition: RepositionLocation, cargoSale?: CargoSaleItem[]): CollectOption;
1745
- /**
1746
- * Create a "Sell & Stay" option (just sell, stay idle)
1747
- */
1748
- declare function createSellAndStayOption(saleRevenue: UInt64, saleCost: UInt64, cargoSale?: CargoSaleItem[], unloadTime?: UInt32): CollectOption;
1749
- /**
1750
- * Details about a cargo item being sold
1751
- */
1752
- interface CargoSaleItem {
1753
- goodId: UInt16;
1754
- goodName: string;
1755
- quantity: UInt32;
1756
- /** Price per unit at sale location */
1757
- pricePerUnit: UInt32;
1758
- /** Total revenue from this item */
1759
- revenue: UInt64;
1760
- /** Original cost (paid) per unit */
1761
- costPerUnit: UInt64;
1762
- /** Profit/loss on this item */
1763
- profit: Int64;
1764
2126
  }
1765
- /**
1766
- * Info about a discounted good for explore options
1767
- */
1768
- interface DiscountedGoodInfo {
1769
- goodId: number;
1770
- name: string;
1771
- rarity: string;
1772
- discountPercent: number;
1773
- }
1774
- /**
1775
- * A potential deal available at a destination (for explore options)
1776
- */
1777
- interface PotentialDeal {
2127
+ declare function totalCargoMass(cargo: EntityInventory[]): UInt64;
2128
+ declare function getCargoForItem(cargo: EntityInventory[], goodId: UInt64Type): EntityInventory | undefined;
2129
+ declare function hasSpace(currentMass: UInt64, maxCapacity: UInt64, goodMass: UInt64, quantity: number): boolean;
2130
+ declare function availableCapacity(currentMass: UInt64, maxCapacity: UInt64): UInt64;
2131
+ declare function isFull(currentMass: UInt64, maxCapacity: UInt64): boolean;
2132
+ declare function afterRemoveItems(cargo: Types.cargo_item[], goodsToRemove: Array<{
1778
2133
  goodId: number;
1779
- goodName: string;
1780
- destinationCoords: Coordinates;
1781
- marginPercent: number;
1782
- profitPerSecond: number;
1783
- }
1784
- /**
1785
- * Create an "Explore" option (travel to find opportunities)
1786
- */
1787
- declare function createExploreOption(destination: Location, travelTime?: UInt32, discountedGood?: DiscountedGoodInfo, travelTimeBreakdown?: EstimatedTravelTime, potentialDeals?: PotentialDeal[]): CollectOption;
1788
- /**
1789
- * Callbacks for collect analysis (provided by manager)
1790
- */
1791
- interface CollectAnalysisCallbacks {
1792
- getNearbyLocations: (origin: Coordinates, maxDistance: number) => Promise<Location[]>;
1793
- getMarketPrices: (location: Coordinates) => Promise<GoodPrice[]>;
1794
- getGameSeed?: () => Checksum256Type;
1795
- getState?: () => Types.state_row;
1796
- }
1797
- /**
1798
- * Analyze all collect options for a ship that has arrived at its destination.
1799
- * Returns all available options sorted by estimated profit.
1800
- */
1801
- declare function analyzeCollectOptions(ship: Ship, arrivedAt: Coordinates, callbacks: CollectAnalysisCallbacks, options?: CollectAnalysisOptions): Promise<CollectAnalysis>;
1802
-
1803
- declare class TradesManager extends BaseManager {
1804
- private priceCache;
1805
- private priceCacheEpoch;
1806
- private makePriceCacheKey;
1807
- private createCallbacks;
1808
- clearPriceCache(): void;
1809
- findDeals(ship: Ship, originLocation?: Coordinates, options?: FindDealsOptions): Promise<Deal[]>;
1810
- findBestDeal(ship: Ship, originLocation?: Coordinates, options?: FindDealsOptions): Promise<Deal | undefined>;
1811
- getCollectOptions(ship: Ship, arrivedAt?: Coordinates, options?: CollectAnalysisOptions): Promise<CollectAnalysis>;
1812
- }
2134
+ quantity: number;
2135
+ }>): EntityInventory[];
2136
+ declare function afterRemoveAllItems(cargo: Types.cargo_item[]): EntityInventory[];
1813
2137
 
1814
- declare class EpochsManager extends BaseManager {
1815
- getCurrentHeight(): Promise<UInt64>;
1816
- getCurrent(): Promise<EpochInfo>;
1817
- getByHeight(height: UInt64Type): Promise<EpochInfo>;
1818
- getTimeRemaining(): Promise<number>;
1819
- getProgress(): Promise<number>;
1820
- fitsInCurrentEpoch(durationMs: number): Promise<boolean>;
2138
+ type cargoUtils_CargoData = CargoData;
2139
+ declare const cargoUtils_totalCargoMass: typeof totalCargoMass;
2140
+ declare const cargoUtils_getCargoForItem: typeof getCargoForItem;
2141
+ declare const cargoUtils_hasSpace: typeof hasSpace;
2142
+ declare const cargoUtils_availableCapacity: typeof availableCapacity;
2143
+ declare const cargoUtils_isFull: typeof isFull;
2144
+ declare const cargoUtils_afterRemoveItems: typeof afterRemoveItems;
2145
+ declare const cargoUtils_afterRemoveAllItems: typeof afterRemoveAllItems;
2146
+ declare namespace cargoUtils {
2147
+ export {
2148
+ cargoUtils_CargoData as CargoData,
2149
+ cargoUtils_totalCargoMass as totalCargoMass,
2150
+ cargoUtils_getCargoForItem as getCargoForItem,
2151
+ cargoUtils_hasSpace as hasSpace,
2152
+ cargoUtils_availableCapacity as availableCapacity,
2153
+ cargoUtils_isFull as isFull,
2154
+ cargoUtils_afterRemoveItems as afterRemoveItems,
2155
+ cargoUtils_afterRemoveAllItems as afterRemoveAllItems,
2156
+ };
1821
2157
  }
1822
2158
 
1823
- interface SellableCargo {
1824
- good_id: {
1825
- toNumber(): number;
1826
- } | number;
1827
- quantity: {
1828
- toNumber(): number;
1829
- } | number;
1830
- hasCargo: boolean;
1831
- }
1832
- type CargoItemInput = {
1833
- goodId: UInt64Type;
1834
- quantity: UInt64Type;
1835
- unitCost?: UInt64Type;
2159
+ interface Entity {
2160
+ id: UInt64;
2161
+ type: Name;
2162
+ owner: Name;
2163
+ entity_name: string;
2164
+ location: Coordinates | Types.coordinates;
2165
+ }
2166
+ type ShipEntity = Entity & Partial<MovementCapability> & Partial<EnergyCapability> & StorageCapability & Partial<LoaderCapability> & MassCapability & ScheduleCapability & {
2167
+ extractor?: Types.extractor_stats;
1836
2168
  };
1837
- declare class ActionsManager extends BaseManager {
1838
- travel(shipId: UInt64Type, destination: CoordinatesType, recharge?: boolean): Action;
1839
- resolve(entityId: UInt64Type, entityType?: EntityTypeName): Action;
1840
- cancel(entityId: UInt64Type, count: UInt64Type, entityType?: EntityTypeName): Action;
1841
- recharge(shipId: UInt64Type): Action;
1842
- transfer(sourceType: EntityTypeName, sourceId: UInt64Type, destType: EntityTypeName, destId: UInt64Type, cargo: CargoItemInput[]): Action;
1843
- buyGoods(shipId: UInt64Type, goodId: UInt64Type, quantity: UInt64Type): Action;
1844
- sellGoods(shipId: UInt64Type, goodId: UInt64Type, quantity: UInt64Type): Action;
1845
- buyShip(account: NameType, name: string): Action;
1846
- buyWarehouse(account: NameType, shipId: UInt64Type, name: string): Action;
1847
- takeLoan(account: NameType, amount: UInt64Type): Action;
1848
- payLoan(account: NameType, amount: UInt64Type): Action;
1849
- foundCompany(account: NameType, name: string): Action;
1850
- join(account: NameType): Action;
1851
- joinGame(account: NameType, companyName: string): Action[];
1852
- sellAllCargo(ship: Ship | UInt64Type, cargo?: SellableCargo[]): Action[];
1853
- }
2169
+ type WarehouseEntity = Entity & StorageCapability & Partial<LoaderCapability> & MassCapability & ScheduleCapability;
2170
+ type ContainerEntity = Entity & StorageCapability & MassCapability & ScheduleCapability;
2171
+ type AnyEntity = ShipEntity | WarehouseEntity | ContainerEntity;
1854
2172
 
1855
- declare class GameContext {
1856
- readonly client: APIClient;
1857
- readonly server: Contract$2;
1858
- readonly platform: Contract$2;
1859
- private _entities?;
1860
- private _players?;
1861
- private _locations?;
1862
- private _trades?;
1863
- private _epochs?;
1864
- private _actions?;
1865
- private _gameCache?;
1866
- private _stateCache?;
1867
- constructor(client: APIClient, server: Contract$2, platform: Contract$2);
1868
- get entities(): EntitiesManager;
1869
- get players(): PlayersManager;
1870
- get locations(): LocationsManager;
1871
- get trades(): TradesManager;
1872
- get epochs(): EpochsManager;
1873
- get actions(): ActionsManager;
1874
- getGame(reload?: boolean): Promise<Types$1.game_row>;
1875
- getState(reload?: boolean): Promise<GameState>;
1876
- get cachedGame(): Types$1.game_row | undefined;
1877
- get cachedState(): GameState | undefined;
1878
- }
2173
+ declare function canMove(e: Entity): e is Entity & MovementCapability & EnergyCapability;
2174
+ declare function hasEnergy(e: Entity): e is Entity & EnergyCapability;
2175
+ declare function hasStorage(e: Entity): e is Entity & StorageCapability;
2176
+ declare function hasLoaders(e: Entity): e is Entity & LoaderCapability;
2177
+ declare function hasMass(e: Entity): e is Entity & MassCapability;
2178
+ declare function hasSchedule(e: Entity): e is Entity & ScheduleCapability;
2179
+ declare function hasExtractor(e: Entity): e is Entity & ExtractorCapability;
1879
2180
 
1880
- declare abstract class BaseManager {
1881
- protected readonly context: GameContext;
1882
- constructor(context: GameContext);
1883
- protected get client(): _wharfkit_antelope.APIClient;
1884
- protected get server(): _wharfkit_contract.Contract;
1885
- protected get platform(): _wharfkit_contract.Contract;
1886
- protected getGame(): Promise<Types$1.game_row>;
1887
- protected getState(): Promise<GameState>;
2181
+ declare function maxTravelDistance(entity: MovementCapability): UInt32;
2182
+ declare function calcEnergyUsage(entity: MovementCapability, distance: UInt64): UInt64;
2183
+ declare function energyPercent(entity: MovementCapability & EnergyCapability): number;
2184
+ declare function needsRecharge(entity: MovementCapability & EnergyCapability): boolean;
2185
+
2186
+ declare function calcLoadDuration(entity: LoaderCapability, cargoMass: UInt64): UInt32;
2187
+
2188
+ declare function calc_extraction_duration(extractor: Types.extractor_stats, itemMass: number, quantity: number, stratum: number, richness: number): UInt32;
2189
+ declare function calc_extraction_energy(extractor: Types.extractor_stats, duration: number): UInt16;
2190
+
2191
+ interface CrafterCapability {
2192
+ crafter: Types.crafter_stats;
1888
2193
  }
2194
+ declare function capsHasCrafter(caps: EntityCapabilities): boolean;
2195
+ declare function calc_craft_duration(speed: number, totalInputMass: number, quantity: number): UInt32;
2196
+ declare function calc_craft_energy(drain: number, totalInputMass: number): UInt16;
1889
2197
 
1890
- interface WarehouseStateInput {
1891
- id: UInt64Type;
1892
- owner: NameType;
2198
+ declare const ITEM_ENGINE_T1 = 10100;
2199
+ declare const ITEM_GENERATOR_T1 = 10101;
2200
+ declare const ITEM_EXTRACTOR_T1 = 10102;
2201
+ declare const ITEM_LOADER_T1 = 10103;
2202
+ declare const ITEM_MANUFACTURING_T1 = 10104;
2203
+ declare const ITEM_STORAGE_T1 = 10105;
2204
+ declare const ITEM_HAULER_T1 = 10106;
2205
+ declare const MODULE_ANY = 0;
2206
+ declare const MODULE_ENGINE = 1;
2207
+ declare const MODULE_GENERATOR = 2;
2208
+ declare const MODULE_EXTRACTOR = 3;
2209
+ declare const MODULE_LOADER = 4;
2210
+ declare const MODULE_WARP = 5;
2211
+ declare const MODULE_CRAFTER = 6;
2212
+ declare const MODULE_LAUNCHER = 7;
2213
+ declare const MODULE_STORAGE = 8;
2214
+ declare const MODULE_HAULER = 9;
2215
+ interface CargoSeed {
2216
+ itemId: number;
2217
+ seed: bigint;
2218
+ }
2219
+ interface ModuleEntry {
2220
+ type: number;
2221
+ installed?: CargoSeed;
2222
+ }
2223
+ declare function moduleAccepts(slotType: number, moduleType: number): boolean;
2224
+ declare function getModuleCapabilityType(itemId: number): number;
2225
+ declare function isModuleItem(itemId: number): boolean;
2226
+
2227
+ declare function computeHaulPenalty(totalThrust: number, haulCount: number, avgEfficiency: number): number;
2228
+ declare function computeHaulerDrain(distance: number, drain: number, haulCount: number): number;
2229
+
2230
+ declare const categoryColors: Record<ResourceCategory, string>;
2231
+ declare const tierColors: Record<ResourceTier, string>;
2232
+ declare const categoryIcons: Record<ResourceCategory, string>;
2233
+ declare const componentIcon = "\u25A3";
2234
+ declare const moduleIcon = "\u2B22";
2235
+ declare const itemIcons: Record<number, string>;
2236
+
2237
+ type CraftedItemCategory = 'component' | 'module' | 'entity' | 'resource';
2238
+ declare const ITEM_TYPE_RESOURCE = 0;
2239
+ declare const ITEM_TYPE_COMPONENT = 1;
2240
+ declare const ITEM_TYPE_MODULE = 2;
2241
+ declare const ITEM_TYPE_ENTITY = 3;
2242
+ declare function itemTypeCode(id: number): number;
2243
+ declare function itemTier(id: number): number;
2244
+ declare function itemOffset(id: number): number;
2245
+ declare function itemCategory(id: number): CraftedItemCategory;
2246
+ declare function isRelatedItem(a: number, b: number): boolean;
2247
+ declare function isCraftedItem(id: number): boolean;
2248
+
2249
+ interface CategoryInfo {
2250
+ id: ResourceCategory;
1893
2251
  name: string;
1894
- location: CoordinatesType | {
1895
- x: number;
1896
- y: number;
1897
- z?: number;
1898
- };
1899
- capacity: number;
1900
- loaders: Types.loader_stats;
1901
- schedule?: Types.schedule;
1902
- cargo?: Types.cargo_item[];
2252
+ label: string;
2253
+ description: string;
2254
+ color: string;
1903
2255
  }
1904
- declare class Warehouse extends Types.entity_info implements Scheduleable {
1905
- static fromState(state: WarehouseStateInput): Warehouse;
1906
- private _location?;
1907
- private _inventory?;
1908
- get name(): string;
1909
- get inventory(): EntityInventory[];
1910
- get hasSchedule(): boolean;
1911
- get isIdle(): boolean;
1912
- get tasks(): Types.task[];
1913
- scheduleDuration(): number;
1914
- scheduleElapsed(now: Date): number;
1915
- scheduleRemaining(now: Date): number;
1916
- scheduleComplete(now: Date): boolean;
1917
- currentTaskIndex(now: Date): number;
1918
- currentTask(now: Date): Types.task | undefined;
1919
- currentTaskType(now: Date): TaskType | undefined;
1920
- getTaskStartTime(index: number): number;
1921
- getTaskElapsed(index: number, now: Date): number;
1922
- getTaskRemaining(index: number, now: Date): number;
1923
- isTaskComplete(index: number, now: Date): boolean;
1924
- isTaskInProgress(index: number, now: Date): boolean;
1925
- currentTaskProgress(now: Date): number;
1926
- scheduleProgress(now: Date): number;
1927
- isLoading(now: Date): boolean;
1928
- isUnloading(now: Date): boolean;
1929
- calcCargoMass(): UInt64;
1930
- get currentLocation(): Coordinates;
1931
- get totalCargoMass(): UInt64;
1932
- get cargoValue(): UInt64;
1933
- get maxCapacity(): UInt64;
1934
- get availableCapacity(): UInt64;
1935
- hasSpace(goodMass: UInt64, quantity: number): boolean;
1936
- get isFull(): boolean;
1937
- get locationObject(): Location;
1938
- setLocation(location: Location): void;
1939
- getCargoForGood(goodId: UInt64Type): EntityInventory | undefined;
1940
- get orbitalAltitude(): number;
2256
+ declare function getCategoryInfo(): CategoryInfo[];
2257
+ declare function getCategoryInfo(id: ResourceCategory): CategoryInfo | undefined;
2258
+
2259
+ interface PlanetSubtypeInfo {
2260
+ id: number;
2261
+ label: string;
2262
+ description: string;
2263
+ paletteType: string;
1941
2264
  }
2265
+ declare function getPlanetSubtypes(): PlanetSubtypeInfo[];
2266
+ declare function getPlanetSubtype(id: number): PlanetSubtypeInfo | undefined;
1942
2267
 
1943
- type EntityType = 'ship' | 'warehouse';
1944
- declare class EntitiesManager extends BaseManager {
1945
- getEntity(type: EntityType, id: UInt64Type): Promise<Ship | Warehouse>;
1946
- getEntities(owner: NameType | Types.player_row, type?: EntityType): Promise<(Ship | Warehouse)[]>;
1947
- getSummaries(owner: NameType | Types.player_row, type?: EntityType): Promise<Types.entity_summary[]>;
1948
- getShip(id: UInt64Type): Promise<Ship>;
1949
- getWarehouse(id: UInt64Type): Promise<Warehouse>;
1950
- getShips(owner: NameType | Types.player_row): Promise<Ship[]>;
1951
- getWarehouses(owner: NameType | Types.player_row): Promise<Warehouse[]>;
1952
- getShipSummaries(owner: NameType | Types.player_row): Promise<Types.entity_summary[]>;
1953
- getWarehouseSummaries(owner: NameType | Types.player_row): Promise<Types.entity_summary[]>;
1954
- private wrapEntity;
1955
- private resolveOwner;
2268
+ interface CapabilityAttribute {
2269
+ capability: string;
2270
+ attribute: string;
2271
+ description: string;
1956
2272
  }
2273
+ interface StatMapping {
2274
+ stat: string;
2275
+ capability: string;
2276
+ attribute: string;
2277
+ rationale: string;
2278
+ }
2279
+ declare const capabilityNames: string[];
2280
+ declare const capabilityAttributes: CapabilityAttribute[];
2281
+ declare const statMappings: StatMapping[];
2282
+ declare function isInvertedAttribute(attribute: string): boolean;
2283
+ declare function getCapabilityAttributes(capability?: string): CapabilityAttribute[];
2284
+ declare function getStatMappings(): StatMapping[];
2285
+ declare function getStatMappingsForStat(stat: string): StatMapping[];
2286
+ declare function getStatMappingsForCapability(capability: string): StatMapping[];
1957
2287
 
1958
- interface ShiploadOptions {
1959
- platformContractName?: string;
1960
- serverContractName?: string;
1961
- client?: APIClient;
2288
+ declare const ITEM_DRILL_SHAFT = 10005;
2289
+ declare const ITEM_EXTRACTION_PROBE = 10006;
2290
+ declare const ITEM_CARGO_ARM = 10007;
2291
+ declare const ITEM_TOOL_BIT = 10008;
2292
+ declare const ITEM_REACTION_CHAMBER = 10009;
2293
+ declare const ITEM_FOCUSING_ARRAY = 10010;
2294
+ declare const ITEM_HULL_PLATES = 10001;
2295
+ declare const ITEM_CARGO_LINING = 10002;
2296
+ declare const ITEM_CONTAINER_T1_PACKED = 10200;
2297
+ declare const ITEM_THRUSTER_CORE = 10003;
2298
+ declare const ITEM_POWER_CELL = 10004;
2299
+ declare const ITEM_SHIP_T1_PACKED = 10201;
2300
+ declare const ITEM_WAREHOUSE_T1_PACKED = 10202;
2301
+ declare const ITEM_HULL_PLATES_T2 = 20001;
2302
+ declare const ITEM_CARGO_LINING_T2 = 20002;
2303
+ declare const ITEM_CONTAINER_T2_PACKED = 20200;
2304
+ interface RecipeInput {
2305
+ category?: ResourceCategory;
2306
+ itemId?: number;
2307
+ quantity: number;
1962
2308
  }
1963
- interface ShiploadConstructorOptions extends ShiploadOptions {
1964
- platformContract?: Contract$2;
1965
- serverContract?: Contract$2;
2309
+ interface ComponentStat {
2310
+ key: string;
2311
+ source: ResourceCategory;
1966
2312
  }
1967
- declare class Shipload {
1968
- private readonly _context;
1969
- constructor(chain: ChainDefinition, constructorOptions?: ShiploadConstructorOptions);
1970
- static load(chain: ChainDefinition, shiploadOptions?: ShiploadOptions): Promise<Shipload>;
1971
- get client(): APIClient;
1972
- get server(): Contract$2;
1973
- get platform(): Contract$2;
1974
- get entities(): EntitiesManager;
1975
- get players(): PlayersManager;
1976
- get locations(): LocationsManager;
1977
- get trades(): TradesManager;
1978
- get epochs(): EpochsManager;
1979
- get actions(): ActionsManager;
1980
- getGame(reload?: boolean): Promise<Types$1.game_row>;
1981
- getState(reload?: boolean): Promise<GameState>;
2313
+ interface ComponentDefinition {
2314
+ id: number;
2315
+ name: string;
2316
+ description: string;
2317
+ color: string;
2318
+ mass: number;
2319
+ stats: ComponentStat[];
2320
+ recipe: RecipeInput[];
2321
+ usedIn: {
2322
+ type: 'entity' | 'module';
2323
+ name: string;
2324
+ }[];
1982
2325
  }
2326
+ interface ModuleSlot {
2327
+ type: number;
2328
+ label?: string;
2329
+ }
2330
+ interface EntityRecipe {
2331
+ id: string;
2332
+ name: string;
2333
+ description: string;
2334
+ color: string;
2335
+ packedItemId: number;
2336
+ recipe: RecipeInput[];
2337
+ stats: {
2338
+ key: string;
2339
+ sourceComponentId: number;
2340
+ sourceStatKey: string;
2341
+ }[];
2342
+ moduleSlots?: ModuleSlot[];
2343
+ }
2344
+ interface CraftableItem {
2345
+ type: 'component' | 'entity' | 'module';
2346
+ id: number | string;
2347
+ name: string;
2348
+ description: string;
2349
+ color: string;
2350
+ }
2351
+ declare const components: ComponentDefinition[];
2352
+ declare const entityRecipes: EntityRecipe[];
2353
+ interface ModuleRecipe {
2354
+ id: string;
2355
+ name: string;
2356
+ description: string;
2357
+ color: string;
2358
+ itemId: number;
2359
+ moduleType: number;
2360
+ recipe: RecipeInput[];
2361
+ stats: {
2362
+ key: string;
2363
+ sourceComponentId: number;
2364
+ sourceStatKey: string;
2365
+ }[];
2366
+ }
2367
+ declare const moduleRecipes: ModuleRecipe[];
2368
+ declare function getModuleRecipe(id: string): ModuleRecipe | undefined;
2369
+ declare function getModuleRecipeByItemId(itemId: number): ModuleRecipe | undefined;
2370
+ declare function getComponentById(id: number): ComponentDefinition | undefined;
2371
+ declare function getEntityRecipe(id: string): EntityRecipe | undefined;
2372
+ declare function getEntityRecipeByItemId(itemId: number): EntityRecipe | undefined;
2373
+ declare function getEntitySlotLayout(packedItemId: number): ModuleSlot[];
2374
+ declare function getAllCraftableItems(): CraftableItem[];
2375
+ declare function getComponentsForCategory(category: ResourceCategory): ComponentDefinition[];
2376
+ declare function getComponentsForStat(statKey: string): ComponentDefinition[];
1983
2377
 
1984
- declare const goodIds: number[];
1985
- declare function getGood(goodId: UInt16Type): Good;
1986
- declare function getGoods(): Good[];
1987
-
1988
- declare enum Rarities {
1989
- legendary = "LEGENDARY",
1990
- epic = "EPIC",
1991
- rare = "RARE",
1992
- uncommon = "UNCOMMON",
1993
- common = "COMMON",
1994
- trash = "TRASH"
1995
- }
1996
- interface Rarity {
1997
- rarity: Rarities;
1998
- minMultiplier: number;
1999
- maxMultiplier: number;
2000
- }
2001
- declare function getRarity(gameSeed: Checksum256Type, epochSeed: Checksum256Type, location: CoordinatesType, goodId: UInt16Type): Rarity;
2002
- declare function marketPrice(location: ActionParams.Type.coordinates, goodId: UInt16Type, gameSeed: Checksum256Type, state: Types.state_row): GoodPrice;
2003
- declare function marketPrices(location: ActionParams.Type.coordinates, gameSeed: Checksum256Type, state: Types.state_row): GoodPrice[];
2004
-
2005
- declare function getSystemName(gameSeed: Checksum256Type, location: CoordinatesType): string;
2006
- declare function hasSystem(gameSeed: Checksum256Type, coordinates: CoordinatesType): boolean;
2378
+ declare function computeShipHullCapabilities(stats: Record<string, number>): {
2379
+ hullmass: number;
2380
+ capacity: number;
2381
+ };
2382
+ declare function computeEngineCapabilities(stats: Record<string, number>): {
2383
+ thrust: number;
2384
+ drain: number;
2385
+ };
2386
+ declare function computeGeneratorCapabilities(stats: Record<string, number>): {
2387
+ capacity: number;
2388
+ recharge: number;
2389
+ };
2390
+ declare function computeExtractorCapabilities(stats: Record<string, number>): {
2391
+ rate: number;
2392
+ drain: number;
2393
+ depth: number;
2394
+ drill: number;
2395
+ };
2396
+ declare function computeLoaderCapabilities(stats: Record<string, number>): {
2397
+ mass: number;
2398
+ thrust: number;
2399
+ quantity: number;
2400
+ };
2401
+ declare function computeManufacturingCapabilities(stats: Record<string, number>): {
2402
+ speed: number;
2403
+ drain: number;
2404
+ };
2405
+ declare function computeHaulerCapabilities(stats: Record<string, number>): {
2406
+ capacity: number;
2407
+ efficiency: number;
2408
+ drain: number;
2409
+ };
2410
+ declare function computeStorageCapabilities(stats: Record<string, number>, baseCapacity: number): {
2411
+ capacityBonus: number;
2412
+ };
2413
+ declare function computeWarehouseHullCapabilities(stats: Record<string, number>): {
2414
+ hullmass: number;
2415
+ capacity: number;
2416
+ };
2417
+ interface ShipCapabilities {
2418
+ engines?: {
2419
+ thrust: number;
2420
+ drain: number;
2421
+ };
2422
+ generator?: {
2423
+ capacity: number;
2424
+ recharge: number;
2425
+ };
2426
+ extractor?: {
2427
+ rate: number;
2428
+ drain: number;
2429
+ depth: number;
2430
+ drill: number;
2431
+ };
2432
+ hauler?: {
2433
+ capacity: number;
2434
+ efficiency: number;
2435
+ drain: number;
2436
+ };
2437
+ loaders?: {
2438
+ mass: number;
2439
+ thrust: number;
2440
+ quantity: number;
2441
+ };
2442
+ crafter?: {
2443
+ speed: number;
2444
+ drain: number;
2445
+ };
2446
+ }
2447
+ declare function computeShipCapabilities(modules: {
2448
+ itemId: number;
2449
+ seed: bigint;
2450
+ }[]): ShipCapabilities;
2007
2451
 
2008
- declare function hash(seed: Checksum256Type, string: string): Checksum512;
2009
- declare function hash512(seed: Checksum256Type, string: string): Checksum512;
2452
+ interface ResolvedItemStat {
2453
+ key: string;
2454
+ label: string;
2455
+ abbreviation: string;
2456
+ value: number;
2457
+ color: string;
2458
+ category: ResourceCategory;
2459
+ inverted?: boolean;
2460
+ }
2461
+ interface ResolvedAttributeGroup {
2462
+ capability: string;
2463
+ attributes: {
2464
+ label: string;
2465
+ value: number;
2466
+ }[];
2467
+ }
2468
+ type ResolvedItemType = 'resource' | 'component' | 'module' | 'entity';
2469
+ interface ResolvedModuleSlot {
2470
+ name?: string;
2471
+ installed: boolean;
2472
+ attributes?: {
2473
+ label: string;
2474
+ value: number;
2475
+ }[];
2476
+ }
2477
+ interface ResolvedItem {
2478
+ itemId: number;
2479
+ name: string;
2480
+ icon: string;
2481
+ category?: ResourceCategory;
2482
+ tier: ResourceTier;
2483
+ mass: number;
2484
+ itemType: ResolvedItemType;
2485
+ stats?: ResolvedItemStat[];
2486
+ attributes?: ResolvedAttributeGroup[];
2487
+ moduleSlots?: ResolvedModuleSlot[];
2488
+ }
2489
+ declare function resolveItem(itemId: UInt16Type, seed?: UInt64Type, modules?: Types.module_entry[]): ResolvedItem;
2010
2490
 
2011
- /**
2012
- * Trade calculation result
2013
- */
2014
- interface TradeCalculation {
2015
- maxQuantity: number;
2016
- totalCost: number;
2017
- totalMass: UInt64;
2018
- affordableQuantity: number;
2019
- spaceForQuantity: number;
2491
+ interface NFTInstalledModule {
2492
+ item_id: number;
2493
+ seed: string;
2020
2494
  }
2021
- /**
2022
- * Calculate updated weighted average cargo cost after purchase.
2023
- * Matches contract logic: (paid * owned + cost) / (owned + quantity)
2024
- *
2025
- * @param currentPaid - Current average cost per unit (from cargo.paid)
2026
- * @param currentOwned - Current owned quantity
2027
- * @param purchaseCost - Total cost of new purchase (price * quantity)
2028
- * @param purchaseQuantity - Quantity being purchased
2029
- * @returns New weighted average cost per unit
2030
- *
2031
- * @example
2032
- * // Owned 10 units at 100 each, buying 5 more at 120 each
2033
- * const newPaid = calculateUpdatedCargoCost(
2034
- * UInt64.from(100),
2035
- * UInt32.from(10),
2036
- * UInt64.from(600),
2037
- * UInt32.from(5)
2038
- * )
2039
- * // Result: (100*10 + 600) / (10+5) = 106.67 per unit
2040
- */
2041
- declare function calculateUpdatedCargoCost(currentPaid: UInt64, currentOwned: UInt32, purchaseCost: UInt64, purchaseQuantity: UInt32): UInt64;
2042
- /**
2043
- * Calculate the maximum quantity of a good a ship can buy
2044
- * considering both space and player balance
2045
- */
2046
- declare function calculateMaxTradeQuantity(ship: Ship, player: Player, goodPrice: GoodPrice): TradeCalculation;
2047
- /**
2048
- * Trade profit calculation result
2049
- */
2050
- interface TradeProfitResult {
2051
- revenue: UInt64;
2052
- cost: UInt64;
2053
- profit: Int64;
2054
- margin: number;
2495
+ interface NFTModuleSlot {
2496
+ type: number;
2497
+ installed?: NFTInstalledModule;
2055
2498
  }
2056
- /**
2057
- * Calculate profit for a trade route
2058
- */
2059
- declare function calculateTradeProfit(quantity: UInt32Type, buyPrice: UInt32Type, sellPrice: UInt32Type): TradeProfitResult;
2060
- /**
2061
- * Calculate profit per unit of mass
2062
- */
2063
- declare function calculateProfitPerMass(quantity: number, buyPrice: number, sellPrice: number, massPerUnit: number): number;
2064
- /**
2065
- * Calculate profit per second for a trade route
2066
- */
2067
- declare function calculateProfitPerSecond(profit: Int64Type, travelTimeSeconds: UInt32Type): number;
2068
- /**
2069
- * Find the best good to trade between two locations
2070
- */
2071
- declare function findBestGoodToTrade(ship: Ship, player: Player, originPrices: GoodPrice[], destPrices: GoodPrice[], travelTimeSeconds: UInt32Type): {
2072
- good: GoodPrice;
2499
+ interface NFTCargoItem {
2500
+ item_id: number;
2073
2501
  quantity: number;
2074
- profit: number;
2075
- profitPerSecond: number;
2076
- margin: number;
2077
- } | null;
2078
- /**
2079
- * Calculate break-even price for selling cargo
2080
- */
2081
- declare function calculateBreakEvenPrice(costPaid: number, quantity: number): number;
2082
- /**
2083
- * Check if a trade is profitable
2084
- */
2085
- declare function isProfitable(buyPrice: UInt32Type, sellPrice: UInt32Type): boolean;
2086
- /**
2087
- * Calculate return on investment percentage
2088
- */
2089
- declare function calculateROI(cost: number, profit: number): number;
2090
-
2091
- interface CargoData {
2092
- cargo: EntityInventory[];
2502
+ seed: string;
2503
+ modules?: NFTModuleSlot[];
2093
2504
  }
2094
- declare function totalCargoMass(cargo: EntityInventory[]): UInt64;
2095
- declare function cargoValue(cargo: EntityInventory[]): UInt64;
2096
- declare function getCargoForGood(cargo: EntityInventory[], goodId: UInt64Type): EntityInventory | undefined;
2097
- declare function hasSpace(currentMass: UInt64, maxCapacity: UInt64, goodMass: UInt64, quantity: number): boolean;
2098
- declare function availableCapacity(currentMass: UInt64, maxCapacity: UInt64): UInt64;
2099
- declare function isFull(currentMass: UInt64, maxCapacity: UInt64): boolean;
2505
+ interface NFTCommonBase {
2506
+ quantity: number;
2507
+ seed: string;
2508
+ origin_x: string;
2509
+ origin_y: string;
2510
+ }
2511
+ declare function readCommonBase(data: Record<string, any>): NFTCommonBase;
2512
+ declare function deserializeScalar(data: Record<string, any>, itemId: number): NFTCargoItem;
2513
+ declare const deserializeResource: typeof deserializeScalar;
2514
+ declare const deserializeComponent: typeof deserializeScalar;
2515
+ declare const deserializeModule: typeof deserializeScalar;
2516
+ declare function deserializeEntity(data: Record<string, any>, itemId: number): NFTCargoItem;
2517
+ declare function deserializeAsset(data: Record<string, any>, itemId: number): NFTCargoItem;
2100
2518
 
2101
- type cargoUtils_CargoData = CargoData;
2102
- declare const cargoUtils_totalCargoMass: typeof totalCargoMass;
2103
- declare const cargoUtils_cargoValue: typeof cargoValue;
2104
- declare const cargoUtils_getCargoForGood: typeof getCargoForGood;
2105
- declare const cargoUtils_hasSpace: typeof hasSpace;
2106
- declare const cargoUtils_availableCapacity: typeof availableCapacity;
2107
- declare const cargoUtils_isFull: typeof isFull;
2108
- declare namespace cargoUtils {
2519
+ declare function computeBaseHullmass(seed: bigint): number;
2520
+ declare function computeBaseCapacityShip(seed: bigint): number;
2521
+ declare function computeBaseCapacityWarehouse(seed: bigint): number;
2522
+ declare const computeEngineThrust: (vol: number) => number;
2523
+ declare const computeEngineDrain: (thm: number) => number;
2524
+ declare const computeGeneratorCap: (res: number) => number;
2525
+ declare const computeGeneratorRech: (clr: number) => number;
2526
+ declare const computeExtractorRate: (str: number) => number;
2527
+ declare const computeExtractorDrain: (con: number) => number;
2528
+ declare const computeExtractorDepth: (tol: number) => number;
2529
+ declare const computeExtractorDrill: (ref: number) => number;
2530
+ declare const computeLoaderMass: (duc: number) => number;
2531
+ declare const computeLoaderThrust: (pla: number) => number;
2532
+ declare const computeCrafterSpeed: (rea: number) => number;
2533
+ declare const computeCrafterDrain: (clr: number) => number;
2534
+ declare function entityDisplayName(itemId: number): string;
2535
+ declare function moduleDisplayName(itemId: number): string;
2536
+ declare function formatModuleLine(slot: number, itemId: number, seed: bigint): string;
2537
+ declare function buildEntityDescription(itemId: number, hullSeed: bigint, moduleItems: number[], moduleSeeds: bigint[]): string;
2538
+
2539
+ type index_NFTInstalledModule = NFTInstalledModule;
2540
+ type index_NFTModuleSlot = NFTModuleSlot;
2541
+ type index_NFTCargoItem = NFTCargoItem;
2542
+ type index_NFTCommonBase = NFTCommonBase;
2543
+ declare const index_readCommonBase: typeof readCommonBase;
2544
+ declare const index_deserializeScalar: typeof deserializeScalar;
2545
+ declare const index_deserializeResource: typeof deserializeResource;
2546
+ declare const index_deserializeComponent: typeof deserializeComponent;
2547
+ declare const index_deserializeModule: typeof deserializeModule;
2548
+ declare const index_deserializeEntity: typeof deserializeEntity;
2549
+ declare const index_deserializeAsset: typeof deserializeAsset;
2550
+ declare const index_computeBaseHullmass: typeof computeBaseHullmass;
2551
+ declare const index_computeBaseCapacityShip: typeof computeBaseCapacityShip;
2552
+ declare const index_computeBaseCapacityWarehouse: typeof computeBaseCapacityWarehouse;
2553
+ declare const index_computeEngineThrust: typeof computeEngineThrust;
2554
+ declare const index_computeEngineDrain: typeof computeEngineDrain;
2555
+ declare const index_computeGeneratorCap: typeof computeGeneratorCap;
2556
+ declare const index_computeGeneratorRech: typeof computeGeneratorRech;
2557
+ declare const index_computeExtractorRate: typeof computeExtractorRate;
2558
+ declare const index_computeExtractorDrain: typeof computeExtractorDrain;
2559
+ declare const index_computeExtractorDepth: typeof computeExtractorDepth;
2560
+ declare const index_computeExtractorDrill: typeof computeExtractorDrill;
2561
+ declare const index_computeLoaderMass: typeof computeLoaderMass;
2562
+ declare const index_computeLoaderThrust: typeof computeLoaderThrust;
2563
+ declare const index_computeCrafterSpeed: typeof computeCrafterSpeed;
2564
+ declare const index_computeCrafterDrain: typeof computeCrafterDrain;
2565
+ declare const index_entityDisplayName: typeof entityDisplayName;
2566
+ declare const index_moduleDisplayName: typeof moduleDisplayName;
2567
+ declare const index_formatModuleLine: typeof formatModuleLine;
2568
+ declare const index_buildEntityDescription: typeof buildEntityDescription;
2569
+ declare namespace index {
2109
2570
  export {
2110
- cargoUtils_CargoData as CargoData,
2111
- cargoUtils_totalCargoMass as totalCargoMass,
2112
- cargoUtils_cargoValue as cargoValue,
2113
- cargoUtils_getCargoForGood as getCargoForGood,
2114
- cargoUtils_hasSpace as hasSpace,
2115
- cargoUtils_availableCapacity as availableCapacity,
2116
- cargoUtils_isFull as isFull,
2571
+ index_NFTInstalledModule as NFTInstalledModule,
2572
+ index_NFTModuleSlot as NFTModuleSlot,
2573
+ index_NFTCargoItem as NFTCargoItem,
2574
+ index_NFTCommonBase as NFTCommonBase,
2575
+ index_readCommonBase as readCommonBase,
2576
+ index_deserializeScalar as deserializeScalar,
2577
+ index_deserializeResource as deserializeResource,
2578
+ index_deserializeComponent as deserializeComponent,
2579
+ index_deserializeModule as deserializeModule,
2580
+ index_deserializeEntity as deserializeEntity,
2581
+ index_deserializeAsset as deserializeAsset,
2582
+ index_computeBaseHullmass as computeBaseHullmass,
2583
+ index_computeBaseCapacityShip as computeBaseCapacityShip,
2584
+ index_computeBaseCapacityWarehouse as computeBaseCapacityWarehouse,
2585
+ index_computeEngineThrust as computeEngineThrust,
2586
+ index_computeEngineDrain as computeEngineDrain,
2587
+ index_computeGeneratorCap as computeGeneratorCap,
2588
+ index_computeGeneratorRech as computeGeneratorRech,
2589
+ index_computeExtractorRate as computeExtractorRate,
2590
+ index_computeExtractorDrain as computeExtractorDrain,
2591
+ index_computeExtractorDepth as computeExtractorDepth,
2592
+ index_computeExtractorDrill as computeExtractorDrill,
2593
+ index_computeLoaderMass as computeLoaderMass,
2594
+ index_computeLoaderThrust as computeLoaderThrust,
2595
+ index_computeCrafterSpeed as computeCrafterSpeed,
2596
+ index_computeCrafterDrain as computeCrafterDrain,
2597
+ index_entityDisplayName as entityDisplayName,
2598
+ index_moduleDisplayName as moduleDisplayName,
2599
+ index_formatModuleLine as formatModuleLine,
2600
+ index_buildEntityDescription as buildEntityDescription,
2117
2601
  };
2118
2602
  }
2119
2603
 
@@ -2123,5 +2607,11 @@ type loader_stats = Types.loader_stats;
2123
2607
  type task = Types.task;
2124
2608
  type cargo_item = Types.cargo_item;
2125
2609
  type warehouse_row = Types.warehouse_row;
2610
+ type container_row = Types.container_row;
2611
+ type extractor_stats = Types.extractor_stats;
2612
+ type location_static = Types.location_static;
2613
+ type location_epoch = Types.location_epoch;
2614
+ type location_derived = Types.location_derived;
2615
+ type location_row = Types.location_row;
2126
2616
 
2127
- export { ActionsManager, BetterSaleLocation, COMMIT_ALREADY_SET, COMMIT_CANNOT_MATCH, COMMIT_NOT_SET, COMPANY_NOT_FOUND, CargoData, CargoMassInfo, CargoSaleItem, CollectActionType, CollectAnalysis, CollectAnalysisCallbacks, CollectAnalysisOptions, CollectOption, Coordinates, CoordinatesType, Deal, DiscountedGoodInfo, Distance, EPOCH_NON_ZERO, EPOCH_NOT_READY, ERROR_SYSTEM_ALREADY_INITIALIZED, ERROR_SYSTEM_DISABLED, ERROR_SYSTEM_NOT_INITIALIZED, EntitiesManager, EntityInventory, EntityType, EntityTypeName, EpochInfo, EpochsManager, EstimateTravelTimeOptions, EstimatedTravelTime, FindDealsOptions, GAME_NOT_FOUND, GAME_SEED_NOT_SET, GOOD_DOES_NOT_EXIST, GOOD_NOT_AVAILABLE_AT_LOCATION, GameState, Good, GoodPrice, INITIAL_SHIP_MASS, INSUFFICIENT_BALANCE, INSUFFICIENT_GOOD_QUANTITY, INSUFFICIENT_GOOD_SUPPLY, INVALID_AMOUNT, LoadTimeBreakdown, Location, LocationsManager, MAX_ORBITAL_ALTITUDE, MIN_ORBITAL_ALTITUDE, NO_SCHEDULE, PLAYER_ALREADY_JOINED, PLAYER_NOT_FOUND, PRECISION, platform as PlatformContract, Player, PlayerStateInput, PlayersManager, PotentialDeal, Projectable, ProjectedEntity, REQUIRES_MORE_THAN_ONE, REQUIRES_POSITIVE_VALUE, Rarities, Rarity, RepositionLocation, SHIP_ALREADY_THERE, SHIP_ALREADY_TRAVELING, SHIP_CANNOT_BUY_TRAVELING, SHIP_CANNOT_CANCEL_TASK, SHIP_CANNOT_UPDATE_TRAVELING, SHIP_CARGO_NOT_LOADED, SHIP_CARGO_NOT_OWNED, SHIP_INVALID_CARGO, SHIP_INVALID_DESTINATION, SHIP_INVALID_TRAVEL_DURATION, SHIP_NOT_ARRIVED, SHIP_NOT_ENOUGH_ENERGY, SHIP_NOT_ENOUGH_ENERGY_CAPACITY, SHIP_NOT_FOUND, SHIP_NOT_IDLE, SHIP_NOT_OWNED, SHIP_NO_COMPLETED_TASKS, SHIP_NO_TASKS_TO_CANCEL, ScheduleData, Scheduleable, server as ServerContract, Ship, ShipLike, ShipStateInput, Shipload, TaskCancelable, TaskType, TradeCalculation, TradeProfitResult, TradesManager, TransferEntity, WAREHOUSE_ALREADY_AT_LOCATION, WAREHOUSE_CAPACITY_EXCEEDED, WAREHOUSE_NOT_FOUND, Warehouse, analyzeCargoSale, analyzeCollectOptions, calc_acceleration, calc_energyusage, calc_flighttime, calc_loader_acceleration, calc_loader_flighttime, calc_orbital_altitude, calc_rechargetime, calc_ship_acceleration, calc_ship_flighttime, calc_ship_mass, calc_ship_rechargetime, calc_transfer_duration, calculateBreakEvenPrice, calculateFlightTime, calculateLoadTimeBreakdown, calculateMaxTradeQuantity, calculateProfitPerMass, calculateProfitPerSecond, calculateROI, calculateRefuelingTime, calculateTradeProfit, calculateTransferTime, calculateUpdatedCargoCost, cargoUtils, cargo_item, createExploreOption, createProjectedEntity, createSellAndRepositionOption, createSellAndStayOption, createSellAndTradeOption, createTravelToSellOption, Shipload as default, distanceBetweenCoordinates, distanceBetweenPoints, energy_stats, estimateDealTravelTime, estimateTravelTime, findBestDeal, findBestGoodToTrade, findDealsForShip, findNearbyPlanets, getCurrentEpoch, getEpochInfo, getGood, getGoods, getRarity, getSystemName, goodIds, hasEnergyForDistance, hasSystem, hash, hash512, isProfitable, lerp, loader_stats, marketPrice, marketPrices, movement_stats, projectEntity, projectEntityAt, rotation, schedule, task, toLocation, warehouse_row };
2617
+ export { ActionsManager, AnyEntity, BASE_ORBITAL_MASS, COMMIT_ALREADY_SET, COMMIT_CANNOT_MATCH, COMMIT_NOT_SET, COMPANY_NOT_FOUND, CONTAINER_Z, CRAFT_ENERGY_DIVISOR, CapabilityAttribute, CargoData, CargoMassInfo, CargoSeed, CategoryInfo, CategoryStacks, ComponentDefinition, ComponentStat, Container, ContainerEntity, ContainerStateInput, Coordinates, CoordinatesType, CraftableItem, CraftedItemCategory, CrafterCapability, DEPTH_THRESHOLD_T1, DEPTH_THRESHOLD_T2, DEPTH_THRESHOLD_T3, DEPTH_THRESHOLD_T4, DEPTH_THRESHOLD_T5, Distance, EPOCH_NON_ZERO, EPOCH_NOT_READY, ERROR_SYSTEM_ALREADY_INITIALIZED, ERROR_SYSTEM_DISABLED, ERROR_SYSTEM_NOT_INITIALIZED, EnergyCapability, EntitiesManager, Entity, EntityCapabilities, EntityInventory, EntityRecipe, EntityRefInput, EntityState, EntityType, EntityTypeName, EpochInfo, EpochsManager, EstimateTravelTimeOptions, EstimatedTravelTime, ExtractorCapability, GAME_NOT_FOUND, GAME_SEED_NOT_SET, GameState, HasCapacity, HasCargo, HasCargomass, HasScheduleAndLocation, INITIAL_CONTAINER_CAPACITY, INITIAL_CONTAINER_HULLMASS, INITIAL_WAREHOUSE_CAPACITY, INSUFFICIENT_BALANCE, INSUFFICIENT_ITEM_QUANTITY, INSUFFICIENT_ITEM_SUPPLY, INVALID_AMOUNT, ITEM_CARGO_ARM, ITEM_CARGO_LINING, ITEM_CARGO_LINING_T2, ITEM_CONTAINER_T1_PACKED, ITEM_CONTAINER_T2_PACKED, ITEM_DOES_NOT_EXIST, ITEM_DRILL_SHAFT, ITEM_ENGINE_T1, ITEM_EXTRACTION_PROBE, ITEM_EXTRACTOR_T1, ITEM_FOCUSING_ARRAY, ITEM_GENERATOR_T1, ITEM_HAULER_T1, ITEM_HULL_PLATES, ITEM_HULL_PLATES_T2, ITEM_LOADER_T1, ITEM_MANUFACTURING_T1, ITEM_NOT_AVAILABLE_AT_LOCATION, ITEM_POWER_CELL, ITEM_REACTION_CHAMBER, ITEM_SHIP_T1_PACKED, ITEM_STORAGE_T1, ITEM_THRUSTER_CORE, ITEM_TOOL_BIT, ITEM_TYPE_COMPONENT, ITEM_TYPE_ENTITY, ITEM_TYPE_MODULE, ITEM_TYPE_RESOURCE, ITEM_WAREHOUSE_T1_PACKED, InventoryAccessor, Item, LOCATION_MAX_DEPTH, LOCATION_MIN_DEPTH, LoadTimeBreakdown, LoaderCapability, Location, LocationType, LocationsManager, MAX_ORBITAL_ALTITUDE, MIN_ORBITAL_ALTITUDE, MODULE_ANY, MODULE_CRAFTER, MODULE_ENGINE, MODULE_EXTRACTOR, MODULE_GENERATOR, MODULE_HAULER, MODULE_LAUNCHER, MODULE_LOADER, MODULE_STORAGE, MODULE_WARP, MassCapability, ModuleEntry, ModuleRecipe, ModuleSlot, 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, PRECISION, PlanetSubtypeInfo, platform as PlatformContract, Player, PlayerStateInput, PlayersManager, Projectable, ProjectedEntity, REQUIRES_MORE_THAN_ONE, REQUIRES_POSITIVE_VALUE, RecipeInput, 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_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, ShipCapabilities, ShipEntity, ShipLike, ShipStateInput, Shipload, StackInput, StatDefinition, StatMapping, StorageCapability, StratumInfo, TRAVEL_MAX_DURATION, TaskCancelable, TaskType, TransferEntity, WAREHOUSE_ALREADY_AT_LOCATION, WAREHOUSE_CAPACITY_EXCEEDED, WAREHOUSE_NOT_FOUND, WAREHOUSE_Z, Warehouse, WarehouseEntity, WarehouseStateInput, availableCapacity$1 as availableCapacity, availableCapacityFromMass, blendCargoStacks, blendComponentStacks, blendCrossGroup, blendStacks, buildEntityDescription, calcCargoItemMass, calcCargoMass, calcEnergyUsage, calcLoadDuration, calc_acceleration, calc_craft_duration, calc_craft_energy, 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, calculateFlightTime, calculateLoadTimeBreakdown, calculateRefuelingTime, calculateTransferTime, canMove, capabilityAttributes, capabilityNames, capsHasCrafter, capsHasExtractor, capsHasLoaders, capsHasMass, capsHasMovement, capsHasStorage, cargoUtils, cargo_item, categoryColors, categoryIcons, categoryItemMass, componentIcon, components, computeBaseCapacityShip, computeBaseCapacityWarehouse, computeBaseHullmass, computeComponentStats, computeContainerCapabilities, computeContainerT2Capabilities, computeCrafterDrain, computeCrafterSpeed, computeEngineCapabilities, computeEngineDrain, computeEngineThrust, computeEntityStats, computeExtractorCapabilities, computeExtractorDepth, computeExtractorDrain, computeExtractorDrill, computeExtractorRate, computeGeneratorCap, computeGeneratorCapabilities, computeGeneratorRech, computeHaulPenalty, computeHaulerCapabilities, computeHaulerDrain, computeInputMass, computeLoaderCapabilities, computeLoaderMass, computeLoaderThrust, computeManufacturingCapabilities, computeShipCapabilities, computeShipHullCapabilities, computeStorageCapabilities, computeWarehouseHullCapabilities, container_row, coordsToLocationId, createInventoryAccessor, createProjectedEntity, createScheduleAccessor, decodeCraftedItemStats, decodeStat, decodeStats, Shipload as default, depthScaleFactor, deriveLocation, deriveLocationEpoch, deriveLocationSize, deriveLocationStatic, deriveResourceStats, deriveStratum, deserializeAsset, deserializeComponent, deserializeEntity, deserializeModule, deserializeResource, distanceBetweenCoordinates, distanceBetweenPoints, encodeStats, energyPercent, energy_stats, entityDisplayName, entityRecipes, estimateDealTravelTime, estimateTravelTime, extractor_stats, findNearbyPlanets, formatModuleLine, getAllCraftableItems, getCapabilityAttributes, getCategoryInfo, getComponentById, getComponentsForCategory, getComponentsForStat, getCurrentEpoch, getDepthThreshold, getDestinationLocation, getEligibleResources, getEntityRecipe, getEntityRecipeByItemId, getEntitySlotLayout, getEpochInfo, getFlightOrigin, getItem, getItems, getLocationCandidates, getLocationType, getModuleCapabilityType, getModuleRecipe, getModuleRecipeByItemId, getPlanetSubtype, getPlanetSubtypes, getPositionAt, getResourceTier, getResourceWeight, getStatDefinitions, getStatMappings, getStatMappingsForCapability, getStatMappingsForStat, getStatName, getSystemName, hasEnergy, hasEnergyForDistance, hasExtractor, hasLoaders, hasMass, hasSchedule, hasSpace$1 as hasSpace, hasSpaceForMass, hasStorage, hasSystem, hash, hash512, isCraftedItem, isExtractableLocation, isFull$1 as isFull, isFullFromMass, isInvertedAttribute, isModuleItem, isRelatedItem, itemCategory, itemIcons, itemIds, itemOffset, itemTier, itemTypeCode, lerp, loader_stats, location_derived, location_epoch, location_row, location_static, makeContainer, makeShip, makeWarehouse, maxTravelDistance, moduleAccepts, moduleDisplayName, moduleIcon, moduleRecipes, movement_stats, needsRecharge, projectEntity, projectEntityAt, readCommonBase, resolveItem, resolveStats, rotation, schedule, statMappings, task, tierColors, toLocation, warehouse_row };