-
Notifications
You must be signed in to change notification settings - Fork 0
/
SLY_Bookie-0.01.user.js
1081 lines (955 loc) · 289 KB
/
SLY_Bookie-0.01.user.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// ==UserScript==
// @name SLY Bookie
// @namespace http://tampermonkey.net/
// @version 0.01
// @description try to take over the world!
// @author You
// @match https://play.staratlas.com/dac/
// @require https://unpkg.com/@solana/web3.js@latest/lib/index.iife.min.js
// @require https://raw.githubusercontent.com/ImGroovin/SAGE-Lab-Assistant/main/anchor-browserified.js
// @require https://raw.githubusercontent.com/ImGroovin/SAGE-Lab-Assistant/main/buffer-browserified.js
// @require https://raw.githubusercontent.com/ImGroovin/SAGE-Lab-Assistant/main/bs58-browserified.js
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant GM_setValue
// @grant GM_getValue
// @grant GM_listValues
// ==/UserScript==
(async function() {
'use strict';
const solanaConnection = new solanaWeb3.Connection('https://rpc.ironforge.network/mainnet?apiKey=01HZFJ18Q9E3QT62P67P52PC03', 'confirmed');
const anchorProvider = new BrowserAnchor.anchor.AnchorProvider(solanaConnection, null, null);
window.Buffer = BrowserBuffer.Buffer.Buffer;
const sageProgramId = new solanaWeb3.PublicKey('SAGE2HAwep459SNq61LHvjxPk4pLPEJLoMETef7f7EE');
const cargoProgramId = new solanaWeb3.PublicKey('Cargo2VNTPPTi9c1vq1Jw5d3BWUNr18MjRtSupAghKEk');
const craftingProgramId = new solanaWeb3.PublicKey('CRAFT2RPXPJWCEix4WpJST3E7NLf79GTqZUL75wngXo5');
const marketProgramId = new solanaWeb3.PublicKey('traderDnaR5w6Tcoi3NFm53i48FTDNbGjBSZwWXDRrg');
const systemProgramId = new solanaWeb3.PublicKey('11111111111111111111111111111111');
const rentProgramId = new solanaWeb3.PublicKey('SysvarRent111111111111111111111111111111111');
const tokenProgramId = new solanaWeb3.PublicKey('TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA');
const associatedTokenProgramId = new solanaWeb3.PublicKey('ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL');
const atlasProgramId = new solanaWeb3.PublicKey('ATLASXmbPQxBUYbxPsV97usA3fPQYEqzQBUHgiFCUsXx');
const feesProgramId = new solanaWeb3.PublicKey('feesQYAaH3wjGUUQYD959mmi5pY8HSz3F5C3SVc1fp3');
const atlasStakingProgramId = new solanaWeb3.PublicKey('ATLocKpzDbTokxgvnLew3d7drZkEzLzDpzwgrgWKDbmc');
const sageIDL = {version: "0.1.0",name: "sage",instructions: [{name: "activateGameState",accounts: [{name: "gameAndProfile",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key authorized for this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The [`Profile`] account"]}, {name: "gameId",isMut: !0,isSigner: !1,docs: ["The [`Game`] account"]}]}, {name: "gameState",isMut: !0,isSigner: !1,docs: ["The [`GameState`] account"]}],args: [{name: "input",type: {defined: "ManageGameInput"}}]}, {name: "addConnection",accounts: [{name: "gameAndProfile",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key authorized for this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The [`Profile`] account"]}, {name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}]}, {name: "funder",isMut: !0,isSigner: !0,docs: ["The funder for adding the connection"]}, {name: "sector1",isMut: !0,isSigner: !1,docs: ["The first connected sector"]}, {name: "sector2",isMut: !0,isSigner: !1,docs: ["The second connected sector"]}, {name: "systemProgram",isMut: !1,isSigner: !1,docs: ["The system program"]}],args: [{name: "subCoordinates1",type: {array: ["i64", 2]}}, {name: "flags1",type: "u8"}, {name: "subCoordinates2",type: {array: ["i64", 2]}}, {name: "flags2",type: "u8"}, {name: "keyIndex",type: "u16"}]}, {name: "addRental",accounts: [{name: "ownerProfile",isMut: !1,isSigner: !1,docs: ["The fleet owner's profile."]}, {name: "ownerKey",isMut: !1,isSigner: !0,docs: ["The key on the owner profile with renting permissions."]}, {name: "invalidator",isMut: !1,isSigner: !0,docs: ["The fleet rental invalidator - this is a signer to help make sure the fleet won't be locked."]}, {name: "subProfile",isMut: !1,isSigner: !1,docs: ["The profile to rent to."]}, {name: "fleet",isMut: !0,isSigner: !1,docs: ["The fleet to rent out."]}, {name: "gameAccounts",accounts: [{name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}, {name: "gameState",isMut: !1,isSigner: !1,docs: ["The [`GameState`] account"]}]}],args: [{name: "ownerKeyIndex",type: "u16"}]}, {name: "addShipEscrow",accounts: [{name: "funder",isMut: !0,isSigner: !0,docs: ["The funder - pays for account rent"]}, {name: "sagePlayerProfile",isMut: !0,isSigner: !1,docs: ["The [`SagePlayerProfile`] account"]}, {name: "originTokenAccount",isMut: !0,isSigner: !1,docs: ["The Origin Token Account"]}, {name: "ship",isMut: !1,isSigner: !1,docs: ["The [`Ship`] Account"]}, {name: "shipEscrowTokenAccount",isMut: !0,isSigner: !1,docs: ["The Escrow Token Account"]}, {name: "starbaseAndStarbasePlayer",accounts: [{name: "starbase",isMut: !1,isSigner: !1,docs: ["The [`Starbase`] account"]}, {name: "starbasePlayer",isMut: !0,isSigner: !1,docs: ["The [`StarbasePlayer`] Account"]}]}, {name: "gameAccountsAndProfile",accounts: [{name: "gameAndProfileAndFaction",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key authorized for this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The [`Profile`] account"]}, {name: "profileFaction",isMut: !1,isSigner: !1,docs: ["The faction that the profile belongs to."]}, {name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}]}, {name: "gameState",isMut: !1,isSigner: !1,docs: ["The [`GameState`] account"]}]}, {name: "tokenProgram",isMut: !1,isSigner: !1,docs: ["The Token Program"]}, {name: "systemProgram",isMut: !1,isSigner: !1,docs: ["The Solana System program"]}],args: [{name: "input",type: {defined: "AddShipEscrowInput"}}]}, {name: "addShipToFleet",accounts: [{name: "gameAccountsFleetAndOwner",accounts: [{name: "gameFleetAndOwner",accounts: [{name: "fleetAndOwner",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key on the profile."]}, {name: "owningProfile",isMut: !1,isSigner: !1,docs: ["The profile that owns the fleet."]}, {name: "owningProfileFaction",isMut: !1,isSigner: !1,docs: ["The faction that the profile belongs to."]}, {name: "fleet",isMut: !0,isSigner: !1,docs: ["The fleet."]}]}, {name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}]}, {name: "gameState",isMut: !1,isSigner: !1,docs: ["The [`GameState`] account"]}]}, {name: "funder",isMut: !0,isSigner: !0,docs: ["The funder for the new `Fleet`"]}, {name: "fleetShips",isMut: !0,isSigner: !1,docs: ["The [`FleetShips`] account"]}, {name: "ship",isMut: !1,isSigner: !1,docs: ["The [`Ship`] Account"]}, {name: "starbaseAndStarbasePlayer",accounts: [{name: "starbase",isMut: !1,isSigner: !1,docs: ["The [`Starbase`] account"]}, {name: "starbasePlayer",isMut: !0,isSigner: !1,docs: ["The [`StarbasePlayer`] Account"]}]}, {name: "systemProgram",isMut: !1,isSigner: !1,docs: ["The Solana System program"]}],args: [{name: "input",type: {defined: "AddShipToFleetInput"}}]}, {name: "burnCraftingConsumables",accounts: [{name: "starbaseAndStarbasePlayer",accounts: [{name: "starbase",isMut: !1,isSigner: !1,docs: ["The [`Starbase`] account"]}, {name: "starbasePlayer",isMut: !1,isSigner: !1,docs: ["The [`StarbasePlayer`] Account"]}]}, {name: "craftingInstance",isMut: !1,isSigner: !1,docs: ["The [`CraftingInstance`] account"]}, {name: "craftingProcess",isMut: !0,isSigner: !1,docs: ["The crafting process account"]}, {name: "craftingFacility",isMut: !1,isSigner: !1,docs: ["The crafting facility account"]}, {name: "craftingRecipe",isMut: !1,isSigner: !1,docs: ["The crafting recipe"]}, {name: "gameAccounts",accounts: [{name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}, {name: "gameState",isMut: !1,isSigner: !1,docs: ["The [`GameState`] account"]}]}, {name: "tokenFrom",isMut: !0,isSigner: !1,docs: ["The source account of the tokens - owner should be `crafting_process`"]}, {name: "tokenMint",isMut: !0,isSigner: !1,docs: ["The token mint"]}, {name: "craftingProgram",isMut: !1,isSigner: !1,docs: ["The Crafting Program"]}, {name: "tokenProgram",isMut: !1,isSigner: !1,docs: ["The [Token] program"]}],args: [{name: "input",type: {defined: "IngredientIndexInput"}}]}, {name: "cancelCraftingProcess",accounts: [{name: "fundsTo",isMut: !0,isSigner: !1,docs: ["The funds_to - receives rent refund"]}, {name: "starbaseAndStarbasePlayer",accounts: [{name: "starbase",isMut: !1,isSigner: !1,docs: ["The [`Starbase`] account"]}, {name: "starbasePlayer",isMut: !0,isSigner: !1,docs: ["The [`StarbasePlayer`] Account"]}]}, {name: "craftingInstance",isMut: !0,isSigner: !1,docs: ["The [`CraftingInstance`] account to cancel"]}, {name: "craftingProcess",isMut: !0,isSigner: !1,docs: ["The crafting process account"]}, {name: "craftingFacility",isMut: !0,isSigner: !1,docs: ["The `CraftingFacility` account"]}, {name: "gameAccountsAndProfile",accounts: [{name: "gameAndProfileAndFaction",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key authorized for this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The [`Profile`] account"]}, {name: "profileFaction",isMut: !1,isSigner: !1,docs: ["The faction that the profile belongs to."]}, {name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}]}, {name: "gameState",isMut: !1,isSigner: !1,docs: ["The [`GameState`] account"]}]}, {name: "craftingProgram",isMut: !1,isSigner: !1,docs: ["The Crafting Program"]}],args: [{name: "input",type: {defined: "KeyIndexInput"}}]}, {name: "changeRental",accounts: [{name: "subProfileInvalidator",isMut: !1,isSigner: !0,docs: ["The fleet rental invalidator"]}, {name: "newSubProfile",isMut: !1,isSigner: !1,docs: ["The new sub profile"]}, {name: "fleet",isMut: !0,isSigner: !1,docs: ["The fleet"]}, {name: "gameAccounts",accounts: [{name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}, {name: "gameState",isMut: !1,isSigner: !1,docs: ["The [`GameState`] account"]}]}],args: []}, {name: "claimCraftingNonConsumables",accounts: [{name: "starbaseAndStarbasePlayer",accounts: [{name: "starbase",isMut: !1,isSigner: !1,docs: ["The [`Starbase`] account"]}, {name: "starbasePlayer",isMut: !1,isSigner: !1,docs: ["The [`StarbasePlayer`] Account"]}]}, {name: "craftingInstance",isMut: !1,isSigner: !1,docs: ["The [`CraftingInstance`] account"]}, {name: "craftingProcess",isMut: !0,isSigner: !1,docs: ["The crafting process account"]}, {name: "craftingFacility",isMut: !1,isSigner: !1,docs: ["The crafting facility account"]}, {name: "craftingRecipe",isMut: !1,isSigner: !1,docs: ["The crafting recipe"]}, {name: "cargoPodTo",isMut: !0,isSigner: !1,docs: ["The destination cargo pod account"]}, {name: "cargoType",isMut: !1,isSigner: !1,docs: ["The Cargo Type Account"]}, {name: "cargoStatsDefinition",isMut: !1,isSigner: !1,docs: ["The cargo stats definition account"]}, {name: "gameAccounts",accounts: [{name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}, {name: "gameState",isMut: !1,isSigner: !1,docs: ["The [`GameState`] account"]}]}, {name: "tokenFrom",isMut: !0,isSigner: !1,docs: ["The source account of the tokens - owner should be `crafting_process`"]}, {name: "tokenTo",isMut: !0,isSigner: !1,docs: ["The destination account of the tokens - owner should be `cargo_pod_to`"]}, {name: "tokenMint",isMut: !0,isSigner: !1,docs: ["The token mint"]}, {name: "craftingProgram",isMut: !1,isSigner: !1,docs: ["The Crafting Program"]}, {name: "cargoProgram",isMut: !1,isSigner: !1,docs: ["The Cargo Program"]}, {name: "tokenProgram",isMut: !1,isSigner: !1,docs: ["The [Token] program"]}],args: [{name: "input",type: {defined: "IngredientIndexInput"}}]}, {name: "claimCraftingOutputs",accounts: [{name: "starbaseAndStarbasePlayer",accounts: [{name: "starbase",isMut: !1,isSigner: !1,docs: ["The [`Starbase`] account"]}, {name: "starbasePlayer",isMut: !1,isSigner: !1,docs: ["The [`StarbasePlayer`] Account"]}]}, {name: "craftingInstance",isMut: !1,isSigner: !1,docs: ["The [`CraftingInstance`] account"]}, {name: "craftingProcess",isMut: !0,isSigner: !1,docs: ["The [`CraftingProcess`] account"]}, {name: "craftingFacility",isMut: !1,isSigner: !1,docs: ["The crafting facility account"]}, {name: "craftingRecipe",isMut: !1,isSigner: !1,docs: ["The crafting [`Recipe`]"]}, {name: "craftableItem",isMut: !1,isSigner: !1,docs: ["The craftable item"]}, {name: "cargoPodTo",isMut: !0,isSigner: !1,docs: ["The destination cargo pod account"]}, {name: "cargoType",isMut: !1,isSigner: !1,docs: ["The Cargo Type Account"]}, {name: "cargoStatsDefinition",isMut: !1,isSigner: !1,docs: ["The cargo stats definition account"]}, {name: "gameAccounts",accounts: [{name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}, {name: "gameState",isMut: !1,isSigner: !1,docs: ["The [`GameState`] account"]}]}, {name: "tokenFrom",isMut: !0,isSigner: !1,docs: ["The source account of the tokens - owner should be `craftable_item`"]}, {name: "tokenTo",isMut: !0,isSigner: !1,docs: ["The destination account of the tokens - owner should be `cargo_pod_to`"]}, {name: "craftingProgram",isMut: !1,isSigner: !1,docs: ["The Crafting Program"]}, {name: "cargoProgram",isMut: !1,isSigner: !1,docs: ["The Cargo Program"]}, {name: "tokenProgram",isMut: !1,isSigner: !1,docs: ["The [Token] program"]}],args: [{name: "input",type: {defined: "IngredientIndexInput"}}]}, {name: "closeCraftingProcess",accounts: [{name: "fundsTo",isMut: !0,isSigner: !1,docs: ["The funds_to - receives rent refund"]}, {name: "starbaseAndStarbasePlayer",accounts: [{name: "starbase",isMut: !1,isSigner: !1,docs: ["The [`Starbase`] account"]}, {name: "starbasePlayer",isMut: !0,isSigner: !1,docs: ["The [`StarbasePlayer`] Account"]}]}, {name: "craftingInstance",isMut: !0,isSigner: !1,docs: ["The [`CraftingInstance`] account to close"]}, {name: "craftingProcess",isMut: !0,isSigner: !1,docs: ["The crafting process account"]}, {name: "craftingRecipe",isMut: !1,isSigner: !1,docs: ["The crafting recipe account"]}, {name: "craftingFacility",isMut: !0,isSigner: !1,docs: ["The `CraftingFacility` account"]}, {name: "gameAccountsAndProfile",accounts: [{name: "gameAndProfileAndFaction",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key authorized for this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The [`Profile`] account"]}, {name: "profileFaction",isMut: !1,isSigner: !1,docs: ["The faction that the profile belongs to."]}, {name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}]}, {name: "gameState",isMut: !1,isSigner: !1,docs: ["The [`GameState`] account"]}]}, {name: "craftingXpAccounts",accounts: [{name: "userPointsAccount",isMut: !0,isSigner: !1,docs: ["The User Points Account"]}, {name: "pointsCategory",isMut: !1,isSigner: !1,docs: ["The Points Category Account"]}, {name: "pointsModifierAccount",isMut: !1,isSigner: !1,docs: ["The Points Modifier Account"]}]}, {name: "councilRankXpAccounts",accounts: [{name: "userPointsAccount",isMut: !0,isSigner: !1,docs: ["The User Points Account"]}, {name: "pointsCategory",isMut: !1,isSigner: !1,docs: ["The Points Category Account"]}, {name: "pointsModifierAccount",isMut: !1,isSigner: !1,docs: ["The Points Modifier Account"]}]}, {name: "progressionConfig",isMut: !1,isSigner: !1,docs: ["The [`ProgressionConfig`] account"]}, {name: "pointsProgram",isMut: !1,isSigner: !1,docs: ["The points program"]}, {name: "craftingProgram",isMut: !1,isSigner: !1,docs: ["The Crafting Program"]}],args: [{name: "input",type: {defined: "KeyIndexInput"}}]}, {name: "closeDisbandedFleet",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key on the player profile."]}, {name: "playerProfile",isMut: !1,isSigner: !1,docs: ["The player profile."]}, {name: "fundsTo",isMut: !0,isSigner: !1,docs: ["The funds_to - receives rent refund"]}, {name: "disbandedFleet",isMut: !0,isSigner: !1,docs: ["The [`DisbandedFleet`] account"]}, {name: "fleetShips",isMut: !0,isSigner: !1,docs: ["The [`FleetShips`] account"]}],args: [{name: "input",type: {defined: "CloseDisbandedFleetInput"}}]}, {name: "closeFleetCargoPodTokenAccount",accounts: [{name: "gameAccountsFleetAndOwner",accounts: [{name: "gameFleetAndOwner",accounts: [{name: "fleetAndOwner",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key on the profile."]}, {name: "owningProfile",isMut: !1,isSigner: !1,docs: ["The profile that owns the fleet."]}, {name: "owningProfileFaction",isMut: !1,isSigner: !1,docs: ["The faction that the profile belongs to."]}, {name: "fleet",isMut: !0,isSigner: !1,docs: ["The fleet."]}]}, {name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}]}, {name: "gameState",isMut: !1,isSigner: !1,docs: ["The [`GameState`] account"]}]}, {name: "cargoPod",isMut: !0,isSigner: !1,docs: ["The cargo pod, owned by the fleet"]}, {name: "cargoType",isMut: !1,isSigner: !1,docs: ["The cargo type account"]}, {name: "cargoStatsDefinition",isMut: !1,isSigner: !1,docs: ["The cargo stats definition account"]}, {name: "token",isMut: !0,isSigner: !1,docs: ["The destination token account - owned by the `cargo_pod`"]}, {name: "tokenMint",isMut: !0,isSigner: !1,docs: ["The mint of the token accounts"]}, {name: "fundsTo",isMut: !0,isSigner: !1,docs: ["The funds_to - receives rent refund"]}, {name: "cargoProgram",isMut: !1,isSigner: !1,docs: ["The Cargo Program"]}, {name: "tokenProgram",isMut: !1,isSigner: !1,docs: ["Token Program"]}],args: [{name: "input",type: {defined: "KeyIndexInput"}}]}, {name: "closeStarbaseCargoTokenAccount",accounts: [{name: "fundsTo",isMut: !0,isSigner: !1,docs: ["The funds_to - receives rent refund"]}, {name: "starbaseAndStarbasePlayer",accounts: [{name: "starbase",isMut: !1,isSigner: !1,docs: ["The [`Starbase`] account"]}, {name: "starbasePlayer",isMut: !1,isSigner: !1,docs: ["The [`StarbasePlayer`] Account"]}]}, {name: "gameAccountsAndProfile",accounts: [{name: "gameAndProfileAndFaction",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key authorized for this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The [`Profile`] account"]}, {name: "profileFaction",isMut: !1,isSigner: !1,docs: ["The faction that the profile belongs to."]}, {name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}]}, {name: "gameState",isMut: !1,isSigner: !1,docs: ["The [`GameState`] account"]}]}, {name: "cargoPod",isMut: !0,isSigner: !1,docs: ["The new cargo pod"]}, {name: "cargoType",isMut: !1,isSigner: !1,docs: ["The cargo type account"]}, {name: "cargoStatsDefinition",isMut: !1,isSigner: !1,docs: ["The cargo stats definition account"]}, {name: "token",isMut: !0,isSigner: !1,docs: ["The source token account - owned by the `cargo_pod`"]}, {name: "tokenMint",isMut: !0,isSigner: !1,docs: ["The mint of the token accounts"]}, {name: "cargoProgram",isMut: !1,isSigner: !1,docs: ["The Cargo Program"]}, {name: "tokenProgram",isMut: !1,isSigner: !1,docs: ["Token Program"]}],args: [{name: "input",type: {defined: "KeyIndexInput"}}]}, {name: "closeUpgradeProcess",accounts: [{name: "fundsTo",isMut: !0,isSigner: !1,docs: ["The funds_to - receives rent refund"]}, {name: "starbaseAndStarbasePlayer",accounts: [{name: "starbase",isMut: !1,isSigner: !1,docs: ["The [`Starbase`] account"]}, {name: "starbasePlayer",isMut: !0,isSigner: !1,docs: ["The [`StarbasePlayer`] Account"]}]}, {name: "resourceCraftingInstance",isMut: !0,isSigner: !1,docs: ["The [`CraftingInstance`] account to close"]}, {name: "resourceCraftingProcess",isMut: !0,isSigner: !1,docs: ["The crafting process account"]}, {name: "resourceRecipe",isMut: !1,isSigner: !1,docs: ["The crafting recipe for the upgrade resource"]}, {name: "resourceCraftingFacility",isMut: !0,isSigner: !1,docs: ["The `CraftingFacility` account"]}, {name: "gameAccountsAndProfile",accounts: [{name: "gameAndProfileAndFaction",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key authorized for this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The [`Profile`] account"]}, {name: "profileFaction",isMut: !1,isSigner: !1,docs: ["The faction that the profile belongs to."]}, {name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}]}, {name: "gameState",isMut: !1,isSigner: !1,docs: ["The [`GameState`] account"]}]}, {name: "craftingProgram",isMut: !1,isSigner: !1,docs: ["The Crafting Program"]}],args: [{name: "input",type: {defined: "KeyIndexInput"}}]}, {name: "completeStarbaseUpgrade",accounts: [{name: "funder",isMut: !0,isSigner: !0,docs: ["The funder for the new crafting process"]}, {name: "starbaseAndStarbasePlayer",accounts: [{name: "starbase",isMut: !0,isSigner: !1,docs: ["The [`Starbase`] account"]}, {name: "starbasePlayer",isMut: !1,isSigner: !1,docs: ["The [`StarbasePlayer`] Account"]}]}, {name: "craftingFacility",isMut: !0,isSigner: !1,docs: ["The `CraftingFacility` account for crafting at this `Starbase`"]}, {name: "upgradeFacility",isMut: !1,isSigner: !1,docs: ["The `CraftingFacility` account for starbase upgrades"]}, {name: "upgradeRecipe",isMut: !1,isSigner: !1,docs: ["The crafting recipe for the starbase upgrade"]}, {name: "newRecipeCategory",isMut: !1,isSigner: !1,docs: ["The crafting recipe category for the next `Starbase` level"]}, {name: "craftingDomain",isMut: !1,isSigner: !1,docs: ["The crafting domain"]}, {name: "gameAccountsAndProfile",accounts: [{name: "gameAndProfileAndFaction",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key authorized for this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The [`Profile`] account"]}, {name: "profileFaction",isMut: !1,isSigner: !1,docs: ["The faction that the profile belongs to."]}, {name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}]}, {name: "gameState",isMut: !1,isSigner: !1,docs: ["The [`GameState`] account"]}]}, {name: "craftingProgram",isMut: !1,isSigner: !1,docs: ["The Crafting Program"]}, {name: "systemProgram",isMut: !1,isSigner: !1,docs: ["Solana System program"]}],args: [{name: "input",type: {defined: "KeyIndexInput"}}]}, {name: "copyGameState",accounts: [{name: "gameAndProfile",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key authorized for this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The [`Profile`] account"]}, {name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}]}, {name: "funder",isMut: !0,isSigner: !0,docs: ["The funder for the new `GameState`"]}, {name: "oldGameState",isMut: !1,isSigner: !1,docs: ["The old [`GameState`] account"]}, {name: "newGameState",isMut: !0,isSigner: !1,docs: ["The [`GameState`] account", "This will and should fail if there already exists a `GameState`for the desired `update_id`"]}, {name: "systemProgram",isMut: !1,isSigner: !1,docs: ["The system program"]}],args: [{name: "input",type: {defined: "ManageGameInput"}}]}, {name: "createCargoPod",accounts: [{name: "funder",isMut: !0,isSigner: !0,docs: ["The funder for the new crafting process"]}, {name: "starbaseAndStarbasePlayer",accounts: [{name: "starbase",isMut: !1,isSigner: !1,docs: ["The [`Starbase`] account"]}, {name: "starbasePlayer",isMut: !1,isSigner: !1,docs: ["The [`StarbasePlayer`] Account"]}]}, {name: "cargoPod",isMut: !0,isSigner: !1,docs: ["The new cargo pod"]}, {name: "cargoStatsDefinition",isMut: !1,isSigner: !1,docs: ["The cargo stats definition account"]}, {name: "gameAccountsAndProfile",accounts: [{name: "gameAndProfileAndFaction",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key authorized for this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The [`Profile`] account"]}, {name: "profileFaction",isMut: !1,isSigner: !1,docs: ["The faction that the profile belongs to."]}, {name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}]}, {name: "gameState",isMut: !1,isSigner: !1,docs: ["The [`GameState`] account"]}]}, {name: "cargoProgram",isMut: !1,isSigner: !1,docs: ["The Cargo Program"]}, {name: "systemProgram",isMut: !1,isSigner: !1,docs: ["The system program"]}],args: [{name: "input",type: {defined: "StarbaseCreateCargoPodInput"}}]}, {name: "createCertificateMint",accounts: [{name: "funder",isMut: !0,isSigner: !0,docs: ["The funder for the new crafting process"]}, {name: "starbase",isMut: !1,isSigner: !1,docs: ["The Starbase to create a certificate mint for"]}, {name: "cargoMint",isMut: !1,isSigner: !1,docs: ["The mint to create a certificate mint for"]}, {name: "certificateMint",isMut: !0,isSigner: !1,docs: ["The new certificate mint"]}, {name: "cargoType",isMut: !1,isSigner: !1,docs: ["The cargo type to associated with the `cargo_mint`", "Included to ensure that this instruction can only be called for valid cargo types"]}, {name: "rent",isMut: !1,isSigner: !1,docs: ["The rent sysvar"]}, {name: "tokenProgram",isMut: !1,isSigner: !1,docs: ["The token program"]}, {name: "systemProgram",isMut: !1,isSigner: !1,docs: ["The system program"]}],args: []}, {name: "createCraftingProcess",accounts: [{name: "funder",isMut: !0,isSigner: !0,docs: ["The funder for the new crafting process"]}, {name: "starbaseAndStarbasePlayer",accounts: [{name: "starbase",isMut: !1,isSigner: !1,docs: ["The [`Starbase`] account"]}, {name: "starbasePlayer",isMut: !0,isSigner: !1,docs: ["The [`StarbasePlayer`] Account"]}]}, {name: "craftingInstance",isMut: !0,isSigner: !1,docs: ["The [`CraftingInstance`] account to initialize"]}, {name: "craftingFacility",isMut: !0,isSigner: !1,docs: ["The `CraftingFacility` account"]}, {name: "craftingProcess",isMut: !0,isSigner: !1,docs: ["The crafting process account (NOT initialized)"]}, {name: "craftingRecipe",isMut: !1,isSigner: !1,docs: ["The crafting recipe"]}, {name: "craftingDomain",isMut: !1,isSigner: !1,docs: ["The crafting domain"]}, {name: "gameAccountsAndProfile",accounts: [{name: "gameAndProfileAndFaction",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key authorized for this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The [`Profile`] account"]}, {name: "profileFaction",isMut: !1,isSigner: !1,docs: ["The faction that the profile belongs to."]}, {name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}]}, {name: "gameState",isMut: !1,isSigner: !1,docs: ["The [`GameState`] account"]}]}, {name: "craftingProgram",isMut: !1,isSigner: !1,docs: ["The Crafting Program"]}, {name: "systemProgram",isMut: !1,isSigner: !1,docs: ["Solana System program"]}],args: [{name: "input",type: {defined: "StarbaseCreateCraftingProcessInput"}}]}, {name: "createFleet",accounts: [{name: "gameAccountsAndProfile",accounts: [{name: "gameAndProfileAndFaction",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key authorized for this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The [`Profile`] account"]}, {name: "profileFaction",isMut: !1,isSigner: !1,docs: ["The faction that the profile belongs to."]}, {name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}]}, {name: "gameState",isMut: !1,isSigner: !1,docs: ["The [`GameState`] account"]}]}, {name: "funder",isMut: !0,isSigner: !0,docs: ["The funder for the new `Fleet`"]}, {name: "fleet",isMut: !0,isSigner: !1,docs: ["The [`Fleet`] account"]}, {name: "fleetShips",isMut: !0,isSigner: !1,docs: ["The [`FleetShips`] account"]}, {name: "cargoHold",isMut: !0,isSigner: !1,docs: ["The new fleet `cargo_hold` cargo pod (not initialized)"]}, {name: "fuelTank",isMut: !0,isSigner: !1,docs: ["The new fleet `fuel_tank` cargo pod (not initialized)"]}, {name: "ammoBank",isMut: !0,isSigner: !1,docs: ["The new fleet `ammo_bank` cargo pod (not initialized)"]}, {name: "ship",isMut: !1,isSigner: !1,docs: ["The [`Ship`] Account - represents the first ship in the new fleet"]}, {name: "starbaseAndStarbasePlayer",accounts: [{name: "starbase",isMut: !1,isSigner: !1,docs: ["The [`Starbase`] account"]}, {name: "starbasePlayer",isMut: !0,isSigner: !1,docs: ["The [`StarbasePlayer`] Account"]}]}, {name: "cargoStatsDefinition",isMut: !1,isSigner: !1,docs: ["The cargo stats definition account"]}, {name: "cargoProgram",isMut: !1,isSigner: !1,docs: ["The Cargo Program"]}, {name: "systemProgram",isMut: !1,isSigner: !1,docs: ["The Solana System program"]}],args: [{name: "input",type: {defined: "CreateFleetInput"}}]}, {name: "createStarbaseUpgradeResourceProcess",accounts: [{name: "funder",isMut: !0,isSigner: !0,docs: ["The funder for the new crafting process"]}, {name: "starbaseAndStarbasePlayer",accounts: [{name: "starbase",isMut: !1,isSigner: !1,docs: ["The [`Starbase`] account"]}, {name: "starbasePlayer",isMut: !0,isSigner: !1,docs: ["The [`StarbasePlayer`] Account"]}]}, {name: "craftingInstance",isMut: !0,isSigner: !1,docs: ["The [`CraftingInstance`] account to initialize"]}, {name: "upgradeFacility",isMut: !0,isSigner: !1,docs: ["The `CraftingFacility` account"]}, {name: "craftingProcess",isMut: !0,isSigner: !1,docs: ["The crafting process account (NOT initialized)"]}, {name: "craftingRecipe",isMut: !1,isSigner: !1,docs: ["The crafting recipe"]}, {name: "craftingDomain",isMut: !1,isSigner: !1,docs: ["The crafting domain"]}, {name: "gameAccountsAndProfile",accounts: [{name: "gameAndProfileAndFaction",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key authorized for this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The [`Profile`] account"]}, {name: "profileFaction",isMut: !1,isSigner: !1,docs: ["The faction that the profile belongs to."]}, {name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}]}, {name: "gameState",isMut: !1,isSigner: !1,docs: ["The [`GameState`] account"]}]}, {name: "craftingProgram",isMut: !1,isSigner: !1,docs: ["The Crafting Program"]}, {name: "systemProgram",isMut: !1,isSigner: !1,docs: ["Solana System program"]}],args: [{name: "input",type: {defined: "StarbaseCreateCraftingProcessInput"}}]}, {name: "depositCargoToFleet",accounts: [{name: "gameAccountsFleetAndOwner",accounts: [{name: "gameFleetAndOwner",accounts: [{name: "fleetAndOwner",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key on the profile."]}, {name: "owningProfile",isMut: !1,isSigner: !1,docs: ["The profile that owns the fleet."]}, {name: "owningProfileFaction",isMut: !1,isSigner: !1,docs: ["The faction that the profile belongs to."]}, {name: "fleet",isMut: !0,isSigner: !1,docs: ["The fleet."]}]}, {name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}]}, {name: "gameState",isMut: !1,isSigner: !1,docs: ["The [`GameState`] account"]}]}, {name: "fundsTo",isMut: !0,isSigner: !1,docs: ["The funds_to - receives rent refund"]}, {name: "starbaseAndStarbasePlayer",accounts: [{name: "starbase",isMut: !1,isSigner: !1,docs: ["The [`Starbase`] account"]}, {name: "starbasePlayer",isMut: !1,isSigner: !1,docs: ["The [`StarbasePlayer`] Account"]}]}, {name: "cargoPodFrom",isMut: !0,isSigner: !1,docs: ["The origin cargo pod"]}, {name: "cargoPodTo",isMut: !0,isSigner: !1,docs: ["The destination cargo pod"]}, {name: "cargoType",isMut: !1,isSigner: !1,docs: ["The cargo type account"]}, {name: "cargoStatsDefinition",isMut: !1,isSigner: !1,docs: ["The cargo stats definition account"]}, {name: "tokenFrom",isMut: !0,isSigner: !1,docs: ["The source token account - owned by the `cargo_pod_from`"]}, {name: "tokenTo",isMut: !0,isSigner: !1,docs: ["The destination token account - owned by the `cargo_pod_to`"]}, {name: "tokenMint",isMut: !0,isSigner: !1,docs: ["The mint of the token accounts"]}, {name: "cargoProgram",isMut: !1,isSigner: !1,docs: ["The Cargo Program"]}, {name: "tokenProgram",isMut: !1,isSigner: !1,docs: ["Token Program"]}],args: [{name: "input",type: {defined: "DepositCargoToFleetInput"}}]}, {name: "depositCargoToGame",accounts: [{name: "starbaseAndStarbasePlayer",accounts: [{name: "starbase",isMut: !1,isSigner: !1,docs: ["The [`Starbase`] account"]}, {name: "starbasePlayer",isMut: !1,isSigner: !1,docs: ["The [`StarbasePlayer`] Account"]}]}, {name: "cargoPod",isMut: !0,isSigner: !1,docs: ["The new cargo pod"]}, {name: "cargoType",isMut: !1,isSigner: !1,docs: ["The cargo type account"]}, {name: "cargoStatsDefinition",isMut: !1,isSigner: !1,docs: ["The cargo stats definition account"]}, {name: "gameAccountsAndProfile",accounts: [{name: "gameAndProfileAndFaction",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key authorized for this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The [`Profile`] account"]}, {name: "profileFaction",isMut: !1,isSigner: !1,docs: ["The faction that the profile belongs to."]}, {name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}]}, {name: "gameState",isMut: !1,isSigner: !1,docs: ["The [`GameState`] account"]}]}, {name: "tokenFrom",isMut: !0,isSigner: !1,docs: ["The source token account - owned by the `key`"]}, {name: "tokenTo",isMut: !0,isSigner: !1,docs: ["The destination token account - owned by the `cargo_pod`"]}, {name: "cargoProgram",isMut: !1,isSigner: !1,docs: ["The Cargo Program"]}, {name: "tokenProgram",isMut: !1,isSigner: !1,docs: ["Token Program"]}],args: [{name: "input",type: {defined: "CargoToGameInput"}}]}, {name: "depositCraftingIngredient",accounts: [{name: "starbaseAndStarbasePlayer",accounts: [{name: "starbase",isMut: !1,isSigner: !1,docs: ["The [`Starbase`] account"]}, {name: "starbasePlayer",isMut: !1,isSigner: !1,docs: ["The [`StarbasePlayer`] Account"]}]}, {name: "craftingInstance",isMut: !1,isSigner: !1,docs: ["The [`CraftingInstance`] account"]}, {name: "craftingFacility",isMut: !1,isSigner: !1,docs: ["The [`CraftingFacility`](crafting::CraftingFacility) account"]}, {name: "craftingProcess",isMut: !0,isSigner: !1,docs: ["The crafting process account"]}, {name: "cargoPodFrom",isMut: !0,isSigner: !1,docs: ["The source cargo pod account"]}, {name: "craftingRecipe",isMut: !1,isSigner: !1,docs: ["The crafting recipe"]}, {name: "cargoType",isMut: !1,isSigner: !1,docs: ["The Cargo Type Account"]}, {name: "cargoStatsDefinition",isMut: !1,isSigner: !1,docs: ["The cargo stats definition account"]}, {name: "gameAccountsAndProfile",accounts: [{name: "gameAndProfileAndFaction",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key authorized for this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The [`Profile`] account"]}, {name: "profileFaction",isMut: !1,isSigner: !1,docs: ["The faction that the profile belongs to."]}, {name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}]}, {name: "gameState",isMut: !1,isSigner: !1,docs: ["The [`GameState`] account"]}]}, {name: "tokenFrom",isMut: !0,isSigner: !1,docs: ["The source account of the tokens - owner should be `cargo_pod_from`"]}, {name: "tokenTo",isMut: !0,isSigner: !1,docs: ["The destination account of the tokens - owner should be `crafting_process`"]}, {name: "craftingProgram",isMut: !1,isSigner: !1,docs: ["The Crafting Program"]}, {name: "cargoProgram",isMut: !1,isSigner: !1,docs: ["The Cargo Program"]}, {name: "tokenProgram",isMut: !1,isSigner: !1,docs: ["The [Token] program"]}],args: [{name: "input",type: {defined: "StarbaseDepositCraftingIngredientInput"}}]}, {name: "depositStarbaseUpkeepResource",accounts: [{name: "fundsTo",isMut: !0,isSigner: !1,docs: ["The funds_to - receives rent refund"]}, {name: "starbaseAndStarbasePlayer",accounts: [{name: "starbase",isMut: !0,isSigner: !1,docs: ["The [`Starbase`] account"]}, {name: "starbasePlayer",isMut: !1,isSigner: !1,docs: ["The [`StarbasePlayer`] Account"]}]}, {name: "cargoPodFrom",isMut: !0,isSigner: !1,docs: ["The source cargo pod account"]}, {name: "cargoType",isMut: !1,isSigner: !1,docs: ["The Cargo Type Account"]}, {name: "cargoStatsDefinition",isMut: !1,isSigner: !1,docs: ["The cargo stats definition account"]}, {name: "tokenFrom",isMut: !0,isSigner: !1,docs: ["The source account of the tokens - owner should be `cargo_pod_from`"]}, {name: "tokenMint",isMut: !0,isSigner: !1,docs: ["The token mint"]}, {name: "gameAccountsAndProfile",accounts: [{name: "gameAndProfileAndFaction",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key authorized for this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The [`Profile`] account"]}, {name: "profileFaction",isMut: !1,isSigner: !1,docs: ["The faction that the profile belongs to."]}, {name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}]}, {name: "gameState",isMut: !1,isSigner: !1,docs: ["The [`GameState`] account"]}]}, {name: "resourceRecipe",isMut: !1,isSigner: !1,docs: ["The crafting recipe for the upkeep resource"]}, {name: "loyaltyPointsAccounts",accounts: [{name: "userPointsAccount",isMut: !0,isSigner: !1,docs: ["The User Points Account"]}, {name: "pointsCategory",isMut: !1,isSigner: !1,docs: ["The Points Category Account"]}, {name: "pointsModifierAccount",isMut: !1,isSigner: !1,docs: ["The Points Modifier Account"]}]}, {name: "progressionConfig",isMut: !1,isSigner: !1,docs: ["The [`ProgressionConfig`] account"]}, {name: "pointsProgram",isMut: !1,isSigner: !1,docs: ["The points program"]}, {name: "cargoProgram",isMut: !1,isSigner: !1,docs: ["The Cargo Program"]}, {name: "tokenProgram",isMut: !1,isSigner: !1,docs: ["The [Token] program"]}],args: [{name: "input",type: {defined: "DepositStarbaseUpkeepResourceInput"}}]}, {name: "deregisterMineItem",accounts: [{name: "gameAndProfile",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key authorized for this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The [`Profile`] account"]}, {name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}]}, {name: "fundsTo",isMut: !0,isSigner: !1,docs: ["Where the closing funds go."]}, {name: "mineItem",isMut: !0,isSigner: !1,docs: ["The [`MineItem`] account"]}],args: [{name: "input",type: {defined: "KeyIndexInput"}}]}, {name: "deregisterProgressionConfig",accounts: [{name: "fundsTo",isMut: !0,isSigner: !1,docs: ["Where the closing funds go."]}, {name: "progressionConfig",isMut: !0,isSigner: !1,docs: ["The [`ProgressionConfig`] account"]}, {name: "gameAndProfile",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key authorized for this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The [`Profile`] account"]}, {name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}]}, {name: "systemProgram",isMut: !1,isSigner: !1,docs: ["The Solana System program"]}],args: [{name: "input",type: {defined: "KeyIndexInput"}}]}, {name: "deregisterResource",accounts: [{name: "gameAndProfile",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key authorized for this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The [`Profile`] account"]}, {name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}]}, {name: "fundsTo",isMut: !0,isSigner: !1,docs: ["Where the closing funds go."]}, {name: "mineItem",isMut: !0,isSigner: !1,docs: ["The [`MineItem`] account"]}, {name: "resource",isMut: !0,isSigner: !1,docs: ["The [`Resource`] account"]}, {name: "location",isMut: !0,isSigner: !1,docs: ["The Location address"]}],args: [{name: "input",type: {defined: "KeyIndexInput"}}]}, {name: "deregisterStarbase",accounts: [{name: "gameAndProfile",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key authorized for this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The [`Profile`] account"]}, {name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}]}, {name: "fundsTo",isMut: !0,isSigner: !1,docs: ["Where the closing funds go."]}, {name: "starbase",isMut: !0,isSigner: !1,docs: ["The [`Starbase`] account"]}],args: [{name: "input",type: {defined: "KeyIndexInput"}}]}, {name: "deregisterSurveyDataUnitTracker",accounts: [{name: "gameAndProfile",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key authorized for this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The [`Profile`] account"]}, {name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}]}, {name: "fundsTo",isMut: !0,isSigner: !1,docs: ["Where the closing funds go."]}, {name: "surveyDataUnitTracker",isMut: !0,isSigner: !1,docs: ["The [`SurveyDataUnitTracker`] account"]}],args: [{name: "input",type: {defined: "DeregisterSurveyDataUnitTrackerInput"}}]}, {name: "disbandFleet",accounts: [{name: "gameAccountsAndProfile",accounts: [{name: "gameAndProfileAndFaction",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key authorized for this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The [`Profile`] account"]}, {name: "profileFaction",isMut: !1,isSigner: !1,docs: ["The faction that the profile belongs to."]}, {name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}]}, {name: "gameState",isMut: !1,isSigner: !1,docs: ["The [`GameState`] account"]}]}, {name: "funder",isMut: !0,isSigner: !0,docs: ["The funder - pays for account rent"]}, {name: "disbandedFleet",isMut: !0,isSigner: !1,docs: ["The [`DisbandedFleet`] account"]}, {name: "fleet",isMut: !0,isSigner: !1,docs: ["The [`Fleet`] account", "The fleet can only be disbanded by the `owner_profile` and not `sub_profile`", "Fleet cannot be disbanded while rented"]}, {name: "fleetShips",isMut: !0,isSigner: !1,docs: ["The [`FleetShips`] account"]}, {name: "cargoHold",isMut: !0,isSigner: !1,docs: ["The fleet `cargo_hold` cargo pod"]}, {name: "fuelTank",isMut: !0,isSigner: !1,docs: ["The fleet `fuel_tank` cargo pod"]}, {name: "ammoBank",isMut: !0,isSigner: !1,docs: ["The fleet `ammo_bank` cargo pod"]}, {name: "starbaseAndStarbasePlayer",accounts: [{name: "starbase",isMut: !1,isSigner: !1,docs: ["The [`Starbase`] account"]}, {name: "starbasePlayer",isMut: !1,isSigner: !1,docs: ["The [`StarbasePlayer`] Account"]}]}, {name: "cargoProgram",isMut: !1,isSigner: !1,docs: ["The Cargo Program"]}, {name: "systemProgram",isMut: !1,isSigner: !1,docs: ["The Solana System program"]}],args: [{name: "input",type: {defined: "DisbandFleetInput"}}]}, {name: "disbandedFleetToEscrow",accounts: [{name: "gameAccountsAndProfile",accounts: [{name: "gameAndProfileAndFaction",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key authorized for this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The [`Profile`] account"]}, {name: "profileFaction",isMut: !1,isSigner: !1,docs: ["The faction that the profile belongs to."]}, {name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}]}, {name: "gameState",isMut: !1,isSigner: !1,docs: ["The [`GameState`] account"]}]}, {name: "funder",isMut: !0,isSigner: !0,docs: ["The funder - pays for account rent"]}, {name: "disbandedFleet",isMut: !0,isSigner: !1,docs: ["The [`DisbandedFleet`] account"]}, {name: "fleetShips",isMut: !0,isSigner: !1,docs: ["The [`FleetShips`] account"]}, {name: "starbaseAndStarbasePlayer",accounts: [{name: "starbase",isMut: !1,isSigner: !1,docs: ["The [`Starbase`] account"]}, {name: "starbasePlayer",isMut: !0,isSigner: !1,docs: ["The [`StarbasePlayer`] Account"]}]}, {name: "ship",isMut: !1,isSigner: !1,docs: ["The [`Ship`] Account"]}, {name: "systemProgram",isMut: !1,isSigner: !1,docs: ["The Solana System program"]}],args: [{name: "input",type: {defined: "DisbandedFleetToEscrowInput"}}]}, {name: "discoverSector",accounts: [{name: "gameAccountsFleetAndOwner",accounts: [{name: "gameFleetAndOwner",accounts: [{name: "fleetAndOwner",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key on the profile."]}, {name: "owningProfile",isMut: !1,isSigner: !1,docs: ["The profile that owns the fleet."]}, {name: "owningProfileFaction",isMut: !1,isSigner: !1,docs: ["The faction that the profile belongs to."]}, {name: "fleet",isMut: !1,isSigner: !1,docs: ["The fleet."]}]}, {name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}]}, {name: "gameState",isMut: !1,isSigner: !1,docs: ["The [`GameState`] account"]}]}, {name: "funder",isMut: !0,isSigner: !0,docs: ["The funder for the new sector"]}, {name: "sector",isMut: !0,isSigner: !1,docs: ["The [`Sector`] account"]}, {name: "systemProgram",isMut: !1,isSigner: !1,docs: ["The Solana System program"]}],args: [{name: "input",type: {defined: "DiscoverSectorInput"}}]}, {name: "drainMineItemBank",accounts: [{name: "gameAndProfile",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key authorized for this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The [`Profile`] account"]}, {name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}]}, {name: "fundsTo",isMut: !0,isSigner: !1,docs: ["Where the closing funds go."]}, {name: "mineItem",isMut: !0,isSigner: !1,docs: ["The [`MineItem`] account"]}, {name: "tokenFrom",isMut: !0,isSigner: !1,docs: ["The mine item token bank to drain"]}, {name: "tokenTo",isMut: !0,isSigner: !1,docs: ["Where to send tokens from the bank"]}, {name: "tokenProgram",isMut: !1,isSigner: !1,docs: ["The [Token] program"]}],args: [{name: "input",type: {defined: "KeyIndexInput"}}]}, {name: "drainSurveyDataUnitsBank",accounts: [{name: "gameAndProfile",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key authorized for this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The [`Profile`] account"]}, {name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}]}, {name: "fundsTo",isMut: !0,isSigner: !1,docs: ["Where the closing rent refunds go."]}, {name: "surveyDataUnitTracker",isMut: !1,isSigner: !1,docs: ["The [`SurveyDataUnitTracker`] account"]}, {name: "surveyDataUnitTrackerSigner",isMut: !1,isSigner: !1,docs: ["The `SurveyDataUnitTracker` signer"]}, {name: "tokenFrom",isMut: !0,isSigner: !1,docs: ["The SDU token bank to drain"]}, {name: "tokenTo",isMut: !0,isSigner: !1,docs: ["Where to send tokens from the bank"]}, {name: "tokenProgram",isMut: !1,isSigner: !1,docs: ["The [Token] program"]}],args: [{name: "input",type: {defined: "KeyIndexInput"}}]}, {name: "fleetStateHandler",accounts: [{name: "fleet",isMut: !0,isSigner: !1,docs: ["The fleet."]}],args: []}, {name: "forceDisbandFleet",accounts: [{name: "funder",isMut: !0,isSigner: !0,docs: ["The funder - pays for account rent"]}, {name: "disbandedFleet",isMut: !0,isSigner: !1,docs: ["The new [`DisbandedFleet`] account"]}, {name: "fleet",isMut: !0,isSigner: !1,docs: ["The [`Fleet`] account"]}, {name: "fleetShips",isMut: !0,isSigner: !1,docs: ["The [`FleetShips`] account"]}, {name: "cargoHold",isMut: !0,isSigner: !1,docs: ["The fleet `cargo_hold` cargo pod"]}, {name: "fuelTank",isMut: !0,isSigner: !1,docs: ["The fleet `fuel_tank` cargo pod"]}, {name: "ammoBank",isMut: !0,isSigner: !1,docs: ["The fleet `ammo_bank` cargo pod"]}, {name: "starbaseAndStarbasePlayer",accounts: [{name: "starbase",isMut: !1,isSigner: !1,docs: ["The [`Starbase`] account"]}, {name: "starbasePlayer",isMut: !1,isSigner: !1,docs: ["The [`StarbasePlayer`] Account"]}]}, {name: "ship",isMut: !1,isSigner: !1,docs: ["The [`Ship`]", "Must provide at least one ship that is invalid for this instruction"]}, {name: "gameAccounts",accounts: [{name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}, {name: "gameState",isMut: !1,isSigner: !1,docs: ["The [`GameState`] account"]}]}, {name: "cargoProgram",isMut: !1,isSigner: !1,docs: ["The Cargo Program"]}, {name: "systemProgram",isMut: !1,isSigner: !1,docs: ["The Solana System program"]}],args: [{name: "input",type: {defined: "ForcedDisbandFleetInput"}}]}, {name: "forceDropFleetCargo",accounts: [{name: "fleet",isMut: !0,isSigner: !1,docs: ["The `Fleet` Account"]}, {name: "fleetShips",isMut: !0,isSigner: !1,docs: ["The [`FleetShips`] account"]}, {name: "cargoPod",isMut: !0,isSigner: !1,docs: ["The origin cargo pod"]}, {name: "cargoType",isMut: !1,isSigner: !1,docs: ["The `cargo_type` for the token"]}, {name: "cargoStatsDefinition",isMut: !1,isSigner: !1,docs: ["The cargo stats definition"]}, {name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}, {name: "tokenFrom",isMut: !0,isSigner: !1,docs: ["The source token account - owned by the `cargo_pod`"]}, {name: "tokenMint",isMut: !0,isSigner: !1,docs: ["The mint of the token account"]}, {name: "cargoProgram",isMut: !1,isSigner: !1,docs: ["The Cargo Program"]}, {name: "tokenProgram",isMut: !1,isSigner: !1,docs: ["Token Program"]}],args: []}, {name: "idleToLoadingBay",accounts: [{name: "gameAccountsFleetAndOwner",accounts: [{name: "gameFleetAndOwner",accounts: [{name: "fleetAndOwner",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key on the profile."]}, {name: "owningProfile",isMut: !1,isSigner: !1,docs: ["The profile that owns the fleet."]}, {name: "owningProfileFaction",isMut: !1,isSigner: !1,docs: ["The faction that the profile belongs to."]}, {name: "fleet",isMut: !0,isSigner: !1,docs: ["The fleet."]}]}, {name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}]}, {name: "gameState",isMut: !1,isSigner: !1,docs: ["The [`GameState`] account"]}]}, {name: "starbaseAndStarbasePlayer",accounts: [{name: "starbase",isMut: !1,isSigner: !1,docs: ["The [`Starbase`] account"]}, {name: "starbasePlayer",isMut: !0,isSigner: !1,docs: ["The [`StarbasePlayer`] Account"]}]}],args: [{name: "keyIndex",type: "u16"}]}, {name: "idleToRespawn",accounts: [{name: "gameAccountsFleetAndOwner",accounts: [{name: "gameFleetAndOwner",accounts: [{name: "fleetAndOwner",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key on the profile."]}, {name: "owningProfile",isMut: !1,isSigner: !1,docs: ["The profile that owns the fleet."]}, {name: "owningProfileFaction",isMut: !1,isSigner: !1,docs: ["The faction that the profile belongs to."]}, {name: "fleet",isMut: !0,isSigner: !1,docs: ["The fleet."]}]}, {name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}]}, {name: "gameState",isMut: !1,isSigner: !1,docs: ["The [`GameState`] account"]}]}, {name: "atlasTokenFrom",isMut: !0,isSigner: !1,docs: ["Source Token account for ATLAS, owned by the player"]}, {name: "atlasTokenTo",isMut: !0,isSigner: !1,docs: ["Vault Token account for ATLAS"]}, {name: "tokenProgram",isMut: !1,isSigner: !1,docs: ["The Solana Token Program"]}],args: [{name: "input",type: {defined: "IdleToRespawnInput"}}]}, {name: "initGame",accounts: [{name: "signer",isMut: !0,isSigner: !0,docs: ["The entity calling this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The sector permissions [`Profile`]"]}, {name: "funder",isMut: !0,isSigner: !0,docs: ["The funder for the new game"]}, {name: "gameId",isMut: !0,isSigner: !0,docs: ["The [`Game`] account"]}, {name: "systemProgram",isMut: !1,isSigner: !1,docs: ["The system program"]}],args: []}, {name: "initGameState",accounts: [{name: "gameAndProfile",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key authorized for this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The [`Profile`] account"]}, {name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}]}, {name: "funder",isMut: !0,isSigner: !0,docs: ["The funder for the new `GameState`"]}, {name: "gameState",isMut: !0,isSigner: !1,docs: ["The [`GameState`] account"]}, {name: "systemProgram",isMut: !1,isSigner: !1,docs: ["The system program"]}],args: [{name: "input",type: {defined: "InitGameStateInput"}}]}, {name: "invalidateRental",accounts: [{name: "subProfileInvalidator",isMut: !1,isSigner: !0,docs: ["The fleet rental invalidator"]}, {name: "fleet",isMut: !0,isSigner: !1,docs: ["The fleet"]}],args: []}, {name: "invalidateShip",accounts: [{name: "gameAndProfile",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key authorized for this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The [`Profile`] account"]}, {name: "gameId",isMut: !0,isSigner: !1,docs: ["The [`Game`] account"]}]}, {name: "ship",isMut: !0,isSigner: !1,docs: ["The current [`Ship`] account"]}],args: [{name: "keyIndex",type: "u16"}]}, {name: "loadingBayToIdle",accounts: [{name: "gameAccountsFleetAndOwner",accounts: [{name: "gameFleetAndOwner",accounts: [{name: "fleetAndOwner",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key on the profile."]}, {name: "owningProfile",isMut: !1,isSigner: !1,docs: ["The profile that owns the fleet."]}, {name: "owningProfileFaction",isMut: !1,isSigner: !1,docs: ["The faction that the profile belongs to."]}, {name: "fleet",isMut: !0,isSigner: !1,docs: ["The fleet."]}]}, {name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}]}, {name: "gameState",isMut: !1,isSigner: !1,docs: ["The [`GameState`] account"]}]}, {name: "starbaseAndStarbasePlayer",accounts: [{name: "starbase",isMut: !1,isSigner: !1,docs: ["The [`Starbase`] account"]}, {name: "starbasePlayer",isMut: !0,isSigner: !1,docs: ["The [`StarbasePlayer`] Account"]}]}],args: [{name: "keyIndex",type: "u16"}]}, {name: "mineAsteroidToRespawn",accounts: [{name: "gameAccountsFleetAndOwner",accounts: [{name: "gameFleetAndOwner",accounts: [{name: "fleetAndOwner",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key on the profile."]}, {name: "owningProfile",isMut: !1,isSigner: !1,docs: ["The profile that owns the fleet."]}, {name: "owningProfileFaction",isMut: !1,isSigner: !1,docs: ["The faction that the profile belongs to."]}, {name: "fleet",isMut: !0,isSigner: !1,docs: ["The fleet."]}]}, {name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}]}, {name: "gameState",isMut: !1,isSigner: !1,docs: ["The [`GameState`] account"]}]}, {name: "resource",isMut: !0,isSigner: !1,docs: ["The [`Resource`] account"]}, {name: "planet",isMut: !0,isSigner: !1,docs: ["The [`Planet`] account"]}, {name: "atlasTokenFrom",isMut: !0,isSigner: !1,docs: ["Source Token account for ATLAS, owned by the player"]}, {name: "atlasTokenTo",isMut: !0,isSigner: !1,docs: ["Vault Token account for ATLAS"]}, {name: "tokenProgram",isMut: !1,isSigner: !1,docs: ["The Solana Token Program"]}],args: [{name: "input",type: {defined: "MineAsteroidToRespawnInput"}}]}, {name: "mintCertificate",accounts: [{name: "starbaseAndStarbasePlayer",accounts: [{name: "starbase",isMut: !1,isSigner: !1,docs: ["The [`Starbase`] account"]}, {name: "starbasePlayer",isMut: !1,isSigner: !1,docs: ["The [`StarbasePlayer`] Account"]}]}, {name: "gameAccountsAndProfile",accounts: [{name: "gameAndProfileAndFaction",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key authorized for this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The [`Profile`] account"]}, {name: "profileFaction",isMut: !1,isSigner: !1,docs: ["The faction that the profile belongs to."]}, {name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}]}, {name: "gameState",isMut: !1,isSigner: !1,docs: ["The [`GameState`] account"]}]}, {name: "cargoMint",isMut: !1,isSigner: !1,docs: ["The mint of the cargo in question"]}, {name: "certificateMint",isMut: !0,isSigner: !1,docs: ["The cargo certificate mint"]}, {name: "certificateTokenTo",isMut: !0,isSigner: !1,docs: ["The token account where certificates are minted to"]}, {name: "cargoTokenFrom",isMut: !0,isSigner: !1,docs: ["The source token account for the cargo - owned by the `cargo_pod`"]}, {name: "cargoTokenTo",isMut: !0,isSigner: !1,docs: ["The destination token account for the cargo - owned by the Starbase"]}, {name: "cargoPod",isMut: !0,isSigner: !1,docs: ["The cargo pod to take from"]}, {name: "cargoType",isMut: !1,isSigner: !1,docs: ["The cargo type account"]}, {name: "cargoStatsDefinition",isMut: !1,isSigner: !1,docs: ["The cargo stats definition account"]}, {name: "cargoProgram",isMut: !1,isSigner: !1,docs: ["The Cargo Program"]}, {name: "tokenProgram",isMut: !1,isSigner: !1,docs: ["The token program"]}],args: [{name: "keyIndex",type: "u16"}, {name: "amount",type: "u64"}]}, {name: "redeemCertificate",accounts: [{name: "starbaseAndStarbasePlayer",accounts: [{name: "starbase",isMut: !1,isSigner: !1,docs: ["The [`Starbase`] account"]}, {name: "starbasePlayer",isMut: !1,isSigner: !1,docs: ["The [`StarbasePlayer`] Account"]}]}, {name: "gameAccountsAndProfile",accounts: [{name: "gameAndProfileAndFaction",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key authorized for this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The [`Profile`] account"]}, {name: "profileFaction",isMut: !1,isSigner: !1,docs: ["The faction that the profile belongs to."]}, {name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}]}, {name: "gameState",isMut: !1,isSigner: !1,docs: ["The [`GameState`] account"]}]}, {name: "cargoMint",isMut: !1,isSigner: !1,docs: ["The mint of the cargo in question"]}, {name: "certificateMint",isMut: !0,isSigner: !1,docs: ["The cargo certificate mint"]}, {name: "certificateOwnerAuthority",isMut: !1,isSigner: !0,docs: ["Owner of the certificates"]}, {name: "certificateTokenFrom",isMut: !0,isSigner: !1,docs: ["The source token account for the cargo certificate - owned by the `certificate_owner_authority`"]}, {name: "cargoTokenFrom",isMut: !0,isSigner: !1,docs: ["The source token account for the cargo - owned by the Starbase"]}, {name: "cargoTokenTo",isMut: !0,isSigner: !1,docs: ["The destination token account for the cargo - owned by the `cargo_pod`"]}, {name: "cargoPod",isMut: !0,isSigner: !1,docs: ["The cargo pod to send to"]}, {name: "cargoType",isMut: !1,isSigner: !1,docs: ["The cargo type account"]}, {name: "cargoStatsDefinition",isMut: !1,isSigner: !1,docs: ["The cargo stats definition account"]}, {name: "cargoProgram",isMut: !1,isSigner: !1,docs: ["The Cargo Program"]}, {name: "tokenProgram",isMut: !1,isSigner: !1,docs: ["The token program"]}],args: [{name: "keyIndex",type: "u16"}, {name: "amount",type: "u64"}]}, {name: "registerMineItem",accounts: [{name: "gameAndProfile",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key authorized for this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The [`Profile`] account"]}, {name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}]}, {name: "funder",isMut: !0,isSigner: !0,docs: ["The funder for the new mine item"]}, {name: "mineItem",isMut: !0,isSigner: !1,docs: ["The [`MineItem`] account"]}, {name: "mint",isMut: !0,isSigner: !1,docs: ["The mint address representing the mine item"]}, {name: "systemProgram",isMut: !1,isSigner: !1,docs: ["The Solana System program"]}],args: [{name: "input",type: {defined: "RegisterMineItemInput"}}]}, {name: "registerPlanet",accounts: [{name: "gameAndProfile",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key authorized for this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The [`Profile`] account"]}, {name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}]}, {name: "funder",isMut: !0,isSigner: !0,docs: ["The funder for the new game"]}, {name: "planet",isMut: !0,isSigner: !0,docs: ["The [`Planet`] account"]}, {name: "sector",isMut: !0,isSigner: !1,docs: ["The [`Sector`] account"]}, {name: "systemProgram",isMut: !1,isSigner: !1,docs: ["The Solana System program"]}],args: [{name: "input",type: {defined: "RegisterPlanetInput"}}]}, {name: "registerProgressionConfig",accounts: [{name: "funder",isMut: !0,isSigner: !0,docs: ["The funder for the new star base"]}, {name: "progressionConfig",isMut: !0,isSigner: !1,docs: ["The [`ProgressionConfig`] account"]}, {name: "gameAndProfile",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key authorized for this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The [`Profile`] account"]}, {name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}]}, {name: "systemProgram",isMut: !1,isSigner: !1,docs: ["The Solana System program"]}],args: [{name: "input",type: {defined: "RegisterProgressionConfigInput"}}]}, {name: "registerResource",accounts: [{name: "gameAndProfile",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key authorized for this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The [`Profile`] account"]}, {name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}]}, {name: "funder",isMut: !0,isSigner: !0,docs: ["The funder for the new resource"]}, {name: "resource",isMut: !0,isSigner: !1,docs: ["The [`Resource`] account"]}, {name: "location",isMut: !0,isSigner: !1,docs: ["The Location address"]}, {name: "mineItem",isMut: !0,isSigner: !1,docs: ["The [`MineItem`] account"]}, {name: "systemProgram",isMut: !1,isSigner: !1,docs: ["The Solana System program"]}],args: [{name: "input",type: {defined: "RegisterResourceInput"}}]}, {name: "registerSagePlayerProfile",accounts: [{name: "profile",isMut: !1,isSigner: !1,docs: ["The player permissions [`Profile`]"]}, {name: "funder",isMut: !0,isSigner: !0,docs: ["The funder for the new profile"]}, {name: "sagePlayerProfile",isMut: !0,isSigner: !1,docs: ["The `SagePlayerProfile` account"]}, {name: "gameAccounts",accounts: [{name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}, {name: "gameState",isMut: !1,isSigner: !1,docs: ["The [`GameState`] account"]}]}, {name: "systemProgram",isMut: !1,isSigner: !1,docs: ["The Solana System program"]}],args: []}, {name: "registerSagePointModifier",accounts: [{name: "gameAndProfile",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key authorized for this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The [`Profile`] account"]}, {name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}]}, {name: "funder",isMut: !0,isSigner: !0,docs: ["The funder - pays for account rent"]}, {name: "pointsCategory",isMut: !1,isSigner: !1,docs: ["The `PointCategory`"]}, {name: "pointsModifier",isMut: !0,isSigner: !1,docs: ["The `PointsModifier` account to be created in Points CPI"]}, {name: "pointsProgram",isMut: !1,isSigner: !1,docs: ["The points program"]}, {name: "systemProgram",isMut: !1,isSigner: !1,docs: ["The Solana System program"]}],args: [{name: "input",type: {defined: "RegisterSagePointsModifierInput"}}]}, {name: "registerSector",accounts: [{name: "gameAndProfile",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key authorized for this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The [`Profile`] account"]}, {name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}]}, {name: "funder",isMut: !0,isSigner: !0,docs: ["The funder for the new sector"]}, {name: "discoverer",isMut: !1,isSigner: !1,docs: ["The discoverer of this sector"]}, {name: "sector",isMut: !0,isSigner: !1,docs: ["The [`Sector`] account"]}, {name: "systemProgram",isMut: !1,isSigner: !1,docs: ["The Solana System program"]}],args: [{name: "coordinates",type: {array: ["i64", 2]}}, {name: "name",type: {array: ["u8", 64]}}, {name: "keyIndex",type: "u16"}]}, {name: "registerShip",accounts: [{name: "gameAndProfile",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key authorized for this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The [`Profile`] account"]}, {name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}]}, {name: "funder",isMut: !0,isSigner: !0,docs: ["The funder for the new game"]}, {name: "ship",isMut: !0,isSigner: !0,docs: ["The [`Ship`] account"]}, {name: "mint",isMut: !1,isSigner: !1,docs: ["The mint address representing the [`Ship`]"]}, {name: "systemProgram",isMut: !1,isSigner: !1,docs: ["The Solana System program"]}],args: [{name: "input",type: {defined: "RegisterShipInput"}}]}, {name: "registerStar",accounts: [{name: "gameAndProfile",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key authorized for this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The [`Profile`] account"]}, {name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}]}, {name: "funder",isMut: !0,isSigner: !0,docs: ["The funder - pays for account rent"]}, {name: "star",isMut: !0,isSigner: !0,docs: ["The [`Star`] account"]}, {name: "sector",isMut: !0,isSigner: !1,docs: ["The [`Sector`] account"]}, {name: "systemProgram",isMut: !1,isSigner: !1,docs: ["The Solana System program"]}],args: [{name: "input",type: {defined: "RegisterStarInput"}}]}, {name: "registerStarbase",accounts: [{name: "funder",isMut: !0,isSigner: !0,docs: ["The funder for the new star base"]}, {name: "starbase",isMut: !0,isSigner: !1,docs: ["The [`Starbase`] account"]}, {name: "sector",isMut: !1,isSigner: !1,docs: ["The [`Sector`] account"]}, {name: "gameStateAndProfile",accounts: [{name: "gameAndProfile",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key authorized for this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The [`Profile`] account"]}, {name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}]}, {name: "gameState",isMut: !1,isSigner: !1,docs: ["The [`GameState`] account"]}]}, {name: "systemProgram",isMut: !1,isSigner: !1,docs: ["The Solana System program"]}],args: [{name: "input",type: {defined: "RegisterStarbaseInputUnpacked"}}]}, {name: "registerStarbasePlayer",accounts: [{name: "funder",isMut: !0,isSigner: !0,docs: ["The funder -- pays account rent"]}, {name: "gameAccounts",accounts: [{name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}, {name: "gameState",isMut: !1,isSigner: !1,docs: ["The [`GameState`] account"]}]}, {name: "sagePlayerProfile",isMut: !1,isSigner: !1,docs: ["The [`SagePlayerProfile`] account"]}, {name: "profileFaction",isMut: !1,isSigner: !1,docs: ["The faction that the player belongs to."]}, {name: "starbase",isMut: !1,isSigner: !1,docs: ["The [`Starbase`] account"]}, {name: "starbasePlayer",isMut: !0,isSigner: !1,docs: ["The [`StarbasePlayer`] account to initialize"]}, {name: "systemProgram",isMut: !1,isSigner: !1,docs: ["The system program"]}],args: []}, {name: "registerSurveyDataUnitTracker",accounts: [{name: "gameAndProfile",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key authorized for this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The [`Profile`] account"]}, {name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}]}, {name: "funder",isMut: !0,isSigner: !0,docs: ["The funder for the new `SurveyDataUnitTracker`"]}, {name: "surveyDataUnitTracker",isMut: !0,isSigner: !0,docs: ["The [`SurveyDataUnitTracker`] account"]}, {name: "sduMint",isMut: !1,isSigner: !1,docs: ["The Survey Data Unit Mint"]}, {name: "resourceMint",isMut: !1,isSigner: !1,docs: ["The mint of the resource spent when scanning for SDUs"]}, {name: "systemProgram",isMut: !1,isSigner: !1,docs: ["The Solana System program"]}],args: [{name: "input",type: {defined: "RegisterSurveyDataUnitTrackerInput"}}]}, {name: "removeCargoPod",accounts: [{name: "fundsTo",isMut: !0,isSigner: !1,docs: ["The funds_to - receives rent refund"]}, {name: "starbaseAndStarbasePlayer",accounts: [{name: "starbase",isMut: !1,isSigner: !1,docs: ["The [`Starbase`] account"]}, {name: "starbasePlayer",isMut: !1,isSigner: !1,docs: ["The [`StarbasePlayer`] Account"]}]}, {name: "cargoPod",isMut: !0,isSigner: !1,docs: ["The cargo pod (should be empty)"]}, {name: "gameAccountsAndProfile",accounts: [{name: "gameAndProfileAndFaction",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key authorized for this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The [`Profile`] account"]}, {name: "profileFaction",isMut: !1,isSigner: !1,docs: ["The faction that the profile belongs to."]}, {name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}]}, {name: "gameState",isMut: !1,isSigner: !1,docs: ["The [`GameState`] account"]}]}, {name: "cargoProgram",isMut: !1,isSigner: !1,docs: ["The Cargo Program"]}, {name: "systemProgram",isMut: !1,isSigner: !1,docs: ["The system program"]}],args: [{name: "input",type: {defined: "StarbaseRemoveCargoPodInput"}}]}, {name: "removeConnection",accounts: [{name: "gameAndProfile",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key authorized for this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The [`Profile`] account"]}, {name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}]}, {name: "fundsTo",isMut: !0,isSigner: !1,docs: ["Where the rent refund funds from the connections go to."]}, {name: "sector1",isMut: !0,isSigner: !1,docs: ["The first sector to remove from"]}, {name: "sector2",isMut: !0,isSigner: !1,docs: ["The second sector to remove from"]}, {name: "systemProgram",isMut: !1,isSigner: !1,docs: ["The system program"]}],args: [{name: "sector1Index",type: "u16"}, {name: "sector2Index",type: "u16"}, {name: "keyIndex",type: "u16"}]}, {name: "removeInvalidShipEscrow",accounts: [{name: "gameAccountsAndProfile",accounts: [{name: "gameAndProfileAndFaction",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key authorized for this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The [`Profile`] account"]}, {name: "profileFaction",isMut: !1,isSigner: !1,docs: ["The faction that the profile belongs to."]}, {name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}]}, {name: "gameState",isMut: !1,isSigner: !1,docs: ["The [`GameState`] account"]}]}, {name: "fundsTo",isMut: !0,isSigner: !1,docs: ["The funds_to - receives rent refund"]}, {name: "sagePlayerProfile",isMut: !0,isSigner: !1,docs: ["The [`SagePlayerProfile`] account"]}, {name: "destinationTokenAccount",isMut: !0,isSigner: !1,docs: ["The Destination Token Account"]}, {name: "ship",isMut: !1,isSigner: !1,docs: ["The [`Ship`] Account"]}, {name: "shipEscrowTokenAccount",isMut: !0,isSigner: !1,docs: ["The Escrow Token Account"]}, {name: "starbaseAndStarbasePlayer",accounts: [{name: "starbase",isMut: !1,isSigner: !1,docs: ["The [`Starbase`] account"]}, {name: "starbasePlayer",isMut: !0,isSigner: !1,docs: ["The [`StarbasePlayer`] Account"]}]}, {name: "tokenProgram",isMut: !1,isSigner: !1,docs: ["The Token Program"]}, {name: "systemProgram",isMut: !1,isSigner: !1,docs: ["The Solana System program"]}],args: [{name: "input",type: {defined: "RemoveShipEscrowInput"}}]}, {name: "removeShipEscrow",accounts: [{name: "gameAccountsAndProfile",accounts: [{name: "gameAndProfileAndFaction",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key authorized for this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The [`Profile`] account"]}, {name: "profileFaction",isMut: !1,isSigner: !1,docs: ["The faction that the profile belongs to."]}, {name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}]}, {name: "gameState",isMut: !1,isSigner: !1,docs: ["The [`GameState`] account"]}]}, {name: "fundsTo",isMut: !0,isSigner: !1,docs: ["The funds_to - receives rent refund"]}, {name: "sagePlayerProfile",isMut: !0,isSigner: !1,docs: ["The [`SagePlayerProfile`] account"]}, {name: "destinationTokenAccount",isMut: !0,isSigner: !1,docs: ["The Destination Token Account"]}, {name: "ship",isMut: !1,isSigner: !1,docs: ["The [`Ship`] Account"]}, {name: "shipEscrowTokenAccount",isMut: !0,isSigner: !1,docs: ["The Escrow Token Account"]}, {name: "starbaseAndStarbasePlayer",accounts: [{name: "starbase",isMut: !1,isSigner: !1,docs: ["The [`Starbase`] account"]}, {name: "starbasePlayer",isMut: !0,isSigner: !1,docs: ["The [`StarbasePlayer`] Account"]}]}, {name: "tokenProgram",isMut: !1,isSigner: !1,docs: ["The Token Program"]}, {name: "systemProgram",isMut: !1,isSigner: !1,docs: ["The Solana System program"]}],args: [{name: "input",type: {defined: "RemoveShipEscrowInput"}}]}, {name: "respawnToLoadingBay",accounts: [{name: "gameAccountsFleetAndOwner",accounts: [{name: "gameFleetAndOwner",accounts: [{name: "fleetAndOwner",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key on the profile."]}, {name: "owningProfile",isMut: !1,isSigner: !1,docs: ["The profile that owns the fleet."]}, {name: "owningProfileFaction",isMut: !1,isSigner: !1,docs: ["The faction that the profile belongs to."]}, {name: "fleet",isMut: !0,isSigner: !1,docs: ["The fleet."]}]}, {name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}]}, {name: "gameState",isMut: !1,isSigner: !1,docs: ["The [`GameState`] account"]}]}, {name: "starbaseAndStarbasePlayer",accounts: [{name: "starbase",isMut: !1,isSigner: !1,docs: ["The [`Starbase`] account"]}, {name: "starbasePlayer",isMut: !0,isSigner: !1,docs: ["The [`StarbasePlayer`] Account"]}]}, {name: "cargoHold",isMut: !1,isSigner: !1,docs: ["The fleet `cargo_hold` cargo pod"]}, {name: "fuelTank",isMut: !1,isSigner: !1,docs: ["The fleet `fuel_tank` cargo pod"]}, {name: "ammoBank",isMut: !1,isSigner: !1,docs: ["The fleet `ammo_bank` cargo pod"]}],args: [{name: "input",type: {defined: "RespawnToLoadingBayInput"}}]}, {name: "scanForSurveyDataUnits",accounts: [{name: "gameAccountsFleetAndOwner",accounts: [{name: "gameFleetAndOwner",accounts: [{name: "fleetAndOwner",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key on the profile."]}, {name: "owningProfile",isMut: !1,isSigner: !1,docs: ["The profile that owns the fleet."]}, {name: "owningProfileFaction",isMut: !1,isSigner: !1,docs: ["The faction that the profile belongs to."]}, {name: "fleet",isMut: !0,isSigner: !1,docs: ["The fleet."]}]}, {name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}]}, {name: "gameState",isMut: !1,isSigner: !1,docs: ["The [`GameState`] account"]}]}, {name: "surveyDataUnitTracker",isMut: !1,isSigner: !1,docs: ["The [`SurveyDataUnitTracker`] account"]}, {name: "surveyDataUnitTrackerSigner",isMut: !1,isSigner: !1,docs: ["The `SurveyDataUnitTracker` signer"]}, {name: "cargoHold",isMut: !0,isSigner: !1,docs: ["The general cargo hold cargo pod for the fleet"]}, {name: "sector",isMut: !0,isSigner: !1,docs: ["The [`Sector`] account"]}, {name: "sduTokenFrom",isMut: !0,isSigner: !1,docs: ["Source token account for the SDU, owned by `survey_data_unit_tracker_signer`"]}, {name: "sduTokenTo",isMut: !0,isSigner: !1,docs: ["Destination token account for the SDU, owned by cargo_hold"]}, {name: "resourceTokenFrom",isMut: !0,isSigner: !1,docs: ["Token account for `resource_mint`, owned by fleet"]}, {name: "resourceMint",isMut: !0,isSigner: !1,docs: ["The resource that is spent when scanning for Survey Data Units"]}, {name: "sduCargoType",isMut: !1,isSigner: !1,docs: ["The cargo type of the SDU"]}, {name: "resourceCargoType",isMut: !1,isSigner: !1,docs: ["The cargo type of `resource_mint`"]}, {name: "cargoStatsDefinition",isMut: !1,isSigner: !1,docs: ["The cargo stats definition"]}, {name: "dataRunningXpAccounts",accounts: [{name: "userPointsAccount",isMut: !0,isSigner: !1,docs: ["The User Points Account"]}, {name: "pointsCategory",isMut: !1,isSigner: !1,docs: ["The Points Category Account"]}, {name: "pointsModifierAccount",isMut: !1,isSigner: !1,docs: ["The Points Modifier Account"]}]}, {name: "councilRankXpAccounts",accounts: [{name: "userPointsAccount",isMut: !0,isSigner: !1,docs: ["The User Points Account"]}, {name: "pointsCategory",isMut: !1,isSigner: !1,docs: ["The Points Category Account"]}, {name: "pointsModifierAccount",isMut: !1,isSigner: !1,docs: ["The Points Modifier Account"]}]}, {name: "progressionConfig",isMut: !1,isSigner: !1,docs: ["The [`ProgressionConfig`] account"]}, {name: "pointsProgram",isMut: !1,isSigner: !1,docs: ["The points program"]}, {name: "cargoProgram",isMut: !1,isSigner: !1,docs: ["The cargo program"]}, {name: "tokenProgram",isMut: !1,isSigner: !1,docs: ["The token program"]}, {name: "instructionsSysvar",isMut: !1,isSigner: !1,docs: ["Solana Instructions Sysvar"]}, {name: "recentSlothashes",isMut: !1,isSigner: !1,docs: ["Solana recent slothashes"]}],args: [{name: "input",type: {defined: "ScanForSurveyDataUnitsInput"}}]}, {name: "setNextShip",accounts: [{name: "gameAndProfile",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key authorized for this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The [`Profile`] account"]}, {name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}]}, {name: "ship",isMut: !0,isSigner: !1,docs: ["The current [`Ship`] account"]}, {name: "nextShip",isMut: !0,isSigner: !1,docs: ["The next [`Ship`] account"]}],args: [{name: "keyIndex",type: "u16"}]}, {name: "startCraftingProcess",accounts: [{name: "starbaseAndStarbasePlayer",accounts: [{name: "starbase",isMut: !1,isSigner: !1,docs: ["The [`Starbase`] account"]}, {name: "starbasePlayer",isMut: !1,isSigner: !1,docs: ["The [`StarbasePlayer`] Account"]}]}, {name: "craftingInstance",isMut: !1,isSigner: !1,docs: ["The [`CraftingInstance`] account"]}, {name: "craftingProcess",isMut: !0,isSigner: !1,docs: ["The [`CraftingProcess`] account"]}, {name: "craftingRecipe",isMut: !0,isSigner: !1,docs: ["The crafting [`Recipe`]"]}, {name: "craftingFacility",isMut: !1,isSigner: !1,docs: ["The `CraftingFacility` account"]}, {name: "gameAccountsAndProfile",accounts: [{name: "gameAndProfileAndFaction",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key authorized for this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The [`Profile`] account"]}, {name: "profileFaction",isMut: !1,isSigner: !1,docs: ["The faction that the profile belongs to."]}, {name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}]}, {name: "gameState",isMut: !1,isSigner: !1,docs: ["The [`GameState`] account"]}]}, {name: "craftingProgram",isMut: !1,isSigner: !1,docs: ["The Crafting Program"]}],args: [{name: "input",type: {defined: "KeyIndexInput"}}]}, {name: "startMiningAsteroid",accounts: [{name: "gameAccountsFleetAndOwner",accounts: [{name: "gameFleetAndOwner",accounts: [{name: "fleetAndOwner",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key on the profile."]}, {name: "owningProfile",isMut: !1,isSigner: !1,docs: ["The profile that owns the fleet."]}, {name: "owningProfileFaction",isMut: !1,isSigner: !1,docs: ["The faction that the profile belongs to."]}, {name: "fleet",isMut: !0,isSigner: !1,docs: ["The fleet."]}]}, {name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}]}, {name: "gameState",isMut: !1,isSigner: !1,docs: ["The [`GameState`] account"]}]}, {name: "fleetFuelTokenAccount",isMut: !1,isSigner: !1,docs: ["The fleet fuel token account - owned by the `fuel_tank`"]}, {name: "starbaseAndStarbasePlayer",accounts: [{name: "starbase",isMut: !1,isSigner: !1,docs: ["The [`Starbase`] account"]}, {name: "starbasePlayer",isMut: !1,isSigner: !1,docs: ["The [`StarbasePlayer`] Account"]}]}, {name: "mineItem",isMut: !1,isSigner: !1,docs: ["The [`MineItem`] account"]}, {name: "resource",isMut: !0,isSigner: !1,docs: ["The [`Resource`] account"]}, {name: "planet",isMut: !0,isSigner: !1,docs: ["The [`Planet`] account"]}],args: [{name: "input",type: {defined: "KeyIndexInput"}}]}, {name: "startStarbaseUpgrade",accounts: [{name: "funder",isMut: !0,isSigner: !0,docs: ["The funder for the new crafting process"]}, {name: "starbaseAndStarbasePlayer",accounts: [{name: "starbase",isMut: !0,isSigner: !1,docs: ["The [`Starbase`] account"]}, {name: "starbasePlayer",isMut: !1,isSigner: !1,docs: ["The [`StarbasePlayer`] Account"]}]}, {name: "upgradeFacility",isMut: !0,isSigner: !1,docs: ["The `CraftingFacility` account for starbase upgrades"]}, {name: "upgradeRecipe",isMut: !1,isSigner: !1,docs: ["The crafting recipe for the starbase upgrade"]}, {name: "gameAccountsAndProfile",accounts: [{name: "gameAndProfileAndFaction",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key authorized for this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The [`Profile`] account"]}, {name: "profileFaction",isMut: !1,isSigner: !1,docs: ["The faction that the profile belongs to."]}, {name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}]}, {name: "gameState",isMut: !1,isSigner: !1,docs: ["The [`GameState`] account"]}]}, {name: "systemProgram",isMut: !1,isSigner: !1,docs: ["Solana System program"]}],args: [{name: "input",type: {defined: "KeyIndexInput"}}]}, {name: "startSubwarp",accounts: [{name: "gameAccountsFleetAndOwner",accounts: [{name: "gameFleetAndOwner",accounts: [{name: "fleetAndOwner",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key on the profile."]}, {name: "owningProfile",isMut: !1,isSigner: !1,docs: ["The profile that owns the fleet."]}, {name: "owningProfileFaction",isMut: !1,isSigner: !1,docs: ["The faction that the profile belongs to."]}, {name: "fleet",isMut: !0,isSigner: !1,docs: ["The fleet."]}]}, {name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}]}, {name: "gameState",isMut: !1,isSigner: !1,docs: ["The [`GameState`] account"]}]}],args: [{name: "input",type: {defined: "StartSubwarpInput"}}]}, {name: "stopCraftingProcess",accounts: [{name: "starbaseAndStarbasePlayer",accounts: [{name: "starbase",isMut: !1,isSigner: !1,docs: ["The [`Starbase`] account"]}, {name: "starbasePlayer",isMut: !1,isSigner: !1,docs: ["The [`StarbasePlayer`] Account"]}]}, {name: "craftingInstance",isMut: !1,isSigner: !1,docs: ["The [`CraftingInstance`] account"]}, {name: "craftingProcess",isMut: !0,isSigner: !1,docs: ["The [`CraftingProcess`] account"]}, {name: "craftingRecipe",isMut: !0,isSigner: !1,docs: ["The crafting [`Recipe`]"]}, {name: "craftingFacility",isMut: !1,isSigner: !1,docs: ["The `CraftingFacility` account"]}, {name: "gameAccountsAndProfile",accounts: [{name: "gameAndProfileAndFaction",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key authorized for this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The [`Profile`] account"]}, {name: "profileFaction",isMut: !1,isSigner: !1,docs: ["The faction that the profile belongs to."]}, {name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}]}, {name: "gameState",isMut: !1,isSigner: !1,docs: ["The [`GameState`] account"]}]}, {name: "craftingProgram",isMut: !1,isSigner: !1,docs: ["The Crafting Program"]}],args: [{name: "input",type: {defined: "KeyIndexInput"}}]}, {name: "stopMiningAsteroid",accounts: [{name: "gameAccountsFleetAndOwner",accounts: [{name: "gameFleetAndOwner",accounts: [{name: "fleetAndOwner",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key on the profile."]}, {name: "owningProfile",isMut: !1,isSigner: !1,docs: ["The profile that owns the fleet."]}, {name: "owningProfileFaction",isMut: !1,isSigner: !1,docs: ["The faction that the profile belongs to."]}, {name: "fleet",isMut: !0,isSigner: !1,docs: ["The fleet."]}]}, {name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}]}, {name: "gameState",isMut: !1,isSigner: !1,docs: ["The [`GameState`] account"]}]}, {name: "mineItem",isMut: !1,isSigner: !1,docs: ["The [`MineItem`] account"]}, {name: "resource",isMut: !0,isSigner: !1,docs: ["The [`Resource`] account"]}, {name: "planet",isMut: !0,isSigner: !1,docs: ["The [`Planet`] account"]}, {name: "fuelTank",isMut: !0,isSigner: !1,docs: ["The fuel tank cargo pod"]}, {name: "cargoType",isMut: !1,isSigner: !1,docs: ["The cargo type account for fuel"]}, {name: "cargoStatsDefinition",isMut: !1,isSigner: !1,docs: ["The cargo stats definition account"]}, {name: "tokenFrom",isMut: !0,isSigner: !1,docs: ["The source token account - owned by the `fuel_tank`"]}, {name: "tokenMint",isMut: !0,isSigner: !1,docs: ["The mint of the token account"]}, {name: "pilotXpAccounts",accounts: [{name: "userPointsAccount",isMut: !0,isSigner: !1,docs: ["The User Points Account"]}, {name: "pointsCategory",isMut: !1,isSigner: !1,docs: ["The Points Category Account"]}, {name: "pointsModifierAccount",isMut: !1,isSigner: !1,docs: ["The Points Modifier Account"]}]}, {name: "miningXpAccounts",accounts: [{name: "userPointsAccount",isMut: !0,isSigner: !1,docs: ["The User Points Account"]}, {name: "pointsCategory",isMut: !1,isSigner: !1,docs: ["The Points Category Account"]}, {name: "pointsModifierAccount",isMut: !1,isSigner: !1,docs: ["The Points Modifier Account"]}]}, {name: "councilRankXpAccounts",accounts: [{name: "userPointsAccount",isMut: !0,isSigner: !1,docs: ["The User Points Account"]}, {name: "pointsCategory",isMut: !1,isSigner: !1,docs: ["The Points Category Account"]}, {name: "pointsModifierAccount",isMut: !1,isSigner: !1,docs: ["The Points Modifier Account"]}]}, {name: "progressionConfig",isMut: !1,isSigner: !1,docs: ["The [`ProgressionConfig`] account"]}, {name: "pointsProgram",isMut: !1,isSigner: !1,docs: ["The points program"]}, {name: "cargoProgram",isMut: !1,isSigner: !1,docs: ["The Cargo Program"]}, {name: "tokenProgram",isMut: !1,isSigner: !1,docs: ["Token Program"]}],args: [{name: "input",type: {defined: "StopMiningAsteroidInput"}}]}, {name: "stopSubwarp",accounts: [{name: "gameAccountsFleetAndOwner",accounts: [{name: "gameFleetAndOwner",accounts: [{name: "fleetAndOwner",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key on the profile."]}, {name: "owningProfile",isMut: !1,isSigner: !1,docs: ["The profile that owns the fleet."]}, {name: "owningProfileFaction",isMut: !1,isSigner: !1,docs: ["The faction that the profile belongs to."]}, {name: "fleet",isMut: !0,isSigner: !1,docs: ["The fleet."]}]}, {name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}]}, {name: "gameState",isMut: !1,isSigner: !1,docs: ["The [`GameState`] account"]}]}],args: [{name: "input",type: {defined: "StopSubwarpInput"}}]}, {name: "submitStarbaseUpgradeResource",accounts: [{name: "fundsTo",isMut: !0,isSigner: !1,docs: ["The funds_to - receives rent refund"]}, {name: "starbaseAndStarbasePlayer",accounts: [{name: "starbase",isMut: !0,isSigner: !1,docs: ["The [`Starbase`] account"]}, {name: "starbasePlayer",isMut: !1,isSigner: !1,docs: ["The [`StarbasePlayer`] Account"]}]}, {name: "resourceCraftingInstance",isMut: !1,isSigner: !1,docs: ["The [`CraftingInstance`] account"]}, {name: "resourceCraftingProcess",isMut: !0,isSigner: !1,docs: ["The crafting process account"]}, {name: "resourceCraftingFacility",isMut: !1,isSigner: !1,docs: ["The crafting facility account"]}, {name: "upgradeProcessRecipe",isMut: !1,isSigner: !1,docs: ["The crafting recipe for the submission of resources used in the upgrade process"]}, {name: "starbaseUpgradeRecipe",isMut: !1,isSigner: !1,docs: ["The crafting recipe for the starbase upgrade"]}, {name: "resourceRecipe",isMut: !1,isSigner: !1,docs: ["The crafting recipe for the resource being submitted", "i.e. the recipe for crafting the resource whose mint would be `token_mint`"]}, {name: "cargoPodTo",isMut: !0,isSigner: !1,docs: ["The destination cargo pod account"]}, {name: "cargoType",isMut: !1,isSigner: !1,docs: ["The Cargo Type Account"]}, {name: "cargoStatsDefinition",isMut: !1,isSigner: !1,docs: ["The cargo stats definition account"]}, {name: "tokenFrom",isMut: !0,isSigner: !1,docs: ["The source account of the tokens - owner should be `crafting_process`"]}, {name: "tokenTo",isMut: !0,isSigner: !1,docs: ["The destination account of the tokens - owner should be `cargo_pod_to` (receives any refunds)"]}, {name: "tokenMint",isMut: !0,isSigner: !1,docs: ["The token mint"]}, {name: "gameAccountsAndProfile",accounts: [{name: "gameAndProfileAndFaction",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key authorized for this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The [`Profile`] account"]}, {name: "profileFaction",isMut: !1,isSigner: !1,docs: ["The faction that the profile belongs to."]}, {name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}]}, {name: "gameState",isMut: !1,isSigner: !1,docs: ["The [`GameState`] account"]}]}, {name: "loyaltyPointsAccounts",accounts: [{name: "userPointsAccount",isMut: !0,isSigner: !1,docs: ["The User Points Account"]}, {name: "pointsCategory",isMut: !1,isSigner: !1,docs: ["The Points Category Account"]}, {name: "pointsModifierAccount",isMut: !1,isSigner: !1,docs: ["The Points Modifier Account"]}]}, {name: "progressionConfig",isMut: !1,isSigner: !1,docs: ["The [`ProgressionConfig`] account"]}, {name: "pointsProgram",isMut: !1,isSigner: !1,docs: ["The points program"]}, {name: "craftingProgram",isMut: !1,isSigner: !1,docs: ["The Crafting Program"]}, {name: "cargoProgram",isMut: !1,isSigner: !1,docs: ["The Cargo Program"]}, {name: "tokenProgram",isMut: !1,isSigner: !1,docs: ["The [Token] program"]}],args: [{name: "input",type: {defined: "SubmitStarbaseUpgradeResourceInput"}}]}, {name: "syncStarbasePlayer",accounts: [{name: "starbaseAndStarbasePlayer",accounts: [{name: "starbase",isMut: !1,isSigner: !1,docs: ["The [`Starbase`] account"]}, {name: "starbasePlayer",isMut: !0,isSigner: !1,docs: ["The [`StarbasePlayer`] Account"]}]}, {name: "gameAccounts",accounts: [{name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}, {name: "gameState",isMut: !1,isSigner: !1,docs: ["The [`GameState`] account"]}]}],args: []}, {name: "syncStarbaseUpgradeIngredients",accounts: [{name: "funder",isMut: !0,isSigner: !0,docs: ["The funder for the new crafting process"]}, {name: "starbase",isMut: !0,isSigner: !1,docs: ["The [`Starbase`] account"]}, {name: "upgradeRecipe",isMut: !1,isSigner: !1,docs: ["The crafting recipe for the starbase upgrade"]}, {name: "gameAccountsAndProfile",accounts: [{name: "gameAndProfile",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key authorized for this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The [`Profile`] account"]}, {name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}]}, {name: "gameState",isMut: !1,isSigner: !1,docs: ["The [`GameState`] account"]}]}, {name: "systemProgram",isMut: !1,isSigner: !1,docs: ["Solana System program"]}],args: [{name: "input",type: {defined: "KeyIndexInput"}}]}, {name: "transferCargoAtStarbase",accounts: [{name: "fundsTo",isMut: !0,isSigner: !1,docs: ["The funds_to - receives rent refund"]}, {name: "starbaseAndStarbasePlayer",accounts: [{name: "starbase",isMut: !1,isSigner: !1,docs: ["The [`Starbase`] account"]}, {name: "starbasePlayer",isMut: !1,isSigner: !1,docs: ["The [`StarbasePlayer`] Account"]}]}, {name: "cargoPodFrom",isMut: !0,isSigner: !1,docs: ["The origin cargo pod"]}, {name: "cargoPodTo",isMut: !0,isSigner: !1,docs: ["The destination cargo pod"]}, {name: "cargoType",isMut: !1,isSigner: !1,docs: ["The cargo type account"]}, {name: "cargoStatsDefinition",isMut: !1,isSigner: !1,docs: ["The cargo stats definition account"]}, {name: "gameAccountsAndProfile",accounts: [{name: "gameAndProfileAndFaction",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key authorized for this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The [`Profile`] account"]}, {name: "profileFaction",isMut: !1,isSigner: !1,docs: ["The faction that the profile belongs to."]}, {name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}]}, {name: "gameState",isMut: !1,isSigner: !1,docs: ["The [`GameState`] account"]}]}, {name: "tokenFrom",isMut: !0,isSigner: !1,docs: ["The source token account - owned by the `cargo_pod_from`"]}, {name: "tokenTo",isMut: !0,isSigner: !1,docs: ["The destination token account - owned by the `cargo_pod_to`"]}, {name: "tokenMint",isMut: !0,isSigner: !1,docs: ["The mint of the token accounts"]}, {name: "cargoProgram",isMut: !1,isSigner: !1,docs: ["The Cargo Program"]}, {name: "tokenProgram",isMut: !1,isSigner: !1,docs: ["Token Program"]}],args: [{name: "input",type: {defined: "StarbaseTransferCargoInput"}}]}, {name: "transferCargoWithinFleet",accounts: [{name: "gameAccountsFleetAndOwner",accounts: [{name: "gameFleetAndOwner",accounts: [{name: "fleetAndOwner",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key on the profile."]}, {name: "owningProfile",isMut: !1,isSigner: !1,docs: ["The profile that owns the fleet."]}, {name: "owningProfileFaction",isMut: !1,isSigner: !1,docs: ["The faction that the profile belongs to."]}, {name: "fleet",isMut: !0,isSigner: !1,docs: ["The fleet."]}]}, {name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}]}, {name: "gameState",isMut: !1,isSigner: !1,docs: ["The [`GameState`] account"]}]}, {name: "cargoPodFrom",isMut: !0,isSigner: !1,docs: ["The origin cargo pod"]}, {name: "cargoPodTo",isMut: !0,isSigner: !1,docs: ["The destination cargo pod"]}, {name: "cargoType",isMut: !1,isSigner: !1,docs: ["The cargo type account"]}, {name: "cargoStatsDefinition",isMut: !1,isSigner: !1,docs: ["The cargo stats definition account"]}, {name: "tokenFrom",isMut: !0,isSigner: !1,docs: ["The source token account - owned by the `cargo_pod_from`"]}, {name: "tokenTo",isMut: !0,isSigner: !1,docs: ["The destination token account - owned by the `cargo_pod_to`"]}, {name: "tokenMint",isMut: !0,isSigner: !1,docs: ["The mint of the token accounts"]}, {name: "fundsTo",isMut: !0,isSigner: !1,docs: ["The funds_to - receives rent refund"]}, {name: "cargoProgram",isMut: !1,isSigner: !1,docs: ["The Cargo Program"]}, {name: "tokenProgram",isMut: !1,isSigner: !1,docs: ["Token Program"]}],args: [{name: "input",type: {defined: "TransferCargoWithinFleetInput"}}]}, {name: "updateGame",accounts: [{name: "gameAndProfile",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key authorized for this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The [`Profile`] account"]}, {name: "gameId",isMut: !0,isSigner: !1,docs: ["The [`Game`] account"]}]}],args: [{name: "input",type: {defined: "UpdateGameInput"}}]}, {name: "updateGameState",accounts: [{name: "gameAndProfile",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key authorized for this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The [`Profile`] account"]}, {name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}]}, {name: "gameState",isMut: !0,isSigner: !1,docs: ["The [`GameState`] account"]}],args: [{name: "input",type: {defined: "UpdateGameStateInput"}}]}, {name: "updateMineItem",accounts: [{name: "gameAndProfile",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key authorized for this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The [`Profile`] account"]}, {name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}]}, {name: "mineItem",isMut: !0,isSigner: !1,docs: ["The [`MineItem`] account"]}],args: [{name: "input",type: {defined: "UpdateMineItemInput"}}]}, {name: "updatePlanet",accounts: [{name: "gameAndProfile",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key authorized for this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The [`Profile`] account"]}, {name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}]}, {name: "planet",isMut: !0,isSigner: !1,docs: ["The [`Planet`] account"]}],args: [{name: "input",type: {defined: "UpdatePlanetInput"}}]}, {name: "updateProgressionConfig",accounts: [{name: "progressionConfig",isMut: !0,isSigner: !1,docs: ["The [`ProgressionConfig`] account"]}, {name: "gameAndProfile",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key authorized for this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The [`Profile`] account"]}, {name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}]}, {name: "systemProgram",isMut: !1,isSigner: !1,docs: ["The Solana System program"]}],args: [{name: "input",type: {defined: "UpdateProgressionConfigInput"}}]}, {name: "updateResource",accounts: [{name: "gameAndProfile",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key authorized for this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The [`Profile`] account"]}, {name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}]}, {name: "mineItem",isMut: !1,isSigner: !1,docs: ["The [`MineItem`] account"]}, {name: "resource",isMut: !0,isSigner: !1,docs: ["The [`Resource`] account"]}],args: [{name: "input",type: {defined: "UpdateResourceInput"}}]}, {name: "updateShip",accounts: [{name: "gameAndProfile",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key authorized for this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The [`Profile`] account"]}, {name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}]}, {name: "ship",isMut: !0,isSigner: !1,docs: ["The [`Ship`] account"]}],args: [{name: "input",type: {defined: "UpdateShipInput"}}]}, {name: "updateShipEscrow",accounts: [{name: "oldShip",isMut: !1,isSigner: !1,docs: ["The old [`Ship`] Account"]}, {name: "next",isMut: !1,isSigner: !1,docs: ["The address indicated as `next` in the `old_ship` account"]}, {name: "starbaseAndStarbasePlayer",accounts: [{name: "starbase",isMut: !1,isSigner: !1,docs: ["The [`Starbase`] account"]}, {name: "starbasePlayer",isMut: !0,isSigner: !1,docs: ["The [`StarbasePlayer`] Account"]}]}, {name: "gameAccounts",accounts: [{name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}, {name: "gameState",isMut: !1,isSigner: !1,docs: ["The [`GameState`] account"]}]}],args: [{name: "input",type: {defined: "UpdateShipEscrowInput"}}]}, {name: "updateShipInFleet",accounts: [{name: "fleet",isMut: !0,isSigner: !1,docs: ["The [`Fleet`] account"]}, {name: "fleetShips",isMut: !0,isSigner: !1,docs: ["The [`FleetShips`] account"]}, {name: "oldShip",isMut: !1,isSigner: !1,docs: ["The old [`Ship`] Account"]}, {name: "next",isMut: !1,isSigner: !1,docs: ["The address indicated as `next` in the `old_ship` account"]}, {name: "gameAccounts",accounts: [{name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}, {name: "gameState",isMut: !1,isSigner: !1,docs: ["The [`GameState`] account"]}]}],args: [{name: "input",type: {defined: "UpdateShipFleetInput"}}]}, {name: "updateStar",accounts: [{name: "gameAndProfile",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key authorized for this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The [`Profile`] account"]}, {name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}]}, {name: "star",isMut: !0,isSigner: !1,docs: ["The [`Star`] account"]}],args: [{name: "input",type: {defined: "UpdateStarInput"}}]}, {name: "updateStarbase",accounts: [{name: "gameAndProfile",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key authorized for this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The [`Profile`] account"]}, {name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}]}, {name: "funder",isMut: !0,isSigner: !0,docs: ["The funder for the new game"]}, {name: "starbase",isMut: !0,isSigner: !1,docs: ["The [`Starbase`] account"]}, {name: "systemProgram",isMut: !1,isSigner: !1,docs: ["The Solana System program"]}],args: [{name: "input",type: {defined: "UpdateStarbaseInput"}}]}, {name: "updateSurveyDataUnitTracker",accounts: [{name: "gameAndProfile",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key authorized for this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The [`Profile`] account"]}, {name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}]}, {name: "surveyDataUnitTracker",isMut: !0,isSigner: !1,docs: ["The [`SurveyDataUnitTracker`] account"]}],args: [{name: "input",type: {defined: "UpdateSurveyDataUnitTrackerInput"}}]}, {name: "warpLane",accounts: [{name: "gameAccountsFleetAndOwner",accounts: [{name: "gameFleetAndOwner",accounts: [{name: "fleetAndOwner",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key on the profile."]}, {name: "owningProfile",isMut: !1,isSigner: !1,docs: ["The profile that owns the fleet."]}, {name: "owningProfileFaction",isMut: !1,isSigner: !1,docs: ["The faction that the profile belongs to."]}, {name: "fleet",isMut: !0,isSigner: !1,docs: ["The fleet."]}]}, {name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}]}, {name: "gameState",isMut: !1,isSigner: !1,docs: ["The [`GameState`] account"]}]}, {name: "fromStarbase",isMut: !1,isSigner: !1,docs: ["The [`Starbase`] account"]}, {name: "toStarbase",isMut: !1,isSigner: !1,docs: ["The [`Starbase`] account"]}, {name: "fromSector",isMut: !1,isSigner: !1,docs: ["The Sector account representing the fleet`s current sector"]}, {name: "toSector",isMut: !1,isSigner: !1,docs: ["The Sector account that `Fleet` will move to"]}, {name: "fuelTank",isMut: !0,isSigner: !1,docs: ["The fuel tank cargo pod"]}, {name: "cargoType",isMut: !1,isSigner: !1,docs: ["The `Cargo Type` Account"]}, {name: "statsDefinition",isMut: !1,isSigner: !1,docs: ["The `CargoStatsDefinition` for the cargo type"]}, {name: "fuelTokenFrom",isMut: !0,isSigner: !1,docs: ["The fuel source token account - owned by the `fuel_tank`"]}, {name: "fuelMint",isMut: !0,isSigner: !1,docs: ["Token Mint - The fuel mint"]}, {name: "feeTokenFrom",isMut: !0,isSigner: !1,docs: ["The fee source token account"]}, {name: "feeTokenTo",isMut: !0,isSigner: !1,docs: ["The fee destination token account"]}, {name: "feeMint",isMut: !0,isSigner: !1,docs: ["Fee Token Mint"]}, {name: "cargoProgram",isMut: !1,isSigner: !1,docs: ["The Cargo Program"]}, {name: "tokenProgram",isMut: !1,isSigner: !1,docs: ["Token Program"]}],args: [{name: "input",type: {defined: "WarpLaneInput"}}]}, {name: "warpToCoordinate",accounts: [{name: "gameAccountsFleetAndOwner",accounts: [{name: "gameFleetAndOwner",accounts: [{name: "fleetAndOwner",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key on the profile."]}, {name: "owningProfile",isMut: !1,isSigner: !1,docs: ["The profile that owns the fleet."]}, {name: "owningProfileFaction",isMut: !1,isSigner: !1,docs: ["The faction that the profile belongs to."]}, {name: "fleet",isMut: !0,isSigner: !1,docs: ["The fleet."]}]}, {name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}]}, {name: "gameState",isMut: !1,isSigner: !1,docs: ["The [`GameState`] account"]}]}, {name: "fuelTank",isMut: !0,isSigner: !1,docs: ["The fuel tank cargo pod"]}, {name: "cargoType",isMut: !1,isSigner: !1,docs: ["The cargo type account for fuel"]}, {name: "statsDefinition",isMut: !1,isSigner: !1,docs: ["The cargo stats definition account"]}, {name: "tokenFrom",isMut: !0,isSigner: !1,docs: ["The source token account - owned by the `fuel_tank`"]}, {name: "tokenMint",isMut: !0,isSigner: !1,docs: ["Token Mint - The fuel mint"]}, {name: "cargoProgram",isMut: !1,isSigner: !1,docs: ["The Cargo Program"]}, {name: "tokenProgram",isMut: !1,isSigner: !1,docs: ["Token Program"]}],args: [{name: "input",type: {defined: "WarpToCoordinateInput"}}]}, {name: "withdrawCargoFromFleet",accounts: [{name: "gameAccountsFleetAndOwner",accounts: [{name: "gameFleetAndOwner",accounts: [{name: "fleetAndOwner",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key on the profile."]}, {name: "owningProfile",isMut: !1,isSigner: !1,docs: ["The profile that owns the fleet."]}, {name: "owningProfileFaction",isMut: !1,isSigner: !1,docs: ["The faction that the profile belongs to."]}, {name: "fleet",isMut: !0,isSigner: !1,docs: ["The fleet."]}]}, {name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}]}, {name: "gameState",isMut: !1,isSigner: !1,docs: ["The [`GameState`] account"]}]}, {name: "starbaseAndStarbasePlayer",accounts: [{name: "starbase",isMut: !1,isSigner: !1,docs: ["The [`Starbase`] account"]}, {name: "starbasePlayer",isMut: !1,isSigner: !1,docs: ["The [`StarbasePlayer`] Account"]}]}, {name: "cargoPodFrom",isMut: !0,isSigner: !1,docs: ["The origin cargo pod, owned by the fleet"]}, {name: "cargoPodTo",isMut: !0,isSigner: !1,docs: ["The destination cargo pod, owned by the Starbase player"]}, {name: "cargoType",isMut: !1,isSigner: !1,docs: ["The cargo type account"]}, {name: "cargoStatsDefinition",isMut: !1,isSigner: !1,docs: ["The cargo stats definition account"]}, {name: "tokenFrom",isMut: !0,isSigner: !1,docs: ["The source token account - owned by the `cargo_pod_from`"]}, {name: "tokenTo",isMut: !0,isSigner: !1,docs: ["The destination token account - owned by the `cargo_pod_to`"]}, {name: "tokenMint",isMut: !0,isSigner: !1,docs: ["The mint of the token accounts"]}, {name: "fundsTo",isMut: !0,isSigner: !1,docs: ["The funds_to - receives rent refund"]}, {name: "cargoProgram",isMut: !1,isSigner: !1,docs: ["The Cargo Program"]}, {name: "tokenProgram",isMut: !1,isSigner: !1,docs: ["Token Program"]}],args: [{name: "input",type: {defined: "WithdrawCargoFromFleetInput"}}]}, {name: "withdrawCargoFromGame",accounts: [{name: "fundsTo",isMut: !0,isSigner: !1,docs: ["The funds_to - receives rent refund"]}, {name: "starbaseAndStarbasePlayer",accounts: [{name: "starbase",isMut: !1,isSigner: !1,docs: ["The [`Starbase`] account"]}, {name: "starbasePlayer",isMut: !1,isSigner: !1,docs: ["The [`StarbasePlayer`] Account"]}]}, {name: "gameAccountsAndProfile",accounts: [{name: "gameAndProfileAndFaction",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key authorized for this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The [`Profile`] account"]}, {name: "profileFaction",isMut: !1,isSigner: !1,docs: ["The faction that the profile belongs to."]}, {name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}]}, {name: "gameState",isMut: !1,isSigner: !1,docs: ["The [`GameState`] account"]}]}, {name: "cargoPod",isMut: !0,isSigner: !1,docs: ["The new cargo pod"]}, {name: "cargoType",isMut: !1,isSigner: !1,docs: ["The cargo type account"]}, {name: "cargoStatsDefinition",isMut: !1,isSigner: !1,docs: ["The cargo stats definition account"]}, {name: "tokenFrom",isMut: !0,isSigner: !1,docs: ["The source token account - owned by the `cargo_pod`"]}, {name: "tokenTo",isMut: !0,isSigner: !1,docs: ["The destination token account - owned by the `key`"]}, {name: "tokenMint",isMut: !0,isSigner: !1,docs: ["The mint of the token accounts"]}, {name: "cargoProgram",isMut: !1,isSigner: !1,docs: ["The Cargo Program"]}, {name: "tokenProgram",isMut: !1,isSigner: !1,docs: ["Token Program"]}],args: [{name: "input",type: {defined: "CargoToGameInput"}}]}, {name: "withdrawCraftingIngredient",accounts: [{name: "starbaseAndStarbasePlayer",accounts: [{name: "starbase",isMut: !1,isSigner: !1,docs: ["The [`Starbase`] account"]}, {name: "starbasePlayer",isMut: !1,isSigner: !1,docs: ["The [`StarbasePlayer`] Account"]}]}, {name: "craftingInstance",isMut: !1,isSigner: !1,docs: ["The [`CraftingInstance`] account"]}, {name: "craftingFacility",isMut: !1,isSigner: !1,docs: ["The [`CraftingFacility`](crafting::CraftingFacility) account"]}, {name: "craftingProcess",isMut: !0,isSigner: !1,docs: ["The crafting process account"]}, {name: "cargoPodTo",isMut: !0,isSigner: !1,docs: ["The destination cargo pod account"]}, {name: "craftingRecipe",isMut: !1,isSigner: !1,docs: ["The crafting recipe"]}, {name: "cargoType",isMut: !1,isSigner: !1,docs: ["The Cargo Type Account"]}, {name: "cargoStatsDefinition",isMut: !1,isSigner: !1,docs: ["The cargo stats definition account"]}, {name: "gameAccountsAndProfile",accounts: [{name: "gameAndProfileAndFaction",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key authorized for this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The [`Profile`] account"]}, {name: "profileFaction",isMut: !1,isSigner: !1,docs: ["The faction that the profile belongs to."]}, {name: "gameId",isMut: !1,isSigner: !1,docs: ["The [`Game`] account"]}]}, {name: "gameState",isMut: !1,isSigner: !1,docs: ["The [`GameState`] account"]}]}, {name: "tokenFrom",isMut: !0,isSigner: !1,docs: ["The source account of the tokens - owner should be `crafting_process`"]}, {name: "tokenTo",isMut: !0,isSigner: !1,docs: ["The destination account of the tokens - owner should be `cargo_pod_to`"]}, {name: "tokenMint",isMut: !0,isSigner: !1,docs: ["The token mint"]}, {name: "craftingProgram",isMut: !1,isSigner: !1,docs: ["The Crafting Program"]}, {name: "cargoProgram",isMut: !1,isSigner: !1,docs: ["The Cargo Program"]}, {name: "tokenProgram",isMut: !1,isSigner: !1,docs: ["The [Token] program"]}],args: [{name: "input",type: {defined: "StarbaseWithdrawCraftingIngredientInput"}}]}],accounts: [{name: "craftingInstance",docs: ["This account is used to store relevant information for a crafting process instance"],type: {kind: "struct",fields: [{name: "version",docs: ["The data version of this account"],type: "u8"}, {name: "seqId",docs: ["The sequence id for the `Starbase`"],type: "u16"}, {name: "authority",docs: ["The authority over the `CraftingInstance`"],type: "publicKey"}, {name: "craftingProcess",docs: ["The `CraftingProcess` account address"],type: "publicKey"}, {name: "instanceType",docs: ["the planet type"],type: "u8"}, {name: "numCrew",docs: ["The number of crew taking part in the crafting process"],type: "u64"}, {name: "bump",docs: ["Bump of Account PDA"],type: "u8"}]}}, {name: "disbandedFleet",docs: ["Keeps track of a fleet while it is disbanded"],type: {kind: "struct",fields: [{name: "version",docs: ["The data version of this account."],type: "u8"}, {name: "gameId",docs: ["The game id this belongs to."],type: "publicKey"}, {name: "ownerProfile",docs: ["The owner's profile."],type: "publicKey"}, {name: "starbase",docs: ["The `Starbase` at which the original `Fleet` was disbanded."],type: "publicKey"}, {name: "fleetLabel",docs: ["The label or name of the disbanded fleet."],type: {array: ["u8", 32]}}, {name: "fleetShips",docs: ["The `FleetShips` account belonging to the original `Fleet` that was disbanded."],type: "publicKey"}, {name: "bump",docs: ["The disbanded fleet's bump."],type: "u8"}]}}, {name: "fleet",docs: ["A `SAGE` fleet."],type: {kind: "struct",fields: [{name: "version",docs: ["The data version of this account."],type: "u8"}, {name: "gameId",docs: ["The game id this belongs to."],type: "publicKey"}, {name: "ownerProfile",docs: ["The owner's profile."],type: "publicKey"}, {name: "fleetShips",docs: ["Fleet Ships Key"],type: "publicKey"}, {name: "subProfile",docs: ["The fleet's sub-authority.", "If [`Some`] will have the exclusive ability to interact with this fleet."],type: {defined: "OptionalNonSystemPubkey"}}, {name: "subProfileInvalidator",docs: ["The authority for revoking a sun-authority."],type: "publicKey"}, {name: "faction",docs: ["The faction of the profile."],type: "u8"}, {name: "fleetLabel",docs: ["The label or name of the fleet."],type: {array: ["u8", 32]}}, {name: "shipCounts",docs: ["The number of ships in the fleet."],type: {defined: "ShipCounts"}}, {name: "warpCooldownExpiresAt",docs: ["The time at which the warp cooldown expires"],type: "i64"}, {name: "scanCooldownExpiresAt",docs: ["The time at which the scan cooldown expires"],type: "i64"}, {name: "stats",docs: ["The fleet's stats."],type: {defined: "ShipStats"}}, {name: "cargoHold",docs: ["The Cargo pod representing the fleet's cargo hold"],type: "publicKey"}, {name: "fuelTank",docs: ["The Cargo pod representing the fleet's fuel tank"],type: "publicKey"}, {name: "ammoBank",docs: ["The Cargo pod representing the fleet's ammo bank"],type: "publicKey"}, {name: "updateId",docs: ["The update id for the `Fleet`"],type: "u64"}, {name: "bump",docs: ["The fleet's bump."],type: "u8"}]}}, {name: "fleetShips",docs: ["Keeps track of a the individual ships that make up a fleet"],type: {kind: "struct",fields: [{name: "version",docs: ["The data version of this account."],type: "u8"}, {name: "fleet",docs: ["The `Fleet` account this belongs to"],type: "publicKey"}, {name: "fleetShipsInfoCount",docs: ["List length of `RemainingData`"],type: "u32"}, {name: "bump",docs: ["The disbanded fleet's bump."],type: "u8"}]}}, {name: "game",docs: ["Global Game Configuration variables"],type: {kind: "struct",fields: [{name: "version",docs: ["The data version of this account."],type: "u8"}, {name: "updateId",docs: ["The sequence id for updates."],type: "u64"}, {name: "profile",docs: ["The [`Profile`](player_profile::state::Profile) that handles the sector program permissions"],type: "publicKey"}, {name: "gameState",docs: ["The associated `GameState` account."],type: "publicKey"}, {name: "points",docs: ["Points setting"],type: {defined: "Points"}}, {name: "cargo",docs: ["Cargo settings"],type: {defined: "Cargo"}}, {name: "crafting",docs: ["Crafting settings"],type: {defined: "Crafting"}}, {name: "mints",docs: ["mint related settings"],type: {defined: "Mints"}}, {name: "vaults",docs: ["vault related settings"],type: {defined: "Vaults"}}, {name: "riskZones",docs: ["Data for risk zones"],type: {defined: "RiskZonesData"}}]}}, {name: "gameState",docs: ["Keeps track of variables that may change frequently during a `Game` session"],type: {kind: "struct",fields: [{name: "version",docs: ["The data version of this account"],type: "u8"}, {name: "updateId",docs: ["The sequence id for updates"],type: "u64"}, {name: "gameId",docs: ["The `Game` that this belongs to"],type: "publicKey"}, {name: "fleet",docs: ["Fleet settings"],type: {defined: "FleetInfo"}}, {name: "misc",docs: ["Miscellaneous settings"],type: {defined: "MiscVariables"}}, {name: "bump",docs: ["PDA bump"],type: "u8"}]}}, {name: "mineItem",docs: ["Represents a token registered as an item that can be mined"],type: {kind: "struct",fields: [{name: "version",docs: ["The data version of this account."],type: "u8"}, {name: "gameId",docs: ["the game_id account this item is registered with"],type: "publicKey"}, {name: "name",docs: ["The name of the `MineItem`"],type: {array: ["u8", 64]}}, {name: "mint",docs: ["the mint representing the items mined"],type: "publicKey"}, {name: "resourceHardness",docs: ["How hard it is to mine this item -> Ranges from 1-10"],type: "u16"}, {name: "numResourceAccounts",docs: ["The number of resource accounts for this mine item"],type: "u64"}, {name: "bump",docs: ["bump for PDA"],type: "u8"}]}}, {name: "planet",docs: ["Planet"],type: {kind: "struct",fields: [{name: "version",docs: ["The data version of this account."],type: "u8"}, {name: "name",docs: ["The name of this `Planet`"],type: {array: ["u8", 64]}}, {name: "gameId",docs: ["the `Game` that this belongs to"],type: "publicKey"}, {name: "sector",docs: ["the sector that this belongs to"],type: {array: ["i64", 2]}}, {name: "subCoordinates",docs: ["sub_coordinates as [x, y]"],type: {array: ["i64", 2]}}, {name: "planetType",docs: ["the planet type"],type: "u8"}, {name: "position",docs: ["the planet position"],type: "u8"}, {name: "size",docs: ["size"],type: "u64"}, {name: "maxHp",docs: ["maximum health"],type: "u64"}, {name: "currentHealth",docs: ["The current health of the `Planet`."],type: "u64"}, {name: "amountMined",docs: ["the cumulative amount mined from this `Asteroid`"],type: "u64"}, {name: "numResources",docs: ["the number of resources at this `Asteroid`"],type: "u8"}, {name: "numMiners",docs: ["the number of entities currently mining at this `Asteroid`"],type: "u64"}]}}, {name: "progressionConfig",docs: ["Progression Config"],type: {kind: "struct",fields: [{name: "version",docs: ["the data version of this account."],type: "u8"}, {name: "gameId",docs: ["the `Game` that this belongs to"],type: "publicKey"}, {name: "dailyLpLimit",docs: ["the daily limit for Loyalty Points (LP)"],type: "u64"}, {name: "dailyCouncilRankXpLimit",docs: ["the daily limit for Council Rank Experience Points (CRXP)"],type: "u64"}, {name: "dailyPilotXpLimit",docs: ["the daily limit for Pilot License Experience Points (PXP)"],type: "u64"}, {name: "dailyDataRunningXpLimit",docs: ["the daily limit for Data Running Experience Points (DRXP)"],type: "u64"}, {name: "dailyMiningXpLimit",docs: ["the daily limit for Mining Experience Points (MXP)"],type: "u64"}, {name: "dailyCraftingXpLimit",docs: ["the daily limit for Crafting Experience Points (CXP)"],type: "u64"}, {name: "numItems",docs: ["number of progression items being tracked"],type: "u16"}]}}, {name: "resource",docs: ["Represents a mine-able item existing at a particular location (e.g. a planet)"],type: {kind: "struct",fields: [{name: "version",docs: ["The data version of this account."],type: "u8"}, {name: "gameId",docs: ["the game_id pubkey"],type: "publicKey"}, {name: "location",docs: ["the location's pubkey"],type: "publicKey"}, {name: "mineItem",docs: ["the mine item pubkey"],type: "publicKey"}, {name: "locationType",docs: ["the location type"],type: "u8"}, {name: "systemRichness",docs: ["How abundant the resource is at the location -> Ranges from 1-5"],type: "u16"}, {name: "amountMined",docs: ["the cumulative amount mined from this resource"],type: "u64"}, {name: "numMiners",docs: ["the number of entities currently mining this resource"],type: "u64"}, {name: "bump",docs: ["bump for PDA"],type: "u8"}]}}, {name: "sagePlayerProfile",docs: ["A `SAGE` player's profile."],type: {kind: "struct",fields: [{name: "version",docs: ["The data version of this account"],type: "u8"}, {name: "playerProfile",docs: ["The `Profile` key"],type: "publicKey"}, {name: "gameId",docs: ["The id of the `Game`"],type: "publicKey"}, {name: "bump",docs: ["Bump of Account PDA"],type: "u8"}]}}, {name: "sector",docs: ["Sector"],type: {kind: "struct",fields: [{name: "version",docs: ["The data version of this account."],type: "u8"}, {name: "gameId",docs: ["the game_id that this belongs to"],type: "publicKey"}, {name: "coordinates",docs: ["coordinates as [x, y]"],type: {array: ["i64", 2]}}, {name: "discoverer",docs: ["The discoverer of this sector"],type: "publicKey"}, {name: "name",docs: ["The name of this sector"],type: {array: ["u8", 64]}}, {name: "numStars",docs: ["the number of stars in this system"],type: "u16"}, {name: "numPlanets",docs: ["the number of planets in this system"],type: "u16"}, {name: "numMoons",docs: ["the number of moons in this system"],type: "u16"}, {name: "numAsteroidBelts",docs: ["the number of num_asteroid belts in this system"],type: "u16"}, {name: "lastScanTime",docs: ["The last time the `Sector` was scanned"],type: "i64"}, {name: "lastScanChance",docs: ["The probability of finding SDUs in the `Sector` from the last time it was scanned"],type: "u32"}, {name: "bump",docs: ["PDA bump"],type: "u8"}, {name: "numConnections",docs: ["the number of connections in this system"],type: "u16"}]}}, {name: "ship",docs: ["This account represents a Ship"],type: {kind: "struct",fields: [{name: "version",docs: ["The data version of this account."],type: "u8"}, {name: "gameId",docs: ["the game_id account this Ship is registered with"],type: "publicKey"}, {name: "mint",docs: ["the mint representing the Ship"],type: "publicKey"}, {name: "name",docs: ["The name of this `Ship`"],type: {array: ["u8", 64]}}, {name: "sizeClass",docs: ["the ship's size class"],type: "u8"}, {name: "stats",docs: ["The ship's stats"],type: {defined: "ShipStats"}}, {name: "updateId",docs: ["The `update_id` for the `Ship`"],type: "u64"}, {name: "maxUpdateId",docs: ["The max `Game` `update_id` that the `Ship` is valid for"],type: "u64"}, {name: "next",docs: ["the next `Ship` account to use when this `Ship` is updated"],type: {defined: "OptionalNonSystemPubkey"}}]}}, {name: "star",docs: ["`Star` account"],type: {kind: "struct",fields: [{name: "version",docs: ["The data version of this account."],type: "u8"}, {name: "name",docs: ["The name of this `Star`"],type: {array: ["u8", 64]}}, {name: "gameId",docs: ["the game_id that this belongs to"],type: "publicKey"}, {name: "sector",docs: ["the sector that this belongs to"],type: {array: ["i64", 2]}}, {name: "size",docs: ["size"],type: "u64"}, {name: "subCoordinates",docs: ["sub_coordinates as [x, y]"],type: {array: ["i64", 2]}}, {name: "starType",docs: ["the star type"],type: "u8"}]}}, {name: "starbase",docs: ["Starbase"],type: {kind: "struct",fields: [{name: "version",docs: ["The data version of this `Starbase` account."],type: "u8"}, {name: "gameId",docs: ["the game_id that this `Starbase` belongs to"],type: "publicKey"}, {name: "sector",docs: ["the sector that this `Starbase` belongs to"],type: {array: ["i64", 2]}}, {name: "craftingFacility",docs: ["the [`CraftingFacility`] to use for crafting at this `Starbase`"],type: "publicKey"}, {name: "upgradeFacility",docs: ["the [`CraftingFacility`] to use for upgrade jobs at this `Starbase`"],type: "publicKey"}, {name: "name",docs: ["The name of this `Starbase`"],type: {array: ["u8", 64]}}, {name: "subCoordinates",docs: ["coordinates as [x, y]"],type: {array: ["i64", 2]}}, {name: "faction",docs: ["The faction of the `Starbase`."],type: "u8"}, {name: "bump",docs: ["bump for PDA"],type: "u8"}, {name: "seqId",docs: ["The sequence id for the `Starbase`"],type: "u16"}, {name: "state",docs: ["The state of the `Starbase`. Is a [`StarbaseState`]."],type: "u8"}, {name: "level",docs: ["The level of the `Starbase`."],type: "u8"}, {name: "hp",docs: ["The `Starbase` health points."],type: "u64"}, {name: "sp",docs: ["The `Starbase` shield points."],type: "u64"}, {name: "sectorRingAvailable",docs: ["The planet position (`sector::state::Ring`) available for this `Starbase`"],type: "u8"}, {name: "upgradeState",docs: ["The `Starbase` upgrade state"],type: "u8"}, {name: "upgradeIngredientsChecksum",docs: ["used to check if expected upgrade ingredients have been supplied"],type: {array: ["u8", 16]}}, {name: "numUpgradeIngredients",docs: ["number of ingredients needed for starbase upgrade"],type: "u8"}, {name: "upkeepAmmoBalance",docs: ["The balance of ammo for upkeep"],type: "u64"}, {name: "upkeepAmmoLastUpdate",docs: ["The last time ammo for upkeep was updated (Local time)"],type: "i64"}, {name: "upkeepAmmoGlobalLastUpdate",docs: ["The last time ammo for upkeep was updated (Global time)"],type: "i64"}, {name: "upkeepFoodBalance",docs: ["The balance of food for upkeep"],type: "u64"}, {name: "upkeepFoodLastUpdate",docs: ["The last time food for upkeep was updated (Local time)"],type: "i64"}, {name: "upkeepFoodGlobalLastUpdate",docs: ["The last time food for upkeep was updated (Global time)"],type: "i64"}, {name: "upkeepToolkitBalance",docs: ["The balance of toolkits for upkeep"],type: "u64"}, {name: "upkeepToolkitLastUpdate",docs: ["The last time toolkits for upkeep was updated (Local time)"],type: "i64"}, {name: "upkeepToolkitGlobalLastUpdate",docs: ["The last time toolkits for upkeep was updated (Global time)"],type: "i64"}, {name: "builtDestroyedTimestamp",docs: ["The last time the starbase was built or destroyed"],type: "i64"}]}}, {name: "starbasePlayer",docs: ["The `SAGE` player info within a `Starbase`"],type: {kind: "struct",fields: [{name: "version",docs: ["The data version of this account"],type: "u8"}, {name: "playerProfile",docs: ["The `Profile` key"],type: "publicKey"}, {name: "gameId",docs: ["The id of the `Game`"],type: "publicKey"}, {name: "starbase",docs: ["The `Starbase` key"],type: "publicKey"}, {name: "sagePlayerProfile",docs: ["The `SagePlayerProfile` key"],type: "publicKey"}, {name: "bump",docs: ["Bump of Account PDA"],type: "u8"}, {name: "shipEscrowCount",docs: ["List length of `RemainingData`"],type: "u32"}, {name: "totalCrew",docs: ["The total crew members from the player's fleets at the `Starbase`"],type: "u64"}, {name: "busyCrew",docs: ["The number of crew members that is engaged/busy and not available"],type: "u64"}, {name: "updateId",docs: ["The `Game` update id"],type: "u64"}, {name: "updatedShipEscrowCount",docs: ["Number of updated items in `RemainingData` list", "This will be `ship_escrow_count` when all ships in escrow are up-to-date"],type: "u32"}]}}, {name: "surveyDataUnitTracker",docs: ["Survey Data Unit (SDU) Tracker"],type: {kind: "struct",fields: [{name: "version",docs: ["The data version of this account."],type: "u8"}, {name: "gameId",docs: ["The game_id that this belongs to"],type: "publicKey"}, {name: "sduMint",docs: ["The Survey Data Unit Mint"],type: "publicKey"}, {name: "resourceMint",docs: ["The mint of the resource spent when scanning for SDUs"],type: "publicKey"}, {name: "signer",docs: ["The signer for this account"],type: "publicKey"}, {name: "signerBump",docs: ["The signer for this account"],type: "u8"}, {name: "coordinatesRange",docs: ["The valid coordinates range", "e.g. a value of [-50, 50] means that coordinates from [-50, -50] to [50, 50] are valid for SDU scanning"],type: {array: ["i64", 2]}}, {name: "cssCoordinates",docs: ["The locations of the central space stations (CSS) of the three factions"],type: {array: [{array: ["i64", 2]}, 3]}}, {name: "originCoordinates",docs: ['The co-ordinates of the "origin"; used in calculating SDU probability'],type: {array: ["i64", 2]}}, {name: "cssMaxDistance",docs: ["The max distance from the nearest CSS; used in calculating SDU probability"],type: "u32"}, {name: "originMaxDistance",docs: ["The max distance from the `origin_coordinates`; used in calculating SDU probability"],type: "u32"}, {name: "distanceWeighting",docs: ["The distance weighting; used in calculating SDU probability"],type: "u32"}, {name: "tMax",docs: ["The maximum time before SDU probability at a location changes"],type: "i64"}, {name: "xMul",docs: ["Multiplier in the X dimension; used in noise function"],type: "u32"}, {name: "yMul",docs: ["Multiplier in the Y dimension; used in noise function"],type: "u32"}, {name: "zMul",docs: ["Multiplier in the Z dimension; used in noise function"],type: "u32"}, {name: "sduMaxPerSector",docs: ["The maximum number of SDUs that can be found per scan per sector"],type: "u32"}, {name: "scanChanceRegenPeriod",docs: ["The amount of time in seconds that it takes for a sector scan chance to fully regenerate"],type: "i16"}]}}],types: [{name: "AddShipEscrowInput",docs: ["Struct for data input for `AddShipEscrow`"],type: {kind: "struct",fields: [{name: "shipAmount",docs: ["Amount of `Ship` tokens to transfer to escrow"],type: "u64"}, {name: "index",docs: ["Index of `WrappedShipEscrow` in remaining data of `StarbasePlayer`", "Some index `WrappedShipEscrow`, or None for new `WrappedShipEscrow`"],type: {option: "u32"}}]}}, {name: "AddShipToFleetInput",docs: ["Struct for data input for that has `key_index`"],type: {kind: "struct",fields: [{name: "shipAmount",docs: ["Number of ships to add to the fleet"],type: "u8"}, {name: "shipEscrowIndex",docs: ["Index of `WrappedShipEscrow` in remaining data of `StarbasePlayer`"],type: "u32"}, {name: "fleetShipInfoIndex",docs: ["Index of `FleetShipsInfo` in remaining data of `FleetShips`"],type: {option: "u32"}}, {name: "keyIndex",docs: ["the index of the key in the player profile"],type: "u16"}]}}, {name: "Cargo",docs: ["Variables for the Cargo program"],type: {kind: "struct",fields: [{name: "statsDefinition",docs: ["The cargo stats definition account"],type: "publicKey"}]}}, {name: "CargoStats",docs: ["A ship's cargo stats"],type: {kind: "struct",fields: [{name: "cargoCapacity",docs: ["the capacity of the ship's cargo hold"],type: "u32"}, {name: "fuelCapacity",docs: ["the capacity of the ship's fuel tank"],type: "u32"}, {name: "ammoCapacity",docs: ["the capacity of the ship's ammo bank"],type: "u32"}, {name: "ammoConsumptionRate",docs: ["the amount of ammo consumed per second by the ship when doing non-combat activities e.g. mining"],type: "u32"}, {name: "foodConsumptionRate",docs: ["the amount of food consumed per second by the ship when doing non-combat activities e.g. mining"],type: "u32"}, {name: "miningRate",docs: ["the amount of resources that can be mined by a ship per second"],type: "u32"}, {name: "upgradeRate",docs: ["the amount of upgrade material that is consumed by a ship per second while upgrading a Starbase"],type: "u32"}, {name: "cargoTransferRate",docs: ["the amount of cargo that a ship can transfer per second to another ship outside of dock"],type: "u32"}, {name: "tractorBeamGatherRate",docs: ["the amount of cargo that the ship can gather per second using its tractor beam"],type: "u32"}]}}, {name: "CargoStatsUnpacked",docs: ["Unpacked version of [`CargoStats`]"],type: {kind: "struct",fields: [{name: "cargoCapacity",docs: ["the capacity of the ship's cargo hold"],type: "u32"}, {name: "fuelCapacity",docs: ["the capacity of the ship's fuel tank"],type: "u32"}, {name: "ammoCapacity",docs: ["the capacity of the ship's ammo bank"],type: "u32"}, {name: "ammoConsumptionRate",docs: ["the amount of ammo consumed per second by the ship when doing non-combat activities e.g. mining"],type: "u32"}, {name: "foodConsumptionRate",docs: ["the amount of food consumed per second by the ship when doing non-combat activities e.g. mining"],type: "u32"}, {name: "miningRate",docs: ["the amount of resources that can be mined by a ship per second"],type: "u32"}, {name: "upgradeRate",docs: ["the amount of upgrade material that is consumed by a ship per second while upgrading a Starbase"],type: "u32"}, {name: "cargoTransferRate",docs: ["the amount of cargo that a ship can transfer per second to another ship outside of dock"],type: "u32"}, {name: "tractorBeamGatherRate",docs: ["the amount of cargo that the ship can gather per second using its tractor beam"],type: "u32"}]}}, {name: "CargoToGameInput",docs: ["Struct for data input to `DepositCargoToGame`"],type: {kind: "struct",fields: [{name: "amount",docs: ["cargo amount"],type: "u64"}, {name: "keyIndex",docs: ["the index of the key in the player profile"],type: "u16"}]}}, {name: "CloseDisbandedFleetInput",docs: ["Struct for data input for that has `key_index`"],type: {kind: "struct",fields: [{name: "keyIndex",docs: ["the index of the key in the player profile"],type: "u16"}]}}, {name: "Crafting",docs: ["Variables for the Crafting program"],type: {kind: "struct",fields: [{name: "domain",docs: ["The crafting domain account"],type: "publicKey"}]}}, {name: "CraftingInstanceType",docs: ["Represents the type of `CraftingInstance`"],type: {kind: "enum",variants: [{name: "StarbaseCrafting"}, {name: "StarbaseUpgradeMaterial"}]}}, {name: "CreateFleetInput",docs: ["Struct for data input for that has `key_index`"],type: {kind: "struct",fields: [{name: "shipAmount",docs: ["Number of ships to add to the fleet"],type: "u8"}, {name: "fleetLabel",docs: ["the fleet label"],type: {array: ["u8", 32]}}, {name: "shipEscrowIndex",docs: ["Index of `WrappedShipEscrow` in remaining data of `StarbasePlayer`"],type: "u32"}, {name: "cargoHoldSeeds",docs: ["cargo hold seeds"],type: {array: ["u8", 32]}}, {name: "fuelTankSeeds",docs: ["fuel tank seeds"],type: {array: ["u8", 32]}}, {name: "ammoBankSeeds",docs: ["ammo bank seeds"],type: {array: ["u8", 32]}}, {name: "keyIndex",docs: ["the index of the key in the player profile"],type: "u16"}]}}, {name: "DepositCargoToFleetInput",docs: ["Struct for data input to `DepositCargoToFleet`"],type: {kind: "struct",fields: [{name: "amount",docs: ["cargo amount"],type: "u64"}, {name: "keyIndex",docs: ["the index of the key in the player profile"],type: "u16"}]}}, {name: "DepositStarbaseUpkeepResourceInput",docs: ["Submit starbase upkeep resource inputs"],type: {kind: "struct",fields: [{name: "pointsProgramPermissionsKeyIndex",docs: ["the index of the points program permissions in the player profile"],type: "u16"}, {name: "sagePermissionsKeyIndex",docs: ["the index of the key in sage permissions in the player profile"],type: "u16"}, {name: "resourceType",docs: ["the resource type"],type: "u8"}, {name: "resourceIndex",docs: ["the index of the resource represented by `token_mint` in the `resource_recipe` ingredients list"],type: "u16"}, {name: "amount",docs: ["the amount"],type: "u64"}, {name: "epochIndex",docs: ["the index of the epoch in the `RedemptionConfig` account"],type: "u16"}]}}, {name: "DeregisterSurveyDataUnitTrackerInput",docs: ["Struct for data input that has `key_index`"],type: {kind: "struct",fields: [{name: "keyIndex",docs: ["the index of the key in the sector permissions profile"],type: "u16"}]}}, {name: "DisbandFleetInput",docs: ["Struct for data input for that has `key_index`"],type: {kind: "struct",fields: [{name: "keyIndex",docs: ["the index of the key in the player profile"],type: "u16"}]}}, {name: "DisbandedFleetToEscrowInput",docs: ["Struct for data input for that has `key_index`"],type: {kind: "struct",fields: [{name: "shipAmount",docs: ["Number of ships to add to the fleet"],type: "u16"}, {name: "shipEscrowIndex",docs: ["Index of `WrappedShipEscrow` in remaining data of `StarbasePlayer`"],type: {option: "u32"}}, {name: "fleetShipInfoIndex",docs: ["Index of `FleetShipsInfo` in remaining data of `FleetShips`"],type: "u32"}, {name: "keyIndex",docs: ["the index of the key in the player profile"],type: "u16"}]}}, {name: "DiscoverSectorInput",docs: ["Struct for data input for `DiscoverSector`"],type: {kind: "struct",fields: [{name: "coordinates",docs: ["The coordinates of the new `Sector`"],type: {array: ["i64", 2]}}, {name: "keyIndex",docs: ["the index of the key in the player profile"],type: "u16"}]}}, {name: "FactionsStarbaseLevelInfo",docs: ["`Starbase` levels discriminated by faction"],type: {kind: "struct",fields: [{name: "mud",docs: ["Mud Starbase Levels Info"],type: {array: [{defined: "StarbaseLevelInfo"}, 7]}}, {name: "oni",docs: ["Oni Starbase Levels Info"],type: {array: [{defined: "StarbaseLevelInfo"}, 7]}}, {name: "ustur",docs: ["Ustur Starbase Levels Info"],type: {array: [{defined: "StarbaseLevelInfo"}, 7]}}]}}, {name: "FleetInfo",docs: ["Variables for the Fleet program"],type: {kind: "struct",fields: [{name: "starbaseLevels",docs: ["`Starbase` levels discriminated by faction"],type: {defined: "FactionsStarbaseLevelInfo"}}, {name: "upkeep",docs: ["`Starbase` upkeep discriminated by level"],type: {defined: "StarbaseUpkeepLevels"}}, {name: "maxFleetSize",docs: ["Maximum `Fleet` size allowed"],type: "u32"}]}}, {name: "FleetInput",docs: ["Struct for data input to Update fleet settings"],type: {kind: "struct",fields: [{name: "starbaseLevelInfoArray",docs: ["`Starbase` Level Info array"],type: {option: {vec: {defined: "StarbaseLevelInfoArrayInput"}}}}, {name: "upkeepInfoArray",docs: ["`Starbase` Level Info array"],type: {option: {vec: {defined: "StarbaseUpkeepInfoArrayInput"}}}}, {name: "maxFleetSize",docs: ["Maximum `Fleet` size allowed"],type: {option: "u32"}}]}}, {name: "FleetShipsInfo",docs: ["Struct that represents info on a single ship type in a fleet"],type: {kind: "struct",fields: [{name: "ship",docs: ["The `Ship` account address"],type: "publicKey"}, {name: "amount",docs: ["The `Ship` token amount in escrow"],type: "u64"}, {name: "updateId",docs: ["The update id for the `Ship`"],type: "u64"}]}}, {name: "ForcedDisbandFleetInput",docs: ["Struct for data input for that has `key_index`"],type: {kind: "struct",fields: [{name: "fleetShipInfoIndex",docs: ["Index of `FleetShipsInfo` in remaining data of `FleetShips`"],type: "u32"}]}}, {name: "Idle",docs: ["The data for the [`FleetStateData::Idle`](crate::state_machine::FleetStateData::Idle) state"],type: {kind: "struct",fields: [{name: "sector",docs: ["The star system the fleet is in"],type: {array: ["i64", 2]}}]}}, {name: "IdleToRespawnInput",docs: ["Struct for data input to initialize an `IdleToRespawn` Ix"],type: {kind: "struct",fields: [{name: "keyIndex",docs: ["index of the key in the player profile"],type: "u16"}]}}, {name: "IngredientIndexInput",docs: ["Struct for data input that has `key_index`"],type: {kind: "struct",fields: [{name: "ingredientIndex",docs: ["the index of the recipe output"],type: "u16"}]}}, {name: "InitGameStateInput",docs: ["Struct for data input to `InitGameState`"],type: {kind: "struct",fields: [{name: "keyIndex",docs: ["the index of the key in the sector permissions profile"],type: "u16"}]}}, {name: "KeyIndexInput",docs: ["Struct for data input that has `key_index`"],type: {kind: "struct",fields: [{name: "keyIndex",docs: ["the index of the key in the sector permissions profile"],type: "u16"}]}}, {name: "LocationType",docs: ["Represents different types of locations that a `Resource` might be found"],type: {kind: "enum",variants: [{name: "Planet"}]}}, {name: "ManageGameInput",docs: ["Struct for data input to managing Game accounts"],type: {kind: "struct",fields: [{name: "keyIndex",docs: ["the index of the key in the sector permissions profile"],type: "u16"}]}}, {name: "MineAsteroid",docs: ["The data for the [`FleetStateData::MineAsteroid`](crate::state_machine::FleetStateData::MineAsteroid) state"],type: {kind: "struct",fields: [{name: "asteroid",docs: ["The `Asteroid` the `Fleet` is mining (Must be an asteroid belt)"],type: "publicKey"}, {name: "resource",docs: ["The `Resource` being mined on the `Asteroid`"],type: "publicKey"}, {name: "start",docs: ["The timestamp at which mining activity started"],type: "i64"}, {name: "end",docs: ["The timestamp at which mining activity stops"],type: "i64"}, {name: "amountMined",docs: ["The cumulative amount mined"],type: "u64"}, {name: "lastUpdate",docs: ["The last time the `Fleet` was updated"],type: "i64"}]}}, {name: "MineAsteroidToRespawnInput",docs: ["Struct for data input for `MineAsteroidToRespawnInput`"],type: {kind: "struct",fields: [{name: "keyIndex",docs: ["the index of the key in the player profile"],type: "u16"}]}}, {name: "Mints",docs: ["Token mints"],type: {kind: "struct",fields: [{name: "atlas",docs: ["ATLAS token mint"],type: "publicKey"}, {name: "polis",docs: ["POLIS token mint"],type: "publicKey"}, {name: "ammo",docs: ["ammunition"],type: "publicKey"}, {name: "food",docs: ["food"],type: "publicKey"}, {name: "fuel",docs: ["fuel"],type: "publicKey"}, {name: "repairKit",docs: ["repair kit"],type: "publicKey"}]}}, {name: "MiscStats",docs: ["A ship's miscellaneous stats"],type: {kind: "struct",fields: [{name: "crew",docs: ["Number of crew in the ship"],type: "u64"}, {name: "respawnTime",docs: ["the time it takes the ship to respawn"],type: "u16"}, {name: "scanCoolDown",docs: ["the time it takes the ship to be able to scan again after scanning"],type: "u16"}, {name: "sduPerScan",docs: ["The number of SDUs that can be found while scanning"],type: "u32"}, {name: "scanCost",docs: ["the amount of resource required to do a scan"],type: "u32"}, {name: "placeholder",docs: ["TODO: this is a placeholder stats for use in the future"],type: "u32"}, {name: "placeholder2",docs: ["TODO: this is a placeholder stats for use in the future"],type: "u32"}, {name: "placeholder3",docs: ["TODO: this is a placeholder stats for use in the future"],type: "u32"}]}}, {name: "MiscStatsUnpacked",docs: ["Unpacked version of [`MiscStats`]"],type: {kind: "struct",fields: [{name: "crew",docs: ["Number of crew in the ship"],type: "u64"}, {name: "respawnTime",docs: ["the time it takes the ship to respawn"],type: "u16"}, {name: "scanCoolDown",docs: ["the time it takes the ship to be able to scan again after scanning"],type: "u16"}, {name: "sduPerScan",docs: ["The number of SDUs that can be found while scanning"],type: "u32"}, {name: "scanCost",docs: ["the amount of resource required to do a scan"],type: "u32"}, {name: "placeholder",docs: ["TODO: this is a placeholder stats for use in the future"],type: "u32"}, {name: "placeholder2",docs: ["TODO: this is a placeholder stats for use in the future"],type: "u32"}, {name: "placeholder3",docs: ["TODO: this is a placeholder stats for use in the future"],type: "u32"}]}}, {name: "MiscVariables",docs: ["Miscellaneous game state variables"],type: {kind: "struct",fields: [{name: "warpLaneFuelCostReduction",docs: ['Percentage by which the "warp lane" movement type reduces warp fuel cost'],type: "i16"}, {name: "respawnFee",docs: ["Respawn fee; You cannot enter into the respawning state without paying this fee", "Since ATLAS has 8 decimal places, units are in the smallest value of ATLAS possible."],type: "u64"}, {name: "upkeepMiningEmissionsPenalty",docs: ["Percentage by which to reduce the asteroid mining rate if a starbase ammo upkeep coffer is empty"],type: "i16"}]}}, {name: "MiscVariablesInput",docs: ["Struct for data input to update miscellaneous settings"],type: {kind: "struct",fields: [{name: "warpLaneFuelCostReduction",docs: ['Percentage by which the "warp lane" movement type reduces warp fuel cost'],type: {option: "i16"}}, {name: "upkeepMiningEmissionsPenalty",docs: ["Percentage by which to reduce the asteroid mining rate if a starbase ammo upkeep coffer is empty"],type: {option: "i16"}}, {name: "respawnFee",docs: ["Respawn fee, charged in ATLAS"],type: {option: "u64"}}]}}, {name: "MoveSubwarp",docs: ["The data for the [`FleetStateData::MoveSubwarp`] state"],type: {kind: "struct",fields: [{name: "fromSector",docs: ["The sector the fleet is coming from"],type: {array: ["i64", 2]}}, {name: "toSector",docs: ["The sector the fleet is going to"],type: {array: ["i64", 2]}}, {name: "currentSector",docs: ["The sector the fleet is currently in"],type: {array: ["i64", 2]}}, {name: "departureTime",docs: ["When the fleet started subwarp"],type: "i64"}, {name: "arrivalTime",docs: ["When the fleet will finish subwarp"],type: "i64"}, {name: "fuelExpenditure",docs: ["The fuel cost of the subwarp"],type: "u64"}, {name: "lastUpdate",docs: ["The last update time"],type: "i64"}]}}, {name: "MoveWarp",docs: ["The data for the [`FleetStateData::MoveWarp`] state"],type: {kind: "struct",fields: [{name: "fromSector",docs: ["The star system the fleet is coming from"],type: {array: ["i64", 2]}}, {name: "toSector",docs: ["The star system the fleet is going to"],type: {array: ["i64", 2]}}, {name: "warpStart",docs: ["When the fleet started warping"],type: "i64"}, {name: "warpFinish",docs: ["When the warp will end"],type: "i64"}]}}, {name: "MovementStats",docs: ["A ship's movement stats"],type: {kind: "struct",fields: [{name: "subwarpSpeed",docs: ["the amount of distance that the ship can cover in one second while sub-warping"],type: "u32"}, {name: "warpSpeed",docs: ["the amount of distance that the ship can cover in one second while warping"],type: "u32"}, {name: "maxWarpDistance",docs: ["the max distance that the ship can warp"],type: "u16"}, {name: "warpCoolDown",docs: ["the time it takes the ship to be able to warp again after a warp"],type: "u16"}, {name: "subwarpFuelConsumptionRate",docs: ["the amount of fuel consumed by the ship when sub-warp moving"],type: "u32"}, {name: "warpFuelConsumptionRate",docs: ["the amount of fuel consumed by the ship when warp moving"],type: "u32"}, {name: "planetExitFuelAmount",docs: ["the amount of fuel required to exit a planet"],type: "u32"}]}}, {name: "MovementStatsUnpacked",docs: ["Unpacked version of [`MovementStats`]"],type: {kind: "struct",fields: [{name: "subwarpSpeed",docs: ["the amount of distance that the ship can cover in one second while sub-warping"],type: "u32"}, {name: "warpSpeed",docs: ["the amount of distance that the ship can cover in one second while warping"],type: "u32"}, {name: "maxWarpDistance",docs: ["the max distance that the ship can warp"],type: "u16"}, {name: "warpCoolDown",docs: ["the time it takes the ship to be able to warp again after a warp"],type: "u16"}, {name: "subwarpFuelConsumptionRate",docs: ["the amount of fuel consumed by the ship when sub-warp moving"],type: "u32"}, {name: "warpFuelConsumptionRate",docs: ["the amount of fuel consumed by the ship when warp moving"],type: "u32"}, {name: "planetExitFuelAmount",docs: ["the amount of fuel required to exit a planet"],type: "u32"}]}}, {name: "OptionalNonSystemPubkey",docs: ["A pubkey sized option that is none if set to the system program."],type: {kind: "struct",fields: [{name: "key",type: "publicKey"}]}}, {name: "PlanetType",docs: ["Represents different types a `Planet` could be"],type: {kind: "enum",variants: [{name: "Terrestrial"}, {name: "Volcanic"}, {name: "Barren"}, {name: "AsteroidBelt"}, {name: "GasGiant"}, {name: "IceGiant"}, {name: "Dark"}]}}, {name: "Points",docs: ["Variables for the Points program"],type: {kind: "struct",fields: [{name: "lpCategory",docs: ["Represents the points category & modifier to use for Loyalty Points (LP)"],type: {defined: "SagePointsCategory"}}, {name: "councilRankXpCategory",docs: ["Represents the points category & modifier to use for Council Rank Experience Points (CRXP)"],type: {defined: "SagePointsCategory"}}, {name: "pilotXpCategory",docs: ["Represents the points category & modifier to use for Pilot License Experience Points (PXP)"],type: {defined: "SagePointsCategory"}}, {name: "dataRunningXpCategory",docs: ["Represents the points category & modifier to use for Data Running Experience Points (DRXP)"],type: {defined: "SagePointsCategory"}}, {name: "miningXpCategory",docs: ["Represents the points category & modifier to use for Mining Experience Points (MXP)"],type: {defined: "SagePointsCategory"}}, {name: "craftingXpCategory",docs: ["Represents the points category & modifier to use for Crafting Experience Points (CXP)"],type: {defined: "SagePointsCategory"}}]}}, {name: "ProgressionItem",docs: ["Progression Item"],type: {kind: "struct",fields: [{name: "value",docs: ["The progression points value"],type: "u32"}]}}, {name: "ProgressionItemInput",docs: ["Progression Item for Data Input"],type: {kind: "struct",fields: [{name: "itemType",docs: ["The type of progression item"],type: "u8"}, {name: "item",docs: ["The progression item"],type: {defined: "ProgressionItem"}}]}}, {name: "ProgressionItemInputUnpacked",docs: ["Unpacked version of [`ProgressionItemInput`]"],type: {kind: "struct",fields: [{name: "itemType",docs: ["The type of progression item"],type: "u8"}, {name: "item",docs: ["The progression item"],type: {defined: "ProgressionItem"}}]}}, {name: "ProgressionItemType",docs: ["The different types of progression items"],type: {kind: "enum",variants: [{name: "Subwarp"}, {name: "Warp"}, {name: "WarpLane"}, {name: "AsteroidExit"}, {name: "ScanUnsuccessful"}, {name: "ScanSuccessful"}, {name: "Mining"}, {name: "Crafting"}, {name: "Upkeep"}, {name: "Upgrade"}]}}, {name: "ProgressionItemUnpacked",docs: ["Unpacked version of [`ProgressionItem`]"],type: {kind: "struct",fields: [{name: "value",docs: ["The progression points value"],type: "u32"}]}}, {name: "RegisterMineItemInput",docs: ["Struct for data input to Register a Resource"],type: {kind: "struct",fields: [{name: "name",docs: ["The name of the `MineItem`"],type: {array: ["u8", 64]}}, {name: "resourceHardness",docs: ["How hard it is to mine this item"],type: "u16"}, {name: "keyIndex",docs: ["the index of the key in the fleet permissions profile"],type: "u16"}]}}, {name: "RegisterPlanetInput",docs: ["Struct for data input to Register Planet"],type: {kind: "struct",fields: [{name: "name",docs: ["`Planet` name"],type: {array: ["u8", 64]}}, {name: "size",docs: ["`Planet` size"],type: "u64"}, {name: "maxHp",docs: ["`Planet` max health"],type: "u64"}, {name: "subCoordinates",docs: ["`Planet` sub_coordinates"],type: {array: ["i64", 2]}}, {name: "planetType",docs: ["`Planet` type"],type: "u8"}, {name: "position",docs: ["`Planet` position"],type: "u8"}, {name: "keyIndex",docs: ["the index of the key in the sector permissions profile"],type: "u16"}]}}, {name: "RegisterProgressionConfigInput",docs: ["Data input for RegisterProgressionConfig"],type: {kind: "struct",fields: [{name: "dailyLpLimit",docs: ["the daily limit for Loyalty Points (LP)"],type: {option: "u64"}}, {name: "dailyCouncilRankXpLimit",docs: ["the daily limit for Council Rank Experience Points (CRXP)"],type: {option: "u64"}}, {name: "dailyPilotXpLimit",docs: ["the daily limit for Pilot License Experience Points (PXP)"],type: {option: "u64"}}, {name: "dailyDataRunningXpLimit",docs: ["the daily limit for Data Running Experience Points (DRXP)"],type: {option: "u64"}}, {name: "dailyMiningXpLimit",docs: ["the daily limit for Mining Experience Points (MXP)"],type: {option: "u64"}}, {name: "dailyCraftingXpLimit",docs: ["the daily limit for Crafting Experience Points (CXP)"],type: {option: "u64"}}, {name: "keyIndex",docs: ["the index of the key in the sector permissions profile"],type: "u16"}]}}, {name: "RegisterResourceInput",docs: ["Struct for data input to Register a Resource"],type: {kind: "struct",fields: [{name: "locationType",docs: ["`Resource` location type"],type: "u8"}, {name: "systemRichness",docs: ["`Resource` `system_richness`"],type: "u16"}, {name: "keyIndex",docs: ["the index of the key in the fleet permissions profile"],type: "u16"}]}}, {name: "RegisterSagePointsModifierInput",docs: ["Struct for data input to register a points modifier for SAGE program"],type: {kind: "struct",fields: [{name: "pointsCategoryType",docs: ["The points category type of the modifier"],type: "u8"}, {name: "keyIndex",docs: ["the index of the key in the player profile"],type: "u16"}]}}, {name: "RegisterShipInput",docs: ["Struct for data input to Register Ship"],type: {kind: "struct",fields: [{name: "name",docs: ["The `Ship` name/label"],type: {array: ["u8", 64]}}, {name: "sizeClass",docs: ["the ship's size class"],type: {defined: "SizeClass"}}, {name: "stats",docs: ["The stats for the ship"],type: {defined: "ShipStatsUnpacked"}}, {name: "keyIndex",docs: ["the index of the key in the sector permissions profile"],type: "u16"}, {name: "isActive",docs: ["Whether the ship is initialized to active (`update_id == current_update_id`)"],type: "bool"}]}}, {name: "RegisterStarInput",docs: ["Struct for data input to Register Star"],type: {kind: "struct",fields: [{name: "name",docs: ["`Star` name"],type: {array: ["u8", 64]}}, {name: "size",docs: ["`Star` size"],type: "u64"}, {name: "subCoordinates",docs: ["`Star` sub_coordinates"],type: {array: ["i64", 2]}}, {name: "starType",docs: ["`Star` type"],type: "u8"}, {name: "keyIndex",docs: ["the index of the key in the sector permissions profile"],type: "u16"}]}}, {name: "RegisterStarbaseInput",docs: ["Struct for data input to Register `Starbase`"],type: {kind: "struct",fields: [{name: "name",docs: ["`Starbase` name"],type: {array: ["u8", 64]}}, {name: "subCoordinates",docs: ["`Starbase` coordinates"],type: {array: ["i64", 2]}}, {name: "starbaseLevelIndex",docs: ["The index representing the level of the `Starbase` in the game variables."],type: "u8"}, {name: "faction",docs: ["The `Starbase` faction"],type: "u8"}, {name: "keyIndex",docs: ["the index of the key in the fleet permissions profile"],type: "u16"}]}}, {name: "RegisterStarbaseInputUnpacked",docs: ["Unpacked version of [`RegisterStarbaseInput`]"],type: {kind: "struct",fields: [{name: "name",docs: ["`Starbase` name"],type: {array: ["u8", 64]}}, {name: "subCoordinates",docs: ["`Starbase` coordinates"],type: {array: ["i64", 2]}}, {name: "starbaseLevelIndex",docs: ["The index representing the level of the `Starbase` in the game variables."],type: "u8"}, {name: "faction",docs: ["The `Starbase` faction"],type: "u8"}, {name: "keyIndex",docs: ["the index of the key in the fleet permissions profile"],type: "u16"}]}}, {name: "RegisterSurveyDataUnitTrackerInput",docs: ["Struct for data input to Register SurveyDataUnitTracker"],type: {kind: "struct",fields: [{name: "coordinatesRange",docs: ["The valid coordinates range", "e.g. a value of [-50, 50] means that coordinates from [-50, -50] to [50, 50] are valid for SDU scanning"],type: {array: ["i64", 2]}}, {name: "cssCoordinates",docs: ["The locations of the central space stations (CSS) of the three factions"],type: {array: [{array: ["i64", 2]}, 3]}}, {name: "originCoordinates",docs: ['The co-ordinates of the "origin"; used in calculating SDU probability'],type: {array: ["i64", 2]}}, {name: "cssMaxDistance",docs: ["The max distance from the nearest CSS; used in calculating SDU probability"],type: "u32"}, {name: "originMaxDistance",docs: ["The max distance from the `origin_coordinates`; used in calculating SDU probability"],type: "u32"}, {name: "distanceWeighting",docs: ["The distance weighting; used in calculating SDU probability"],type: "u32"}, {name: "tMax",docs: ["The maximum time before SDU probability at a location changes"],type: "i64"}, {name: "xMul",docs: ["Multiplier in the X dimension; used in noise function"],type: "u32"}, {name: "yMul",docs: ["Multiplier in the Y dimension; used in noise function"],type: "u32"}, {name: "zMul",docs: ["Multiplier in the Z dimension; used in noise function"],type: "u32"}, {name: "sduMaxPerSector",docs: ["The maximum number of SDUs that can be found per scan per sector"],type: "u32"}, {name: "scanChanceRegenPeriod",docs: ["The amount of time in seconds that it takes for a sector scan chance to fully regenerate"],type: "i16"}, {name: "keyIndex",docs: ["the index of the key in the sector permissions profile"],type: "u16"}]}}, {name: "RemoveShipEscrowInput",docs: ["Struct for data input for `RemoveShipEscrow`"],type: {kind: "struct",fields: [{name: "shipAmount",docs: ["Amount of `Ship` tokens to transfer from escrow"],type: "u64"}, {name: "permissionKeyIndex",docs: ["the index of the `ProfileKey` in `Profile` with required permissions"],type: "u16"}, {name: "shipEscrowIndex",docs: ["Index of `WrappedShipEscrow` in remaining data of `StarbasePlayer`"],type: "u32"}]}}, {name: "Respawn",docs: ["The data for the [`FleetStateData::Respawn`](crate::state_machine::FleetStateData::Respawn) state"],type: {kind: "struct",fields: [{name: "sector",docs: ["The star system the fleet was in when it entered the `Respawn` state"],type: {array: ["i64", 2]}}, {name: "start",docs: ["The time `Respawn` started"],type: "i64"}]}}, {name: "RespawnToLoadingBayInput",docs: ["Struct for data input to `RespawnToLoadingBay`"],type: {kind: "struct",fields: [{name: "keyIndex",docs: ["the index of the key in the player profile"],type: "u16"}]}}, {name: "RiskZoneData",docs: ["`RiskZone` center and radius"],type: {kind: "struct",fields: [{name: "center",docs: ["Risk zone center"],type: {array: ["i64", 2]}}, {name: "radius",docs: ["Risk zone radius"],type: "u64"}]}}, {name: "RiskZoneDataUnpacked",docs: ["Unpacked version of [`RiskZoneData`]"],type: {kind: "struct",fields: [{name: "center",docs: ["Risk zone center"],type: {array: ["i64", 2]}}, {name: "radius",docs: ["Risk zone radius"],type: "u64"}]}}, {name: "RiskZonesData",docs: ["[`RiskZoneData`] for [`RiskZones`]"],type: {kind: "struct",fields: [{name: "mudSecurityZone",docs: ["Mud security zone"],type: {defined: "RiskZoneData"}}, {name: "oniSecurityZone",docs: ["Oni security zone"],type: {defined: "RiskZoneData"}}, {name: "usturSecurityZone",docs: ["Ustur security zone"],type: {defined: "RiskZoneData"}}, {name: "highRiskZone",docs: ["High risk zone"],type: {defined: "RiskZoneData"}}, {name: "mediumRiskZone",docs: ["Medium risk zone"],type: {defined: "RiskZoneData"}}]}}, {name: "RiskZonesDataUnpacked",docs: ["Unpacked version of [`RiskZonesData`]"],type: {kind: "struct",fields: [{name: "mudSecurityZone",docs: ["Mud security zone"],type: {defined: "RiskZoneData"}}, {name: "oniSecurityZone",docs: ["Oni security zone"],type: {defined: "RiskZoneData"}}, {name: "usturSecurityZone",docs: ["Ustur security zone"],type: {defined: "RiskZoneData"}}, {name: "highRiskZone",docs: ["High risk zone"],type: {defined: "RiskZoneData"}}, {name: "mediumRiskZone",docs: ["Medium risk zone"],type: {defined: "RiskZoneData"}}]}}, {name: "SagePointsCategory",docs: ["Represents a points category & modifier as defined in the Points program"],type: {kind: "struct",fields: [{name: "category",docs: ["The points category"],type: "publicKey"}, {name: "modifier",docs: ["The points category modifier"],type: "publicKey"}, {name: "modifierBump",docs: ["The points category modifier bump"],type: "u8"}]}}, {name: "ScanForSurveyDataUnitsInput",docs: ["Struct for data input to Scan For Survey Data Units"],type: {kind: "struct",fields: [{name: "keyIndex",docs: ["The index of the key in the player profile"],type: "u16"}]}}, {name: "SectorConnection",docs: ["Connection between sectors"],type: {kind: "struct",fields: [{name: "connectionSector",docs: ["The sector connected to"],type: "publicKey"}, {name: "subCoordinates",docs: ["The location of the connection"],type: {array: ["i64", 2]}}, {name: "flags",docs: ["Connection flags"],type: "u8"}]}}, {name: "SectorRing",docs: ["Represents the orbital position of a `Planet` in the `Sector`"],type: {kind: "enum",variants: [{name: "Inner"}, {name: "Mid"}, {name: "Outer"}]}}, {name: "ShipCounts",docs: ["Ship counts for a fleet."],type: {kind: "struct",fields: [{name: "total",docs: ["The total number of ships in the fleet."],type: "u32"}, {name: "updated",docs: ["Used when updating a fleet.", "Value is 0 when fleet update is in progress"],type: "u32"}, {name: "xxSmall",docs: ["The number of xx small ships in the fleet."],type: "u16"}, {name: "xSmall",docs: ["The number of x small ships in the fleet."],type: "u16"}, {name: "small",docs: ["The number of small ships in the fleet."],type: "u16"}, {name: "medium",docs: ["The number of medium ships in the fleet."],type: "u16"}, {name: "large",docs: ["The number of large ships in the fleet."],type: "u16"}, {name: "capital",docs: ["The number of capital ships in the fleet."],type: "u16"}, {name: "commander",docs: ["The number of commander ships in the fleet."],type: "u16"}, {name: "titan",docs: ["The number of titan ships in the fleet."],type: "u16"}]}}, {name: "ShipCountsUnpacked",docs: ["Unpacked version of [`ShipCounts`]"],type: {kind: "struct",fields: [{name: "total",docs: ["The total number of ships in the fleet."],type: "u32"}, {name: "updated",docs: ["Used when updating a fleet.", "Value is 0 when fleet update is in progress"],type: "u32"}, {name: "xxSmall",docs: ["The number of xx small ships in the fleet."],type: "u16"}, {name: "xSmall",docs: ["The number of x small ships in the fleet."],type: "u16"}, {name: "small",docs: ["The number of small ships in the fleet."],type: "u16"}, {name: "medium",docs: ["The number of medium ships in the fleet."],type: "u16"}, {name: "large",docs: ["The number of large ships in the fleet."],type: "u16"}, {name: "capital",docs: ["The number of capital ships in the fleet."],type: "u16"}, {name: "commander",docs: ["The number of commander ships in the fleet."],type: "u16"}, {name: "titan",docs: ["The number of titan ships in the fleet."],type: "u16"}]}}, {name: "ShipSizes",docs: ["Ship sizes."],type: {kind: "struct",fields: [{name: "xxSmall",docs: ["The size of xx small ships"],type: "u8"}, {name: "xSmall",docs: ["The size of x small ships"],type: "u8"}, {name: "small",docs: ["The size of small ships"],type: "u8"}, {name: "medium",docs: ["The size of medium ships"],type: "u8"}, {name: "large",docs: ["The size of large ships"],type: "u8"}, {name: "capital",docs: ["The size of capital ships"],type: "u8"}, {name: "commander",docs: ["The size of commander ships"],type: "u8"}, {name: "titan",docs: ["The size of titan ships"],type: "u8"}]}}, {name: "ShipStats",docs: ["A ship's stats"],type: {kind: "struct",fields: [{name: "movementStats",docs: ["Movement stats for the ship"],type: {defined: "MovementStats"}}, {name: "cargoStats",docs: ["Cargo stats for the ship"],type: {defined: "CargoStats"}}, {name: "miscStats",docs: ["Miscellaneous stats for the ship"],type: {defined: "MiscStats"}}]}}, {name: "ShipStatsUnpacked",docs: ["Unpacked version of [`ShipStats`]"],type: {kind: "struct",fields: [{name: "movementStats",docs: ["Movement stats for the ship"],type: {defined: "MovementStats"}}, {name: "cargoStats",docs: ["Cargo stats for the ship"],type: {defined: "CargoStats"}}, {name: "miscStats",docs: ["Miscellaneous stats for the ship"],type: {defined: "MiscStats"}}]}}, {name: "SizeClass",docs: ["Represents different types of Ships"],type: {kind: "enum",variants: [{name: "XxSmall"}, {name: "XSmall"}, {name: "Small"}, {name: "Medium"}, {name: "Large"}, {name: "Capital"}, {name: "Commander"}, {name: "Titan"}]}}, {name: "StarType",docs: ["Represents different types of Stars"],type: {kind: "enum",variants: [{name: "WhiteDwarf"}, {name: "RedDwarf"}, {name: "Solar"}, {name: "HotBlue"}, {name: "RedGiant"}]}}, {name: "StarbaseCreateCargoPodInput",docs: ["Struct for data input to `StarbaseCreateCargoPod`"],type: {kind: "struct",fields: [{name: "podSeeds",docs: ["cargo pod seeds"],type: {array: ["u8", 32]}}, {name: "keyIndex",docs: ["the index of the key in the player profile"],type: "u16"}]}}, {name: "StarbaseCreateCraftingProcessInput",docs: ["Struct for data input to create a `CraftingProcess`"],type: {kind: "struct",fields: [{name: "craftingId",docs: ["crafting id"],type: "u64"}, {name: "recipeCategoryIndex",docs: ["the index of the recipe's category"],type: "u16"}, {name: "quantity",docs: ["quantity of outputs to craft"],type: "u64"}, {name: "numCrew",docs: ["number of crew members to use for this crafting process"],type: "u64"}, {name: "keyIndex",docs: ["the index of the key in the player profile"],type: "u16"}]}}, {name: "StarbaseDepositCraftingIngredientInput",docs: ["Struct for data input to deposit an ingredient"],type: {kind: "struct",fields: [{name: "amount",docs: ["the amount of ingredient to deposit"],type: "u64"}, {name: "ingredientIndex",docs: ["the index of the recipe ingredient"],type: "u16"}, {name: "keyIndex",docs: ["the index of the key in the player profile"],type: "u16"}]}}, {name: "StarbaseLevelInfo",docs: ["Information associated with `Starbase` levels"],type: {kind: "struct",fields: [{name: "recipeForUpgrade",docs: ["The crafting recipe required to upgrade a `Starbase` to this level"],type: "publicKey"}, {name: "recipeCategoryForLevel",docs: ["The crafting recipe category enabled for crafting at a `Starbase` of this level."],type: "publicKey"}, {name: "hp",docs: ["The `Starbase` health points for this level."],type: "u64"}, {name: "sp",docs: ["The `Starbase` shield points for this level."],type: "u64"}, {name: "sectorRingAvailable",docs: ["The planet position `Ring` available for this level"],type: "u8"}, {name: "warpLaneMovementFee",docs: ['Fee charged for the "warp lane" movement type which is meant to be charged in ATLAS', "Since ATLAS has 8 decimal places, units are in the smallest value of ATLAS possible."],type: "u64"}]}}, {name: "StarbaseLevelInfoArrayInput",docs: ["Struct for data input to Update Starbase Level Settings"],type: {kind: "struct",fields: [{name: "level",docs: ["The level of the `Starbase`."],type: "u8"}, {name: "faction",docs: ["The `Starbase` faction."],type: "u8"}, {name: "hp",docs: ["The `Starbase` health points for this level."],type: "u64"}, {name: "sp",docs: ["The `Starbase` shield points for this level."],type: "u64"}, {name: "sectorRingAvailable",docs: ["The planet position `Ring` available for this level"],type: {defined: "SectorRing"}}, {name: "warpLaneMovementFee",docs: ['Fee charged for the "warp lane" movement type which is meant to be charged in ATLAS'],type: "u64"}]}}, {name: "StarbaseLoadingBay",docs: ["The data for the [`FleetStateData::StarbaseLoadingBay`] state"],type: {kind: "struct",fields: [{name: "starbase",docs: ["The `Starbase` is in the loading bay of"],type: "publicKey"}, {name: "lastUpdate",docs: ["The last time this fleet was updated"],type: "i64"}]}}, {name: "StarbaseRemoveCargoPodInput",docs: ["Struct for data input to `StarbaseRemoveCargoPod`"],type: {kind: "struct",fields: [{name: "keyIndex",docs: ["the index of the key in the player profile"],type: "u16"}]}}, {name: "StarbaseState",docs: ["The state of a `Starbase`."],type: {kind: "enum",variants: [{name: "Active"}, {name: "Destroyed"}]}}, {name: "StarbaseTransferCargoInput",docs: ["Struct for data input to `DepositCargoToGame`"],type: {kind: "struct",fields: [{name: "amount",docs: ["cargo amount"],type: "u64"}, {name: "keyIndex",docs: ["the index of the key in the player profile"],type: "u16"}]}}, {name: "StarbaseUpgradeState",docs: ["The state of a `Starbase`."],type: {kind: "enum",variants: [{name: "NotStarted"}, {name: "Started"}, {name: "Completed"}]}}, {name: "StarbaseUpkeepInfo",docs: ["Information associated with `Starbase` upkeep"],type: {kind: "struct",fields: [{name: "ammoReserve",docs: ["The maximum amount of ammo that can be committed upkeep by players", "If 0 (zero) then ammo upkeep is disabled"],type: "u64"}, {name: "ammoDepletionRate",docs: ["The per second rate at which the ammo reserve is emptied"],type: "u32"}, {name: "foodReserve",docs: ["The maximum amount of food that can be committed upkeep by players", "If 0 (zero) then food upkeep is disabled"],type: "u64"}, {name: "foodDepletionRate",docs: ["The per second rate at which the food reserve is emptied"],type: "u32"}, {name: "toolkitReserve",docs: ["The maximum amount of toolkits that can be committed upkeep by players", "If 0 (zero) then toolkit upkeep is disabled"],type: "u64"}, {name: "toolkitDepletionRate",docs: ["The per second rate at which the toolkit reserve is emptied"],type: "u32"}]}}, {name: "StarbaseUpkeepInfoArrayInput",docs: ["Struct for data input to Update Starbase Upkeep Settings"],type: {kind: "struct",fields: [{name: "level",docs: ["The level of the `Starbase`."],type: "u8"}, {name: "info",docs: ["The stats for the ship"],type: {defined: "StarbaseUpkeepInfoUnpacked"}}]}}, {name: "StarbaseUpkeepInfoUnpacked",docs: ["Unpacked version of [`StarbaseUpkeepInfo`]"],type: {kind: "struct",fields: [{name: "ammoReserve",docs: ["The maximum amount of ammo that can be committed upkeep by players", "If 0 (zero) then ammo upkeep is disabled"],type: "u64"}, {name: "ammoDepletionRate",docs: ["The per second rate at which the ammo reserve is emptied"],type: "u32"}, {name: "foodReserve",docs: ["The maximum amount of food that can be committed upkeep by players", "If 0 (zero) then food upkeep is disabled"],type: "u64"}, {name: "foodDepletionRate",docs: ["The per second rate at which the food reserve is emptied"],type: "u32"}, {name: "toolkitReserve",docs: ["The maximum amount of toolkits that can be committed upkeep by players", "If 0 (zero) then toolkit upkeep is disabled"],type: "u64"}, {name: "toolkitDepletionRate",docs: ["The per second rate at which the toolkit reserve is emptied"],type: "u32"}]}}, {name: "StarbaseUpkeepLevels",docs: ["Information on `Starbase` upkeep by level"],type: {kind: "struct",fields: [{name: "level0",docs: ["Upkeep info. for a level 0 `Starbase`"],type: {defined: "StarbaseUpkeepInfo"}}, {name: "level1",docs: ["Upkeep info. for a level 1 `Starbase`"],type: {defined: "StarbaseUpkeepInfo"}}, {name: "level2",docs: ["Upkeep info. for a level 2 `Starbase`"],type: {defined: "StarbaseUpkeepInfo"}}, {name: "level3",docs: ["Upkeep info. for a level 3 `Starbase`"],type: {defined: "StarbaseUpkeepInfo"}}, {name: "level4",docs: ["Upkeep info. for a level 4 `Starbase`"],type: {defined: "StarbaseUpkeepInfo"}}, {name: "level5",docs: ["Upkeep info. for a level 5 `Starbase`"],type: {defined: "StarbaseUpkeepInfo"}}, {name: "level6",docs: ["Upkeep info. for a level 6 `Starbase`"],type: {defined: "StarbaseUpkeepInfo"}}]}}, {name: "StarbaseUpkeepLevelsUnpacked",docs: ["Unpacked version of [`StarbaseUpkeepLevels`]"],type: {kind: "struct",fields: [{name: "level0",docs: ["Upkeep info. for a level 0 `Starbase`"],type: {defined: "StarbaseUpkeepInfo"}}, {name: "level1",docs: ["Upkeep info. for a level 1 `Starbase`"],type: {defined: "StarbaseUpkeepInfo"}}, {name: "level2",docs: ["Upkeep info. for a level 2 `Starbase`"],type: {defined: "StarbaseUpkeepInfo"}}, {name: "level3",docs: ["Upkeep info. for a level 3 `Starbase`"],type: {defined: "StarbaseUpkeepInfo"}}, {name: "level4",docs: ["Upkeep info. for a level 4 `Starbase`"],type: {defined: "StarbaseUpkeepInfo"}}, {name: "level5",docs: ["Upkeep info. for a level 5 `Starbase`"],type: {defined: "StarbaseUpkeepInfo"}}, {name: "level6",docs: ["Upkeep info. for a level 6 `Starbase`"],type: {defined: "StarbaseUpkeepInfo"}}]}}, {name: "StarbaseWithdrawCraftingIngredientInput",docs: ["Struct for data input to withdraw an ingredient"],type: {kind: "struct",fields: [{name: "amount",docs: ["the amount of ingredient to withdraw"],type: "u64"}, {name: "ingredientIndex",docs: ["the index of the recipe ingredient"],type: "u16"}, {name: "keyIndex",docs: ["the index of the key in the player profile"],type: "u16"}]}}, {name: "StartSubwarpInput",docs: ["Struct for data input to initialize an `SubwarpMovement`"],type: {kind: "struct",fields: [{name: "toSector",docs: ["The destination coordinates"],type: {array: ["i64", 2]}}, {name: "keyIndex",docs: ["The index of the key in the player profile"],type: "u16"}]}}, {name: "StopMiningAsteroidInput",docs: ["Struct for data input for `StopMiningAsteroidInput`"],type: {kind: "struct",fields: [{name: "keyIndex",docs: ["the index of the key in the player profile"],type: "u16"}]}}, {name: "StopSubwarpInput",docs: ["Struct for data input to stop an `SubwarpMovement`"],type: {kind: "struct",fields: [{name: "keyIndex",docs: ["The index of the key in the player profile"],type: "u16"}]}}, {name: "SubmitStarbaseUpgradeResourceInput",docs: ["Submit starbase upgrade resource inputs"],type: {kind: "struct",fields: [{name: "pointsProgramPermissionsKeyIndex",docs: ["the index of the point program permissions in the player profile"],type: "u16"}, {name: "sagePermissionsKeyIndex",docs: ["the index of the key in sage permissions in the player profile"],type: "u16"}, {name: "upgradeProcessRecipeInputIndex",docs: ["the index of the resource in the upgrade_process_recipe ingredients list", "The resource is a non-consumable in this recipe"],type: "u16"}, {name: "starbaseUpgradeRecipeInputIndex",docs: ["the index of the resource in the upgrade recipe", "The resource is a consumable in this recipe"],type: "u16"}, {name: "resourceRecipeOutputIndex",docs: ["the index of the resource represented by `token_mint` in the `resource_recipe` ingredients list", "The resource is an output in this recipe"],type: "u16"}, {name: "epochIndex",docs: ["the index of the epoch in the `RedemptionConfig` account"],type: "u16"}]}}, {name: "TransferCargoWithinFleetInput",docs: ["Struct for data input to `TransferCargoWithinFleet`"],type: {kind: "struct",fields: [{name: "amount",docs: ["cargo amount"],type: "u64"}, {name: "keyIndex",docs: ["the index of the key in the player profile"],type: "u16"}]}}, {name: "UpdateGameInput",docs: ["Struct for data input to Update instruction"],type: {kind: "struct",fields: [{name: "cargo",docs: ["Cargo settings"],type: "u8"}, {name: "crafting",docs: ["Crafting settings"],type: "u8"}, {name: "mints",docs: ["Mints"],type: "u8"}, {name: "vaults",docs: ["Vaults"],type: "u8"}, {name: "points",docs: ["Points settings"],type: "u8"}, {name: "riskZones",docs: ["Data for risk zones"],type: {option: {defined: "RiskZonesDataUnpacked"}}}, {name: "keyIndex",docs: ["the index of the key in the sector permissions profile"],type: "u16"}]}}, {name: "UpdateGameStateInput",docs: ["Struct for data input to Update instruction"],type: {kind: "struct",fields: [{name: "fleet",docs: ["Fleet settings"],type: {option: {defined: "FleetInput"}}}, {name: "misc",docs: ["Miscellaneous settings"],type: {option: {defined: "MiscVariablesInput"}}}, {name: "keyIndex",docs: ["the index of the key in the sector permissions profile"],type: "u16"}]}}, {name: "UpdateMineItemInput",docs: ["Struct for data input to Register a Resource"],type: {kind: "struct",fields: [{name: "name",docs: ["The name of the `MineItem`"],type: {option: {array: ["u8", 64]}}}, {name: "resourceHardness",docs: ["How hard it is to mine this item"],type: {option: "u16"}}, {name: "keyIndex",docs: ["the index of the key in the fleet permissions profile"],type: "u16"}]}}, {name: "UpdatePlanetInput",docs: ["Struct for data input to Update Planet"],type: {kind: "struct",fields: [{name: "name",docs: ["`Planet` name"],type: {option: {array: ["u8", 64]}}}, {name: "size",docs: ["`Planet` size"],type: {option: "u64"}}, {name: "maxHp",docs: ["`Planet` max_hp"],type: {option: "u64"}}, {name: "keyIndex",docs: ["the index of the key in the sector permissions profile"],type: "u16"}]}}, {name: "UpdateProgressionConfigInput",docs: ["Struct for data input for `UpdateProgressionConfig`"],type: {kind: "struct",fields: [{name: "keyIndex",docs: ["the index of the key in the permissions profile"],type: "u16"}, {name: "dailyLpLimit",docs: ["the daily limit for Loyalty Points (LP)"],type: {option: "u64"}}, {name: "dailyCouncilRankXpLimit",docs: ["the daily limit for Council Rank Experience Points (CRXP)"],type: {option: "u64"}}, {name: "dailyPilotXpLimit",docs: ["the daily limit for Pilot License Experience Points (PXP)"],type: {option: "u64"}}, {name: "dailyDataRunningXpLimit",docs: ["the daily limit for Data Running Experience Points (DRXP)"],type: {option: "u64"}}, {name: "dailyMiningXpLimit",docs: ["the daily limit for Mining Experience Points (MXP)"],type: {option: "u64"}}, {name: "dailyCraftingXpLimit",docs: ["the daily limit for Crafting Experience Points (CXP)"],type: {option: "u64"}}, {name: "items",docs: ["the progression items"],type: {option: {vec: {defined: "ProgressionItemInputUnpacked"}}}}]}}, {name: "UpdateResourceInput",docs: ["Struct for data input to Update Resource"],type: {kind: "struct",fields: [{name: "systemRichness",docs: ["`Resource` richness"],type: {option: "u16"}}, {name: "keyIndex",docs: ["the index of the key in the fleet permissions profile"],type: "u16"}]}}, {name: "UpdateShipEscrowInput",docs: ["Struct for data input for `UpdateShipEscrow`"],type: {kind: "struct",fields: [{name: "shipEscrowIndex",docs: ["Index of `WrappedShipEscrow` in remaining data of `StarbasePlayer`"],type: "u32"}]}}, {name: "UpdateShipFleetInput",docs: ["Struct for data input for that has `key_index`"],type: {kind: "struct",fields: [{name: "shipAmount",docs: ["Number of ships to add to the fleet"],type: "u16"}, {name: "fleetShipInfoIndex",docs: ["Index of `FleetShipsInfo` in remaining data of `FleetShips`"],type: "u32"}]}}, {name: "UpdateShipInput",docs: ["Struct for data input to Update Ship"],type: {kind: "struct",fields: [{name: "name",docs: ["The `Ship` name/label"],type: {array: ["u8", 64]}}, {name: "sizeClass",docs: ["the ship's size class"],type: {defined: "SizeClass"}}, {name: "stats",docs: ["The stats for the ship"],type: {defined: "ShipStatsUnpacked"}}, {name: "keyIndex",docs: ["the index of the key in the sector permissions profile"],type: "u16"}]}}, {name: "UpdateStarInput",docs: ["Struct for data input to Update Star"],type: {kind: "struct",fields: [{name: "name",docs: ["`Star` name"],type: {option: {array: ["u8", 64]}}}, {name: "size",docs: ["`Star` size"],type: {option: "u64"}}, {name: "starType",docs: ["`Star` type"],type: {option: "u8"}}, {name: "keyIndex",docs: ["the index of the key in the sector permissions profile"],type: "u16"}]}}, {name: "UpdateStarbaseInput",docs: ["Struct for data input to Update `Starbase`"],type: {kind: "struct",fields: [{name: "name",docs: ["`Starbase` name"],type: {option: {array: ["u8", 64]}}}, {name: "subCoordinates",docs: ["`Starbase` coordinates"],type: {option: {array: ["i64", 2]}}}, {name: "keyIndex",docs: ["the index of the key in the sector permissions profile"],type: "u16"}]}}, {name: "UpdateSurveyDataUnitTrackerInput",docs: ["Struct for data input to Update SurveyDataUnitTracker"],type: {kind: "struct",fields: [{name: "coordinatesRange",docs: ["The valid coordinates range", "e.g. a value of [-50, 50] means that coordinates from [-50, -50] to [50, 50] are valid for SDU scanning"],type: {option: {array: ["i64", 2]}}}, {name: "cssCoordinates",docs: ["The locations of the central space stations (CSS) of the three factions"],type: {option: {array: [{array: ["i64", 2]}, 3]}}}, {name: "originCoordinates",docs: ['The co-ordinates of the "origin"; used in calculating SDU probability'],type: {option: {array: ["i64", 2]}}}, {name: "cssMaxDistance",docs: ["The max distance from the nearest CSS; used in calculating SDU probability"],type: {option: "u32"}}, {name: "originMaxDistance",docs: ["The max distance from the `origin_coordinates`; used in calculating SDU probability"],type: {option: "u32"}}, {name: "distanceWeighting",docs: ["The distance weighting; used in calculating SDU probability"],type: {option: "u32"}}, {name: "tMax",docs: ["The maximum time before SDU probability at a location changes"],type: {option: "i64"}}, {name: "xMul",docs: ["Multiplier in the X dimension; used in noise function"],type: {option: "u32"}}, {name: "yMul",docs: ["Multiplier in the Y dimension; used in noise function"],type: {option: "u32"}}, {name: "zMul",docs: ["Multiplier in the Z dimension; used in noise function"],type: {option: "u32"}}, {name: "sduMaxPerSector",docs: ["The maximum number of SDUs that can be found per scan per sector"],type: {option: "u32"}}, {name: "scanChanceRegenPeriod",docs: ["The amount of time in seconds that it takes for a sector scan chance to fully regenerate"],type: {option: "i16"}}, {name: "keyIndex",docs: ["the index of the key in the sector permissions profile"],type: "u16"}]}}, {name: "UpkeepResourceType",docs: ["The different types of upkeep resources"],type: {kind: "enum",variants: [{name: "Ammo"}, {name: "Food"}, {name: "Toolkit"}]}}, {name: "Vaults",docs: ["Token vaults"],type: {kind: "struct",fields: [{name: "atlas",docs: ["ATLAS token mint"],type: "publicKey"}, {name: "polis",docs: ["POLIS token mint"],type: "publicKey"}]}}, {name: "WarpLaneInput",docs: ["Struct for data input to initialize a `WarpLane`"],type: {kind: "struct",fields: [{name: "keyIndex",docs: ["The index of the key in the player profile"],type: "u16"}, {name: "toSectorIndex",docs: ["Index of the to_sector in `SectorConnections` of the from_sector"],type: "u16"}, {name: "fromSectorIndex",docs: ["Index of the from_sector in `SectorConnections` of the to_sector"],type: "u16"}]}}, {name: "WarpToCoordinateInput",docs: ["Struct for data input to initialize a `WarpToCoordinate`"],type: {kind: "struct",fields: [{name: "keyIndex",docs: ["The index of the key in the player profile"],type: "u16"}, {name: "toSector",docs: ["The destination coordinates"],type: {array: ["i64", 2]}}]}}, {name: "WithdrawCargoFromFleetInput",docs: ["Struct for data input to `WithdrawCargoFromFleet`"],type: {kind: "struct",fields: [{name: "amount",docs: ["cargo amount"],type: "u64"}, {name: "keyIndex",docs: ["the index of the key in the player profile"],type: "u16"}]}}, {name: "WrappedShipEscrow",docs: ["Wrapped `Ship` escrow info"],type: {kind: "struct",fields: [{name: "ship",docs: ["The `Ship` account address"],type: "publicKey"}, {name: "amount",docs: ["The `Ship` token amount in escrow"],type: "u64"}, {name: "updateId",docs: ["The update id for the `Ship`"],type: "u64"}]}}],errors: [{code: 6e3,name: "IncorrectAdminAddress",msg: "Incorrect admin address."}, {code: 6001,name: "MissingRemainingAccount",msg: "An expected remaining account is missing."}, {code: 6002,name: "NoStargateConnectionsAvailable",msg: "No Stargate connections available."}, {code: 6003,name: "StargatesNotConnected",msg: "The provided Stargates are not connected."}, {code: 6004,name: "InvalidPlanetType",msg: "Invalid Planet Type."}, {code: 6005,name: "InvalidRingType",msg: "Invalid Ring Type."}, {code: 6006,name: "InvalidStarType",msg: "Invalid Star Type."}, {code: 6007,name: "InvalidOrInactiveGame",msg: "Invalid Or Inactive Game"}, {code: 6008,name: "InvalidShipSizeClass",msg: "Invalid Ship Size Class."}, {code: 6009,name: "IncorrectAccountSize",msg: "Incorrect Account Size."}, {code: 6010,name: "UpdateIdMismatch",msg: "The update_id is mismatched."}, {code: 6011,name: "AlreadyActive",msg: "The account is already active."}, {code: 6012,name: "InactiveAccount",msg: "The account is inactive."}, {code: 6013,name: "InvalidGame",msg: "The game account is invalid."}, {code: 6014,name: "InvalidGameState",msg: "The game state account is invalid."}, {code: 6015,name: "InvalidSector",msg: "The sector account is invalid."}, {code: 6016,name: "IncorrectVarsAccountAddress",msg: "Incorrect sage game_id account address."}, {code: 6017,name: "InsufficientFuel",msg: "Insufficient Fuel to complete movement"}, {code: 6018,name: "DistanceGreaterThanMax",msg: "Distance of movement is greater than the allowed maximum"}, {code: 6019,name: "NumericOverflow",msg: "Numeric overflow"}, {code: 6020,name: "InvalidLocationType",msg: "Invalid Location Type."}, {code: 6021,name: "LocationTypeNotSupported",msg: "The provided location type is not supported."}, {code: 6022,name: "IncorrectMineItem",msg: "Incorrect mine item address."}, {code: 6023,name: "IncorrectAuthorityAddress",msg: "Incorrect authority address."}, {code: 6024,name: "IncorrectResourceAddress",msg: "Incorrect resource address."}, {code: 6025,name: "IncorrectMintAuthority",msg: "Incorrect mint authority."}, {code: 6026,name: "MintAuthorityIsNone",msg: "The mint authority should exist."}, {code: 6027,name: "InvalidCurrentFleetState",msg: "The current fleet state is not valid."}, {code: 6028,name: "InvalidCurrentStarbaseState",msg: "The current starbase state is not valid."}, {code: 6029,name: "AuthorityMismatch",msg: "Authority mismatch"}, {code: 6030,name: "MintMismatch",msg: "Mint mismatch"}, {code: 6031,name: "TokenMismatch",msg: "Incorrect token address."}, {code: 6032,name: "OwnerMismatch",msg: "Owner mismatch"}, {code: 6033,name: "GameMismatch",msg: "Game ID mismatch"}, {code: 6034,name: "ProfileMismatch",msg: "Profile mismatch"}, {code: 6035,name: "SagePlayerProfileMismatch",msg: "SagePlayerProfile mismatch"}, {code: 6036,name: "StarbaseMismatch",msg: "Starbase mismatch"}, {code: 6037,name: "FactionMismatch",msg: "Faction mismatch"}, {code: 6038,name: "SeqIdMismatch",msg: "Sequence id mismatch"}, {code: 6039,name: "ShipMismatch",msg: "Ship mismatch"}, {code: 6040,name: "CargoPodMismatch",msg: "Cargo Pod mismatch"}, {code: 6041,name: "PlanetMismatch",msg: "Planet mismatch"}, {code: 6042,name: "MineItemMismatch",msg: "MineItem mismatch"}, {code: 6043,name: "LocationMismatch",msg: "Location mismatch"}, {code: 6044,name: "InvalidEscrowKey",msg: "Escrow key not found in remaining data"}, {code: 6045,name: "InvalidShipAmount",msg: "Insufficient Ship token amount"}, {code: 6046,name: "InvalidShipHangarSpaceAmount",msg: "Insufficient Ship hangar space amount"}, {code: 6047,name: "InvalidCrewAmount",msg: "Invalid crew amount"}, {code: 6048,name: "InvalidState",msg: "Invalid state"}, {code: 6049,name: "InvalidDistance",msg: "Invalid distance"}, {code: 6050,name: "NotAtCentralSpaceStation",msg: "Not at central space station"}, {code: 6051,name: "ShipNotExpected",msg: "The instruction does not expect a ship account"}, {code: 6052,name: "AddressMismatch",msg: "Address mismatch"}, {code: 6053,name: "InvalidSectorConnection",msg: "Invalid sector connection"}, {code: 6054,name: "InvalidStarbaseLevel",msg: "Invalid Starbase level"}, {code: 6055,name: "InvalidStarbaseUpgradeRecipeCategory",msg: "Invalid Starbase upgrade recipe category"}, {code: 6056,name: "HangarUpgradeNotPossible",msg: "Hangar upgrade not Possible"}, {code: 6057,name: "DisbandedFleetNotEmpty",msg: "Disbanded fleet not empty"}, {code: 6058,name: "FaultyMovement",msg: "Faulty movement"}, {code: 6059,name: "IncorrectHandleRawAccount",msg: "Incorrect Account Type for Handle Raw"}, {code: 6060,name: "InsufficientShipCargoCapacity",msg: "Insufficient Ship Cargo Capacity"}, {code: 6061,name: "FleetDoesNotNeedUpdate",msg: "Fleet does not need update"}, {code: 6062,name: "MustDisbandFleet",msg: "Must disband fleet"}, {code: 6063,name: "CannotForceDisbandFleet",msg: "Cannot force-disband fleet"}, {code: 6064,name: "ShipMismatchOrAlreadyUpdated",msg: "Ship mismatch or already updated"}, {code: 6065,name: "ShipAlreadyUpdated",msg: "Ship already updated"}, {code: 6066,name: "InvalidNextShipAddress",msg: "Invalid next ship address"}, {code: 6067,name: "InvalidShipForForcedDisband",msg: "Ship is not valid for forced disband of fleet"}, {code: 6068,name: "InvalidWarpRange",msg: "Warp range exceeded"}, {code: 6069,name: "InvalidIngredient",msg: "Invalid Ingredient"}, {code: 6070,name: "StarbaseUpgradeNotInProgress",msg: "Starbase Upgrade Not in progress"}, {code: 6071,name: "FleetNotInQueue",msg: "Fleet Not in queue"}, {code: 6072,name: "NeedCleanStarbaseUpgradeQueue",msg: "Need to clean Starbase upgrade queue"}, {code: 6073,name: "PlanetNotReachable",msg: "Planet Not Reachable"}, {code: 6074,name: "RespawnNotPossible",msg: "Respawn Not Possible"}, {code: 6075,name: "InvalidMovement",msg: "Cannot enter enemy faction's Security Zone"}, {code: 6076,name: "CargoAmountAboveZero",msg: "The Cargo Pod contains a non-zero amount of the Cargo Type"}, {code: 6077,name: "InvalidCargoPod",msg: "The Cargo Pod is invalid"}, {code: 6078,name: "InvalidZoneCoordinates",msg: "Invalid Zone Coordinates"}, {code: 6079,name: "RespawnTimeNotElapsed",msg: "Respawn time not elapsed"}, {code: 6080,name: "ActiveAccount",msg: "The Account is Active"}, {code: 6081,name: "StarbasePlayerMismatch",msg: "Starbase Player mismatch"}, {code: 6082,name: "AlreadyProcessed",msg: "The account has already been processed"}, {code: 6083,name: "InvalidAmount",msg: "The amount is invalid"}, {code: 6084,name: "WarpIsOnCooldown",msg: "Warp is on cooldown"}, {code: 6085,name: "ProgramMismatch",msg: "Program Mismatch"}, {code: 6086,name: "MustBeOnlyInstruction",msg: "Current Instruction Is Not Only Instruction"}, {code: 6087,name: "InvalidTime",msg: "Invalid Time"}, {code: 6088,name: "ScanIsOnCooldown",msg: "Scanning is on cooldown"}, {code: 6089,name: "InvalidFleetSize",msg: "Invalid Fleet Size"}, {code: 6090,name: "InactiveFeature",msg: "The feature is inactive"}, {code: 6091,name: "ZeroShipsAdded",msg: "Zero ships added to fleet"}, {code: 6092,name: "InvalidNoiseSeed",msg: "Invalid Noise Seed"}, {code: 6093,name: "InvalidType",msg: "Invalid type"}, {code: 6094,name: "RentedFleet",msg: "Rented Fleet"}, {code: 6095,name: "GenericInvalid",msg: "Generic invalid data"}]};
const cargoIDL = {version: "0.1.0",name: "cargo2",docs: ["The `cargo2` program"],instructions: [{name: "addCargo",docs: ["Adds cargo to a [`CargoPod`](state::CargoPod).", "Requires the authority to sign."],accounts: [{name: "authority",isMut: !1,isSigner: !0,docs: ["Authority for the cargo pod"]}, {name: "signerOriginAccount",isMut: !1,isSigner: !0,docs: ["Signer for Cargo Token Transfer"]}, {name: "statsDefinition",isMut: !1,isSigner: !1,docs: ["The [CargoStatsDefinition] for the cargo type"]}, {name: "cargoPod",isMut: !0,isSigner: !1,docs: ["The [CargoPod] Account"]}, {name: "cargoType",isMut: !1,isSigner: !1,docs: ["The Cargo Type Account"]}, {name: "originTokenAccount",isMut: !0,isSigner: !1,docs: ["The Origin Token Account"]}, {name: "cargoTokenAccount",isMut: !0,isSigner: !1,docs: ["The Cargo Token Account"]}, {name: "tokenProgram",isMut: !1,isSigner: !1,docs: ["Token Program"]}],args: [{name: "cargoAmount",type: "u64"}]}, {name: "closeCargoPod",docs: ["Closes the [`CargoPod`](state::CargoPod) if it has no open token accounts.", "Requires the authority to sign."],accounts: [{name: "funder",isMut: !0,isSigner: !1,docs: ["The account to return the rent"]}, {name: "authority",isMut: !1,isSigner: !0,docs: ["The authority for the pod account"]}, {name: "cargoPod",isMut: !0,isSigner: !1,docs: ["The [CargoPod] Account"]}, {name: "systemProgram",isMut: !1,isSigner: !1,docs: ["The system Program"]}],args: []}, {name: "closeTokenAccount",docs: ["Closes and burns any excess tokens in a given token account within a [`CargoPod`](state::CargoPod).", "Requires the authority to sign."],accounts: [{name: "funder",isMut: !0,isSigner: !1,docs: ["The account to return the rent"]}, {name: "authority",isMut: !1,isSigner: !0,docs: ["The authority for [CargoPod] account"]}, {name: "cargoPod",isMut: !0,isSigner: !1,docs: ["The [CargoPod] account"]}, {name: "cargoTokenAccount",isMut: !0,isSigner: !1,docs: ["The Cargo Token Account"]}, {name: "cargoType",isMut: !1,isSigner: !1,docs: ["The Cargo Type Account", "If the token account belongs to a registered Cargo Type then this account must be a valid Cargo Type", "However, to allow closing token account that are not valid Cargo this is an unchecked account"]}, {name: "mint",isMut: !0,isSigner: !1,docs: ["The Token Mint"]}, {name: "tokenProgram",isMut: !1,isSigner: !1,docs: ["The Token Program"]}],args: []}, {name: "consumeCargo",docs: ["Consumes cargo from a [`CargoPod`](state::CargoPod), burning the amount.", "Requires the authority to sign."],accounts: [{name: "authority",isMut: !1,isSigner: !0,docs: ["Authority for the cargo pod"]}, {name: "statsDefinition",isMut: !1,isSigner: !1,docs: ["The [CargoStatsDefinition] for the cargo type"]}, {name: "cargoPod",isMut: !0,isSigner: !1,docs: ["The [CargoPod] Account"]}, {name: "cargoType",isMut: !1,isSigner: !1,docs: ["The Cargo Type Account"]}, {name: "cargoTokenAccount",isMut: !0,isSigner: !1,docs: ["The Cargo Token Account"]}, {name: "tokenMint",isMut: !0,isSigner: !1,docs: ["Token Mint"]}, {name: "tokenProgram",isMut: !1,isSigner: !1,docs: ["Token Program"]}],args: [{name: "cargoAmount",type: "u64"}]}, {name: "initCargoPod",docs: ["Inits a new [`CargoPod`](state::CargoPod) account for the given [`CargoStatsDefinition`](state::CargoStatsDefinition) and authority."],accounts: [{name: "funder",isMut: !0,isSigner: !0,docs: ["The funder for the new cargo pod"]}, {name: "authority",isMut: !1,isSigner: !0,docs: ["The authority for the new cargo pod"]}, {name: "cargoPod",isMut: !0,isSigner: !1,docs: ["The new cargo pod"]}, {name: "statsDefinition",isMut: !1,isSigner: !1,docs: ["The definition of tracked stats"]}, {name: "systemProgram",isMut: !1,isSigner: !1,docs: ["The system program"]}],args: [{name: "podSeeds",type: {array: ["u8", 32]}}]}, {name: "initCargoType",docs: ["Inits a new [`CargoType`](state::CargoType) account for the given [`CargoStatsDefinition`](state::CargoStatsDefinition)."],accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key authorized for this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The cargo permissions [`Profile`].", "Is going to act as the authority for the new definition."]}, {name: "funder",isMut: !0,isSigner: !0,docs: ["The funder for the cargo type"]}, {name: "mint",isMut: !1,isSigner: !1,docs: ["The mint for the new cargo type"]}, {name: "statsDefinition",isMut: !1,isSigner: !1,docs: ["The definition for the cargo type"]}, {name: "cargoType",isMut: !0,isSigner: !1,docs: ["The cargo type to init"]}, {name: "systemProgram",isMut: !1,isSigner: !1,docs: ["The system program"]}],args: [{name: "input",type: {defined: "InitCargoTypeInput"}}]}, {name: "initCargoTypeForNextSeqId",docs: ["Creates a new cargo type for the next `seq_id`."],accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key authorized for this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The cargo permissions [`Profile`].", "Is going to act as the authority for the new definition."]}, {name: "funder",isMut: !0,isSigner: !0,docs: ["The funder for the cargo type"]}, {name: "mint",isMut: !1,isSigner: !1,docs: ["The mint for the new cargo type"]}, {name: "statsDefinition",isMut: !1,isSigner: !1,docs: ["The definition for the cargo type"]}, {name: "cargoType",isMut: !0,isSigner: !1,docs: ["The cargo type to init"]}, {name: "systemProgram",isMut: !1,isSigner: !1,docs: ["The system program"]}],args: [{name: "input",type: {defined: "InitCargoTypeInput"}}]}, {name: "initCargoTypeFromOldCargoType",docs: ["Creates a new cargo type for the next `seq_id` from a given cargo type."],accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key authorized for this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The cargo permissions [`Profile`].", "Is going to act as the authority for the new definition."]}, {name: "funder",isMut: !0,isSigner: !0,docs: ["The funder for the cargo type"]}, {name: "statsDefinition",isMut: !1,isSigner: !1,docs: ["The definition for the cargo type"]}, {name: "oldCargoType",isMut: !1,isSigner: !1,docs: ["The old Cargo Type Account"]}, {name: "cargoType",isMut: !0,isSigner: !1,docs: ["The cargo type to init"]}, {name: "systemProgram",isMut: !1,isSigner: !1,docs: ["The system program"]}],args: [{name: "input",type: {defined: "InitCargoTypeFromOldCargoTypeInput"}}]}, {name: "initDefinition",docs: ["Inits a [`CargoStatsDefinition`](state::CargoStatsDefinition) account."],accounts: [{name: "profile",isMut: !1,isSigner: !1,docs: ["The cargo permissions [`Profile`](Profile).", "Is going to act as the authority for the new definition."]}, {name: "funder",isMut: !0,isSigner: !0,docs: ["The funder for the new definition"]}, {name: "statsDefinition",isMut: !0,isSigner: !0,docs: ["The new definition"]}, {name: "systemProgram",isMut: !1,isSigner: !1,docs: ["The system program"]}],args: [{name: "input",type: {defined: "InitDefinitionInput"}}]}, {name: "legitimizeCargo",docs: ["Legitimizes cargo in a [`CargoPod`](state::CargoPod) that was added outside of [`add_cargo`] or other cargo ix.", "Requires the authority to sign."],accounts: [{name: "authority",isMut: !1,isSigner: !0,docs: ["Authority for the cargo pod"]}, {name: "statsDefinition",isMut: !1,isSigner: !1,docs: ["The [CargoStatsDefinition] for the cargo type"]}, {name: "cargoPod",isMut: !0,isSigner: !1,docs: ["The [CargoPod] Account"]}, {name: "cargoType",isMut: !1,isSigner: !1,docs: ["The Cargo Type Account"]}, {name: "cargoTokenAccount",isMut: !0,isSigner: !1,docs: ["The Cargo Token Account"]}, {name: "tokenProgram",isMut: !1,isSigner: !1,docs: ["Token Program"]}],args: [{name: "cargoAmount",type: "u64"}]}, {name: "mintTo",docs: ["Mints tokens directly to a [`CargoPod`](state::CargoPod).", "Requires the authority to sign."],accounts: [{name: "authority",isMut: !1,isSigner: !0,docs: ["Authority for the [`CargoPod`] Account"]}, {name: "mintAuthority",isMut: !1,isSigner: !0,docs: ["The mint Authority"]}, {name: "statsDefinition",isMut: !1,isSigner: !1,docs: ["The [CargoStatsDefinition] for the cargo type"]}, {name: "cargoPod",isMut: !0,isSigner: !1,docs: ["The [`CargoPod`] Account"]}, {name: "cargoType",isMut: !1,isSigner: !1,docs: ["The [`CargoType`] Account"]}, {name: "cargoTokenAccount",isMut: !0,isSigner: !1,docs: ["The Cargo Token Account"]}, {name: "tokenMint",isMut: !0,isSigner: !1,docs: ["The Cargo token mint"]}, {name: "tokenProgram",isMut: !1,isSigner: !1,docs: ["Token Program"]}],args: [{name: "mintAmount",type: "u64"}]}, {name: "removeCargo",docs: ["Removes cargo from a [`CargoPod`](state::CargoPod) to a given token account.", "Requires the authority to sign."],accounts: [{name: "authority",isMut: !1,isSigner: !0,docs: ["Authority for the cargo pod"]}, {name: "statsDefinition",isMut: !1,isSigner: !1,docs: ["The [CargoStatsDefinition] for the cargo type"]}, {name: "cargoPod",isMut: !0,isSigner: !1,docs: ["The [CargoPod] Account"]}, {name: "cargoType",isMut: !1,isSigner: !1,docs: ["The Cargo Type Account"]}, {name: "destinationTokenAccount",isMut: !0,isSigner: !1,docs: ["The Destination Token Account"]}, {name: "cargoTokenAccount",isMut: !0,isSigner: !1,docs: ["Cargo Token Account"]}, {name: "tokenProgram",isMut: !1,isSigner: !1,docs: ["Token Program"]}],args: [{name: "cargoAmount",type: "u64"}]}, {name: "transferAuthority",docs: ["Transfers authority of a [`CargoPod`](state::CargoPod) to a new authority.", "Requires both authorities to sign."],accounts: [{name: "originPodAuthority",isMut: !1,isSigner: !0,docs: ["Authority for the cargo pod"]}, {name: "newPodAuthority",isMut: !1,isSigner: !0,docs: ["New authority for the cargo pod"]}, {name: "cargoPod",isMut: !0,isSigner: !1,docs: ["The [CargoPod] Account"]}],args: []}, {name: "transferCargo",docs: ["Transfers cargo between [`CargoPod`](state::CargoPod)s.", "Requires both authorities to sign."],accounts: [{name: "originPodAuthority",isMut: !1,isSigner: !0,docs: ["Authority for the origin cargo pod"]}, {name: "destinationPodAuthority",isMut: !1,isSigner: !0,docs: ["Authority for the destination cargo pod"]}, {name: "statsDefinition",isMut: !1,isSigner: !1,docs: ["The [CargoStatsDefinition] for the cargo type"]}, {name: "originCargoPod",isMut: !0,isSigner: !1,docs: ["The Origin [CargoPod] Account"]}, {name: "destinationCargoPod",isMut: !0,isSigner: !1,docs: ["The Destination [CargoPod] Account"]}, {name: "cargoType",isMut: !1,isSigner: !1,docs: ["The Cargo Type Account"]}, {name: "originTokenAccount",isMut: !0,isSigner: !1,docs: ["The Origin Token Account"]}, {name: "destinationTokenAccount",isMut: !0,isSigner: !1,docs: ["The Destination Token Account"]}, {name: "tokenProgram",isMut: !1,isSigner: !1,docs: ["Token Program"]}],args: [{name: "cargoAmount",type: "u64"}]}, {name: "updateCargoPod",docs: ["Updates a [`CargoPod`](state::CargoPod) account to have the newest sequence id from the [`CargoDefinition`](state::CargoStatsDefinition).", "This is the first step to update a [`CargoPod`](state::CargoPod) to a new [`CargoStatsDefinition`](state::CargoStatsDefinition).", "Permissionless function."],accounts: [{name: "cargoPod",isMut: !0,isSigner: !1,docs: ["The cargo pod to update"]}, {name: "statsDefinition",isMut: !1,isSigner: !1,docs: ["The definition of tracked stats"]}],args: []}, {name: "updateDefinition",docs: ["Updates a [`CargoStatsDefinition`](state::CargoStatsDefinition) account.", "Will advance the `seq_id` unless `rollback` is set to true."],accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key authorized for this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The cargo permissions [`Profile`](Profile).", "Is going to act as the authority for the new definition."]}, {name: "statsDefinition",isMut: !0,isSigner: !1,docs: ["The [CargoStatsDefinition]"]}],args: [{name: "input",type: {defined: "UpdateDefinitionInput"}}]}, {name: "updatePodTokenAccount",docs: ["Updates a [`CargoPod`](state::CargoPod)s token account to have the same sequence id as the [`CargoPod`](state::CargoPod).", "This must be called after [`update_cargo_pod`].", "Permissionless function."],accounts: [{name: "statsDefinition",isMut: !1,isSigner: !1,docs: ["The [CargoStatsDefinition] for the cargo type"]}, {name: "cargoPod",isMut: !0,isSigner: !1,docs: ["The [CargoPod] Account"]}, {name: "oldCargoType",isMut: !1,isSigner: !1,docs: ["The previous version(`seq_id`) Cargo Type"]}, {name: "cargoType",isMut: !1,isSigner: !1,docs: ["The updated Cargo Type Account"]}, {name: "cargoTokenAccount",isMut: !0,isSigner: !1,docs: ["The Cargo Token Account"]}, {name: "tokenProgram",isMut: !1,isSigner: !1,docs: ["Token Program"]}],args: []}],accounts: [{name: "cargoPod",docs: ["A pod that can store any number of resources and tracks stats given a definition."],type: {kind: "struct",fields: [{name: "version",docs: ["The data version of this account."],type: "u8"}, {name: "statsDefinition",docs: ["The definition of tracked stats."],type: "publicKey"}, {name: "authority",docs: ["The authority for this pod."],type: "publicKey"}, {name: "openTokenAccounts",docs: ["The number of open token accounts in this pod."],type: "u8"}, {name: "podSeeds",docs: ["The seeds of the signer for this pod."],type: {array: ["u8", 32]}}, {name: "podBump",docs: ["The bump of the signer for this pod."],type: "u8"}, {name: "seqId",docs: ["The sequence id for the definition"],type: "u16"}, {name: "unupdatedTokenAccounts",docs: ["The number of unupdated token accounts in this pod. If this is greater than zero means the pod is frozen and only can withdraw cargo but not deposit."],type: "u8"}]}}, {name: "cargoStatsDefinition",docs: ["A definition of cargo stats."],type: {kind: "struct",fields: [{name: "version",docs: ["The data version of this account."],type: "u8"}, {name: "authority",docs: ["The authority for this definition."],type: "publicKey"}, {name: "defaultCargoType",docs: ["The default cargo type. System program (all 0s) if none."],type: "publicKey"}, {name: "statsCount",docs: ["The number of stats in this definition."],type: "u16"}, {name: "seqId",docs: ["The sequence id for the definition"],type: "u16"}]}}, {name: "cargoType",docs: ["The stats for a given cargo type (token mint)."],type: {kind: "struct",fields: [{name: "version",docs: ["The data version of this account."],type: "u8"}, {name: "statsDefinition",docs: ["The definition this follows"],type: "publicKey"}, {name: "mint",docs: ["The mint the cargo type is for"],type: "publicKey"}, {name: "creator",docs: ["TODO: remove this"],type: "publicKey"}, {name: "bump",docs: ["The bump for this account"],type: "u8"}, {name: "statsCount",docs: ["The number of stats in this definition."],type: "u16"}, {name: "seqId",docs: ["The sequence id for the definition"],type: "u16"}]}}],types: [{name: "InitCargoTypeFromOldCargoTypeInput",docs: ["Struct for data input for this IX"],type: {kind: "struct",fields: [{name: "keyIndex",docs: ["the index of the key in the cargo permissions profile"],type: "u16"}, {name: "newValues",docs: ["vector with values for all stats tracked by the definition"],type: {option: {vec: "u64"}}}]}}, {name: "InitCargoTypeInput",docs: ["Struct for data input for this IX"],type: {kind: "struct",fields: [{name: "keyIndex",docs: ["the index of the key in the cargo permissions profile"],type: "u16"}, {name: "values",docs: ["vector with values for all stats tracked by the definition"],type: {vec: "u64"}}]}}, {name: "InitDefinitionInput",docs: ["Struct for data input for [`InitDefinition`]"],type: {kind: "struct",fields: [{name: "cargoStats",docs: ["the count of stats the definition has"],type: "u16"}]}}, {name: "UpdateDefinitionInput",docs: ["Struct for data input for this IX"],type: {kind: "struct",fields: [{name: "keyIndex",docs: ["the index of the key in the cargo permissions profile"],type: "u16"}, {name: "rollback",docs: ["flag that if present means we need to decrease the definition seq_id"],type: {option: "bool"}}]}}],errors: [{code: 6e3,name: "StatOutOfBounds",msg: "A given stat was out of bounds"}, {code: 6001,name: "TooManyStats",msg: "There are too many stats"}, {code: 6002,name: "InvalidRentFunder",msg: "Rent funder was not owned by the system program or this program"}, {code: 6003,name: "TooFewStats",msg: "Popped a stat when there are no stats left"}, {code: 6004,name: "MissingSystemProgram",msg: "System program is missing when needed"}, {code: 6005,name: "InvalidCargoStat",msg: "Cargo stat data was invalid"}, {code: 6006,name: "InvalidCargoStatSize",msg: "Cargo stat size data was invalid"}, {code: 6007,name: "InvalidCargoType",msg: "Cargo type is invalid"}, {code: 6008,name: "WrongNumberOfDefinitions",msg: "Wrong number of definitions provided to init a cargo type"}, {code: 6009,name: "InvalidValueForStat",msg: "Invalid value provided for stat"}, {code: 6010,name: "NumericOverflow",msg: "Math overflow"}, {code: 6011,name: "AuthorityMismatch",msg: "Authority mismatch"}, {code: 6012,name: "StatsDefinitionMismatch",msg: "Stats definition mismatch"}, {code: 6013,name: "MintMismatch",msg: "Mint mismatch"}, {code: 6014,name: "OwnerMismatch",msg: "Owner mismatch"}, {code: 6015,name: "InvalidDelegation",msg: "Delegated amount is invalid"}, {code: 6016,name: "FrozenPod",msg: "The pod is frozen"}, {code: 6017,name: "UnupdatedCargoPodAccount",msg: "Unupdated CargoPod Account"}, {code: 6018,name: "InvalidSeqId",msg: "Invalid seq_id"}, {code: 6019,name: "UnupdatedTokenAccount",msg: "Unupdated token account"}, {code: 6020,name: "OpenTokenAccounts",msg: "Cargo Pod has token accounts open"}, {code: 6021,name: "NonZeroDelegation",msg: "Non Zero Delegated Amount"}, {code: 6022,name: "InvalidPreviousType",msg: "Invalid previous cargo_type account"}, {code: 6023,name: "InsufficientCargoAmount",msg: "Insufficient cargo amount"}, {code: 6024,name: "InsufficientTokenAmount",msg: "Insufficient token amount"}, {code: 6025,name: "PodTokenAccountAlreadyUpdated",msg: "Pod Token Account Already Updated"}]};
const craftingIDL = {version: "0.1.0",name: "crafting2",instructions: [{name: "addConsumableInputToRecipe",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key authorized for this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The crafting permissions [`Profile`]"]}, {name: "funder",isMut: !0,isSigner: !0,docs: ["The funder - pays for account rent"]}, {name: "recipe",isMut: !0,isSigner: !1,docs: ["The [Recipe] account"]}, {name: "domain",isMut: !1,isSigner: !1,docs: ["The [Domain] account"]}, {name: "mint",isMut: !1,isSigner: !1,docs: ["The Mint Account"]}, {name: "systemProgram",isMut: !1,isSigner: !1,docs: ["The System program"]}],args: [{name: "input",type: {defined: "RecipeIngredients"}}]}, {name: "addCraftingFacilityRecipeCategory",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key authorized for this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The crafting permissions [`Profile`]"]}, {name: "funder",isMut: !0,isSigner: !0,docs: ["The funder - pays for account rent"]}, {name: "recipeCategory",isMut: !1,isSigner: !1,docs: ["The [`RecipeCategory`] account"]}, {name: "craftingFacility",isMut: !0,isSigner: !1,docs: ["The [`CraftingFacility`] account"]}, {name: "domain",isMut: !1,isSigner: !1,docs: ["the [Domain] account"]}, {name: "systemProgram",isMut: !1,isSigner: !1,docs: ["The Solana System program"]}],args: [{name: "input",type: {defined: "KeyIndexInput"}}]}, {name: "addNonConsumableInputToRecipe",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key authorized for this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The crafting permissions [`Profile`]"]}, {name: "funder",isMut: !0,isSigner: !0,docs: ["The funder - pays for account rent"]}, {name: "recipe",isMut: !0,isSigner: !1,docs: ["The [Recipe] account"]}, {name: "domain",isMut: !1,isSigner: !1,docs: ["The [Domain] account"]}, {name: "mint",isMut: !1,isSigner: !1,docs: ["The Cargo Type Account"]}, {name: "systemProgram",isMut: !1,isSigner: !1,docs: ["The System program"]}],args: [{name: "input",type: {defined: "RecipeIngredients"}}]}, {name: "addOutputToRecipe",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key authorized for this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The crafting permissions [`Profile`]"]}, {name: "funder",isMut: !0,isSigner: !0,docs: ["The funder - pays for account rent"]}, {name: "recipe",isMut: !0,isSigner: !1,docs: ["The [Recipe] account"]}, {name: "domain",isMut: !1,isSigner: !1,docs: ["The [Domain] account"]}, {name: "craftableItem",isMut: !1,isSigner: !1,docs: ["The Craftable Item that the output represents"]}, {name: "systemProgram",isMut: !1,isSigner: !1,docs: ["The System program"]}],args: [{name: "input",type: {defined: "RecipeIngredients"}}]}, {name: "addRecipeIngredient",accounts: [{name: "location",isMut: !1,isSigner: !0,docs: ["The entity calling this instruction, this is the Crafting Facilitys location", "Having the location as the signer is an implicit check that this is the correct location"]}, {name: "authority",isMut: !1,isSigner: !0,docs: ["The [`CraftingProcess`] authority"]}, {name: "craftingProcess",isMut: !0,isSigner: !1,docs: ["The [`CraftingProcess`] account"]}, {name: "recipe",isMut: !1,isSigner: !1,docs: ["The [`Recipe`] account"]}, {name: "craftingFacility",isMut: !1,isSigner: !1,docs: ["The [`CraftingFacility`] account"]}, {name: "tokenFrom",isMut: !0,isSigner: !1,docs: ["The recipe ingredient token account."]}, {name: "tokenTo",isMut: !0,isSigner: !1,docs: ["The token account owned by the `crafting_process` which holds the ingredient in escrow"]}, {name: "tokenProgram",isMut: !1,isSigner: !1,docs: ["The [Token] program"]}],args: [{name: "input",type: {defined: "AddRecipeIngredientInput"}}]}, {name: "burnConsumableIngredient",accounts: [{name: "craftingProcess",isMut: !0,isSigner: !1,docs: ["The [`CraftingProcess`] account"]}, {name: "recipe",isMut: !1,isSigner: !1,docs: ["The [`Recipe`] account"]}, {name: "tokenFrom",isMut: !0,isSigner: !1,docs: ["The token account owned by the `crafting_process` which holds the ingredient in escrow"]}, {name: "mint",isMut: !0,isSigner: !1,docs: ["The mint of the consumable recipe ingredient"]}, {name: "tokenProgram",isMut: !1,isSigner: !1,docs: ["The [Token] program"]}],args: [{name: "input",type: {defined: "BurnConsumableIngredientInput"}}]}, {name: "cancelCraftingProcess",accounts: [{name: "location",isMut: !1,isSigner: !0,docs: ["The entity calling this instruction, this is the Crafting Facilitys location", "Having the location as the signer is an implicit check that this is the correct location"]}, {name: "authority",isMut: !1,isSigner: !0,docs: ["The [`CraftingProcess`] authority"]}, {name: "fundsTo",isMut: !0,isSigner: !1,docs: ["The funds_to - receives rent refund"]}, {name: "craftingProcess",isMut: !0,isSigner: !1,docs: ["The [`CraftingProcess`] account"]}, {name: "craftingFacility",isMut: !0,isSigner: !1,docs: ["The [`CraftingFacility`] account"]}],args: []}, {name: "claimNonConsumableIngredient",accounts: [{name: "authority",isMut: !1,isSigner: !1,docs: ["The owner/authority of crafting_process account"]}, {name: "craftingProcess",isMut: !0,isSigner: !1,docs: ["The [`CraftingProcess`] account"]}, {name: "recipe",isMut: !1,isSigner: !1,docs: ["The [`Recipe`] account"]}, {name: "tokenFrom",isMut: !0,isSigner: !1,docs: ["The token account owned by the `crafting_process` which holds the ingredient in escrow"]}, {name: "tokenTo",isMut: !0,isSigner: !1,docs: ["The token account to receive the non-consumable ingredient."]}, {name: "mint",isMut: !0,isSigner: !1,docs: ["The mint of the recipe ingredient"]}, {name: "tokenProgram",isMut: !1,isSigner: !1,docs: ["The [Token] program"]}],args: [{name: "input",type: {defined: "ClaimNonConsumableIngredientInput"}}]}, {name: "claimRecipeOutput",accounts: [{name: "authority",isMut: !1,isSigner: !1,docs: ["The owner/authority of crafting_process account"]}, {name: "craftingProcess",isMut: !0,isSigner: !1,docs: ["The [`CraftingProcess`] account"]}, {name: "recipe",isMut: !1,isSigner: !1,docs: ["The [`Recipe`] account"]}, {name: "tokenFrom",isMut: !0,isSigner: !1,docs: ["The token account owned by `craftable_item`."]}, {name: "tokenTo",isMut: !0,isSigner: !1,docs: ["The recipe ingredient token account."]}, {name: "craftableItem",isMut: !1,isSigner: !1,docs: ["The craftable_item (this is also the mint authority)"]}, {name: "tokenProgram",isMut: !1,isSigner: !1,docs: ["The [Token] program"]}],args: [{name: "input",type: {defined: "ClaimRecipeOutputInput"}}]}, {name: "closeCraftingProcess",accounts: [{name: "authority",isMut: !1,isSigner: !0,docs: ["The [`CraftingProcess`] authority"]}, {name: "fundsTo",isMut: !0,isSigner: !1,docs: ["The funds_to - receives rent refund"]}, {name: "craftingProcess",isMut: !0,isSigner: !1,docs: ["The [`CraftingProcess`] account"]}, {name: "recipe",isMut: !1,isSigner: !1,docs: ["The [`Recipe`] account"]}, {name: "craftingFacility",isMut: !0,isSigner: !1,docs: ["The [`CraftingFacility`] account"]}],args: []}, {name: "createCraftingProcess",accounts: [{name: "location",isMut: !1,isSigner: !0,docs: ["The entity calling this instruction, this is the Crafting Facilitys location", "Having the location as the signer is an implicit check that this is the correct location"]}, {name: "authority",isMut: !1,isSigner: !0,docs: ["The owner/authority for the new crafting_process account"]}, {name: "funder",isMut: !0,isSigner: !0,docs: ["The funder - pays for account rent"]}, {name: "craftingProcess",isMut: !0,isSigner: !1,docs: ["The [`CraftingProcess`] account"]}, {name: "recipe",isMut: !1,isSigner: !1,docs: ["The [`Recipe`] account"]}, {name: "craftingFacility",isMut: !0,isSigner: !1,docs: ["The [`CraftingFacility`] account"]}, {name: "systemProgram",isMut: !1,isSigner: !1,docs: ["Solana System program"]}],args: [{name: "input",type: {defined: "CreateCraftingProcessInput"}}]}, {name: "deregisterCraftingFacility",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key authorized for this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The crafting permissions [`Profile`]"]}, {name: "fundsTo",isMut: !0,isSigner: !1,docs: ["The funds_to - receives rent refund"]}, {name: "craftingFacility",isMut: !0,isSigner: !1,docs: ["The [`CraftingFacility`] account"]}, {name: "domain",isMut: !1,isSigner: !1,docs: ["the [Domain] account"]}],args: [{name: "input",type: {defined: "KeyIndexInput"}}]}, {name: "deregisterRecipeCategory",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key authorized for this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The crafting permissions [`Profile`]"]}, {name: "fundsTo",isMut: !0,isSigner: !1,docs: ["The funds_to - receives rent refund"]}, {name: "recipeCategory",isMut: !0,isSigner: !1,docs: ["The [RecipeCategory] account"]}, {name: "domain",isMut: !1,isSigner: !1,docs: ["the [Domain] account"]}, {name: "systemProgram",isMut: !1,isSigner: !1,docs: ["Solana System program"]}],args: [{name: "input",type: {defined: "KeyIndexInput"}}]}, {name: "drainCraftableItemBank",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key authorized for this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The crafting permissions [`Profile`]"]}, {name: "fundsTo",isMut: !0,isSigner: !1,docs: ["The funds_to - receives rent refund"]}, {name: "craftableItem",isMut: !0,isSigner: !1,docs: ["The Craftable Item account"]}, {name: "domain",isMut: !1,isSigner: !1,docs: ["the [omain account"]}, {name: "tokenFrom",isMut: !0,isSigner: !1,docs: ["The craftable item token bank to drain"]}, {name: "tokenTo",isMut: !0,isSigner: !1,docs: ["Where to send tokens from the bank"]}, {name: "tokenProgram",isMut: !1,isSigner: !1,docs: ["The token program"]}],args: [{name: "input",type: {defined: "KeyIndexInput"}}]}, {name: "initializeDomain",accounts: [{name: "signer",isMut: !0,isSigner: !0,docs: ["The entity calling this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The [`Profile`] that handles the crafting program permissions"]}, {name: "funder",isMut: !0,isSigner: !0,docs: ["The funder - pays for account rent"]}, {name: "domain",isMut: !0,isSigner: !0,docs: ["The [Domain] account"]}, {name: "systemProgram",isMut: !1,isSigner: !1,docs: ["Solana System program"]}],args: [{name: "namespace",type: {array: ["u8", 32]}}]}, {name: "legitimizeRecipeIngredient",accounts: [{name: "location",isMut: !1,isSigner: !0,docs: ["The entity calling this instruction, this is the Crafting Facilitys location", "Having the location as the signer is an implicit check that this is the correct location"]}, {name: "authority",isMut: !1,isSigner: !0,docs: ["The [`CraftingProcess`] authority"]}, {name: "craftingProcess",isMut: !0,isSigner: !1,docs: ["The [`CraftingProcess`] account"]}, {name: "recipe",isMut: !1,isSigner: !1,docs: ["The [`Recipe`] account"]}, {name: "craftingFacility",isMut: !1,isSigner: !1,docs: ["The [`CraftingFacility`] account"]}, {name: "tokenTo",isMut: !0,isSigner: !1,docs: ["The token account owned by the `crafting_process` which holds the ingredient in escrow"]}, {name: "tokenProgram",isMut: !1,isSigner: !1,docs: ["The [Token] program"]}],args: [{name: "input",type: {defined: "LegitimizeRecipeIngredientInput"}}]}, {name: "registerCraftableItem",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key authorized for this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The crafting permissions [`Profile`]"]}, {name: "funder",isMut: !0,isSigner: !0,docs: ["The funder - pays for account rent"]}, {name: "mint",isMut: !0,isSigner: !1,docs: ["The mint of the Craftable Item to be registered"]}, {name: "craftableItem",isMut: !0,isSigner: !1,docs: ["The Craftable Item to be registered"]}, {name: "domain",isMut: !1,isSigner: !1,docs: ["the [Domain] account"]}, {name: "systemProgram",isMut: !1,isSigner: !1,docs: ["The Solana System program"]}],args: [{name: "input",type: {defined: "RegisterCraftableItemInput"}}]}, {name: "registerCraftingFacility",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key authorized for this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The crafting permissions [`Profile`]"]}, {name: "funder",isMut: !0,isSigner: !0,docs: ["The funder - pays for account rent"]}, {name: "craftingFacility",isMut: !0,isSigner: !0,docs: ["The [`CraftingFacility`] account"]}, {name: "domain",isMut: !1,isSigner: !1,docs: ["the [Domain] account"]}, {name: "location",isMut: !1,isSigner: !1,docs: ["The Location address"]}, {name: "systemProgram",isMut: !1,isSigner: !1,docs: ["The Solana System program"]}],args: [{name: "input",type: {defined: "RegisterCraftingFacilityInput"}}]}, {name: "registerRecipe",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key authorized for this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The crafting permissions [`Profile`]"]}, {name: "funder",isMut: !0,isSigner: !0,docs: ["The funder - pays for account rent"]}, {name: "recipe",isMut: !0,isSigner: !0,docs: ["The [Recipe] account"]}, {name: "recipeCategory",isMut: !0,isSigner: !1,docs: ["The [RecipeCategory] account"]}, {name: "domain",isMut: !1,isSigner: !1,docs: ["The [Domain] account"]}, {name: "systemProgram",isMut: !1,isSigner: !1,docs: ["The Solana System program"]}],args: [{name: "input",type: {defined: "RegisterRecipeInput"}}]}, {name: "registerRecipeCategory",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key authorized for this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The crafting permissions [`Profile`]"]}, {name: "funder",isMut: !0,isSigner: !0,docs: ["The funder - pays for account rent"]}, {name: "recipeCategory",isMut: !0,isSigner: !0,docs: ["The [RecipeCategory] account"]}, {name: "domain",isMut: !1,isSigner: !1,docs: ["the [Domain] account"]}, {name: "systemProgram",isMut: !1,isSigner: !1,docs: ["Solana System program"]}],args: [{name: "input",type: {defined: "RegisterRecipeCategoryInput"}}]}, {name: "removeConsumableInputFromRecipe",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key authorized for this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The crafting permissions [`Profile`]"]}, {name: "funder",isMut: !0,isSigner: !0,docs: ["The funder - pays for account rent"]}, {name: "recipe",isMut: !0,isSigner: !1,docs: ["The [Recipe] account"]}, {name: "domain",isMut: !1,isSigner: !1,docs: ["The [Domain] account"]}, {name: "systemProgram",isMut: !1,isSigner: !1,docs: ["The System program"]}],args: [{name: "input",type: {defined: "RemoveRecipeIngredients"}}]}, {name: "removeCraftingFacilityRecipeCategory",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key authorized for this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The crafting permissions [`Profile`]"]}, {name: "funder",isMut: !0,isSigner: !0,docs: ["The funder - pays for account rent"]}, {name: "recipeCategory",isMut: !1,isSigner: !1,docs: ["The recipe category to remove."]}, {name: "craftingFacility",isMut: !0,isSigner: !1,docs: ["The [`CraftingFacility`] account"]}, {name: "domain",isMut: !1,isSigner: !1,docs: ["the [Domain] account"]}, {name: "systemProgram",isMut: !1,isSigner: !1,docs: ["The Solana System program"]}],args: [{name: "input",type: {defined: "RemoveCraftingFacilityRecipeCategoryInput"}}]}, {name: "removeNonConsumableInputFromRecipe",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key authorized for this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The crafting permissions [`Profile`]"]}, {name: "funder",isMut: !0,isSigner: !0,docs: ["The funder - pays for account rent"]}, {name: "recipe",isMut: !0,isSigner: !1,docs: ["The [Recipe] account"]}, {name: "domain",isMut: !1,isSigner: !1,docs: ["The [Domain] account"]}, {name: "systemProgram",isMut: !1,isSigner: !1,docs: ["The System program"]}],args: [{name: "input",type: {defined: "RemoveRecipeIngredients"}}]}, {name: "removeOutputFromRecipe",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key authorized for this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The crafting permissions [`Profile`]"]}, {name: "funder",isMut: !0,isSigner: !0,docs: ["The funder - pays for account rent"]}, {name: "recipe",isMut: !0,isSigner: !1,docs: ["The [Recipe] account"]}, {name: "domain",isMut: !1,isSigner: !1,docs: ["The [Domain] account"]}, {name: "systemProgram",isMut: !1,isSigner: !1,docs: ["The System program"]}],args: [{name: "input",type: {defined: "RemoveRecipeIngredients"}}]}, {name: "removeRecipeIngredient",accounts: [{name: "location",isMut: !1,isSigner: !0,docs: ["The entity calling this instruction, this is the Crafting Facilitys location", "Having the location as the signer is an implicit check that this is the correct location"]}, {name: "authority",isMut: !1,isSigner: !0,docs: ["The [`CraftingProcess`] authority"]}, {name: "craftingProcess",isMut: !0,isSigner: !1,docs: ["The [`CraftingProcess`] account"]}, {name: "recipe",isMut: !1,isSigner: !1,docs: ["The [`Recipe`] account"]}, {name: "craftingFacility",isMut: !1,isSigner: !1,docs: ["The [`CraftingFacility`] account"]}, {name: "tokenFrom",isMut: !0,isSigner: !1,docs: ["The token account owned by the `crafting_process` which holds the ingredient in escrow"]}, {name: "tokenTo",isMut: !0,isSigner: !1,docs: ["The token account that receives the recipe ingredient."]}, {name: "mint",isMut: !0,isSigner: !1,docs: ["The mint of the recipe ingredient"]}, {name: "tokenProgram",isMut: !1,isSigner: !1,docs: ["The [`Token`] program"]}],args: [{name: "input",type: {defined: "RemoveRecipeIngredientInput"}}]}, {name: "startCraftingProcess",accounts: [{name: "location",isMut: !1,isSigner: !0,docs: ["The entity calling this instruction, this is the Crafting Facilitys location", "Having the location as the signer is an implicit check that this is the correct location"]}, {name: "craftingProcess",isMut: !0,isSigner: !1,docs: ["The [`CraftingProcess`] account"]}, {name: "recipe",isMut: !0,isSigner: !1,docs: ["The [`Recipe`] account"]}, {name: "craftingFacility",isMut: !1,isSigner: !1,docs: ["The [`CraftingFacility`] account"]}],args: [{name: "input",type: {defined: "StartCraftingProcessInput"}}]}, {name: "stopCraftingProcess",accounts: [{name: "location",isMut: !1,isSigner: !0,docs: ["The entity calling this instruction, this is the Crafting Facilitys location", "Having the location as the signer is an implicit check that this is the correct location"]}, {name: "craftingProcess",isMut: !0,isSigner: !1,docs: ["The [`CraftingProcess`] account"]}, {name: "recipe",isMut: !0,isSigner: !1,docs: ["The [`Recipe`] account"]}, {name: "craftingFacility",isMut: !1,isSigner: !1,docs: ["The [`CraftingFacility`] account"]}],args: [{name: "input",type: {defined: "StopCraftingProcessInput"}}]}, {name: "updateCraftingFacility",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key authorized for this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The crafting permissions [`Profile`]"]}, {name: "craftingFacility",isMut: !0,isSigner: !1,docs: ["The [`CraftingFacility`] account"]}, {name: "domain",isMut: !1,isSigner: !1,docs: ["the [Domain] account"]}],args: [{name: "input",type: {defined: "UpdateCraftingFacilityInput"}}]}, {name: "updateDomain",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key authorized for this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The crafting permissions [`Profile`]"]}, {name: "newProfile",isMut: !1,isSigner: !1,docs: ["The new crafting permissions profile"]}, {name: "domain",isMut: !0,isSigner: !1,docs: ["the [Domain] account"]}],args: [{name: "input",type: {defined: "KeyIndexInput"}}]}, {name: "updateRecipe",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key authorized for this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The crafting permissions [`Profile`]"]}, {name: "recipe",isMut: !0,isSigner: !1,docs: ["The [Recipe] to update"]}, {name: "domain",isMut: !1,isSigner: !1,docs: ["the [Domain] account"]}],args: [{name: "input",type: {defined: "UpdateRecipeInput"}}]}, {name: "updateRecipeCategory",accounts: [{name: "key",isMut: !1,isSigner: !0,docs: ["The key authorized for this instruction"]}, {name: "profile",isMut: !1,isSigner: !1,docs: ["The crafting permissions [`Profile`]"]}, {name: "recipe",isMut: !0,isSigner: !1,docs: ["The [Recipe] to update"]}, {name: "recipeCategoryOld",isMut: !0,isSigner: !1,docs: ["The old [RecipeCategory] account"]}, {name: "recipeCategoryNew",isMut: !0,isSigner: !1,docs: ["The new [RecipeCategory] account"]}, {name: "domain",isMut: !1,isSigner: !1,docs: ["the [Domain] account"]}],args: [{name: "input",type: {defined: "KeyIndexInput"}}]}],accounts: [{name: "craftableItem",docs: ["This PDA represents a token registered as an item that can be crafted"],type: {kind: "struct",fields: [{name: "version",docs: ["The data version of this account."],type: "u8"}, {name: "domain",docs: ["the domain"],type: "publicKey"}, {name: "mint",docs: ["the mint representing the items crafted"],type: "publicKey"}, {name: "creator",docs: ["TODO: remove this"],type: "publicKey"}, {name: "namespace",docs: ["the name of this account"],type: {array: ["u8", 32]}}, {name: "bump",docs: ["bump for PDA"],type: "u8"}]}}, {name: "craftingFacility",docs: ["Represents a crafting facility account"],type: {kind: "struct",fields: [{name: "version",docs: ["The data version of this account."],type: "u8"}, {name: "domain",docs: ["the domain"],type: "publicKey"}, {name: "location",docs: ["the locations pubkey"],type: "publicKey"}, {name: "locationType",docs: ["the location type"],type: "u8"}, {name: "maxConcurrentProcesses",docs: ["the max. number of concurrent crafting processes that can be handled by this facility", "if 0 then there is no max"],type: "u32"}, {name: "numConcurrentProcesses",docs: ["the current number of concurrent crafting processes"],type: "u32"}, {name: "efficiency",docs: ["the efficiency rate for this crafting_facility (as basis points)"],type: "u32"}, {name: "numRecipeCategories",docs: ["number of recipe categories"],type: "u32"}]}}, {name: "craftingProcess",docs: ["This account represents crafting in progress"],type: {kind: "struct",fields: [{name: "version",docs: ["The data version of this account."],type: "u8"}, {name: "craftingId",docs: ["the crafting id"],type: "u64"}, {name: "authority",docs: ["the owner/authority of this crafting process"],type: "publicKey"}, {name: "recipe",docs: ["the recipe"],type: "publicKey"}, {name: "craftingFacility",docs: ["the crafting facility"],type: "publicKey"}, {name: "inputsChecksum",docs: ["used to check if expected inputs have been supplied"],type: {array: ["u8", 16]}}, {name: "outputsChecksum",docs: ["used to check if expected outputs have been claimed"],type: {array: ["u8", 16]}}, {name: "quantity",docs: ["Quantity of outputs to craft"],type: "u64"}, {name: "status",docs: ["The status of this crafting process"],type: "u8"}, {name: "startTime",docs: ["the start timestamp"],type: "i64"}, {name: "endTime",docs: ["the end timestamp"],type: "i64"}, {name: "denyPermissionlessClaiming",docs: ["Whether or not to deny permission-less claiming. True when > 0"],type: "u8"}, {name: "useLocalTime",docs: ["Whether or not to local time supplied by the location. True when > 0"],type: "u8"}, {name: "bump",docs: ["bump for PDA"],type: "u8"}]}}, {name: "domain",docs: ["This account allows for a crafting domain which allows an admin to set up", "craftable items, recipes and crafting facilities tied to a domain that the control"],type: {kind: "struct",fields: [{name: "version",docs: ["The data version of this account."],type: "u8"}, {name: "profile",docs: ["The [`Profile`] that handles the crafting program permissions"],type: "publicKey"}, {name: "namespace",docs: ["the namespace"],type: {array: ["u8", 32]}}]}}, {name: "recipe",docs: ["The definition of a recipe."],type: {kind: "struct",fields: [{name: "version",docs: ["The data version of this account."],type: "u8"}, {name: "domain",docs: ["the domain"],type: "publicKey"}, {name: "category",docs: ["The Recipe Category"],type: "publicKey"}, {name: "creator",docs: ["TODO: remove this"],type: "publicKey"}, {name: "duration",docs: ["The time required to craft this Recipe."],type: "i64"}, {name: "minDuration",docs: ["The minimum time required to craft this Recipe."],type: "i64"}, {name: "namespace",docs: ["The name of this recipe."],type: {array: ["u8", 32]}}, {name: "status",docs: ["The status of the recipe"],type: "u8"}, {name: "feeAmount",docs: ["The amount to charge when this recipe is used"],type: "u64"}, {name: "feeRecipient",docs: ["The token account that receives the `fee_amount`. If [`None`] the recipe requires no fees when used."],type: {defined: "OptionalNonSystemPubkey"}}, {name: "usageCount",docs: ["The number of times that this recipe has been used"],type: "u64"}, {name: "usageLimit",docs: ["The maximum number of times that this recipe can be used"],type: "u64"}, {name: "value",docs: ["The value of this recipe e.g. might be economic value", "The precise meaning of value is left to the person creating recipes to determine"],type: "u64"}, {name: "consumablesCount",docs: ["The number of consumable inputs in this recipe."],type: "u8"}, {name: "nonConsumablesCount",docs: ["The number of non-consumable inputs in this recipe."],type: "u8"}, {name: "outputsCount",docs: ["The number of outputs from this recipe."],type: "u8"}, {name: "totalCount",docs: ["The number of all inputs and outputs in this recipe."],type: "u16"}]}}, {name: "recipeCategory",docs: ["A Crafting Recipe Category account"],type: {kind: "struct",fields: [{name: "version",docs: ["The data version of this account."],type: "u8"}, {name: "domain",docs: ["the domain"],type: "publicKey"}, {name: "creator",docs: ["TODO: remove this"],type: "publicKey"}, {name: "recipeCount",docs: ["The number of recipes in this category."],type: "u32"}, {name: "namespace",docs: ["the name of this account"],type: {array: ["u8", 32]}}]}}],types: [{name: "AddRecipeIngredientInput",docs: ["Struct for data input to add an ingredient"],type: {kind: "struct",fields: [{name: "amount",docs: ["the amount of ingredient to deposit"],type: "u64"}, {name: "ingredientIndex",docs: ["the index of the recipe ingredient"],type: "u16"}]}}, {name: "BurnConsumableIngredientInput",docs: ["Struct for data input to burn a consumable ingredient"],type: {kind: "struct",fields: [{name: "ingredientIndex",docs: ["the index of the consumable recipe ingredient"],type: "u16"}, {name: "localTime",docs: ["the current time as supplied by the location; required if `use_local_time` is set on the `CraftingProcess`"],type: {option: "i64"}}]}}, {name: "ClaimNonConsumableIngredientInput",docs: ["Struct for data input to claim a non-consumable ingredient"],type: {kind: "struct",fields: [{name: "ingredientIndex",docs: ["the index of the recipe ingredient"],type: "u16"}, {name: "localTime",docs: ["the current time as supplied by the location; required if `use_local_time` is set on the `CraftingProcess`"],type: {option: "i64"}}]}}, {name: "ClaimRecipeOutputInput",docs: ["Struct for data input to claim an output"],type: {kind: "struct",fields: [{name: "ingredientIndex",docs: ["the index of the recipe output"],type: "u16"}, {name: "localTime",docs: ["the current time as supplied by the location; required if `use_local_time` is set on the `CraftingProcess`"],type: {option: "i64"}}]}}, {name: "CreateCraftingProcessInput",docs: ["Struct for data input to create a `CraftingProcess`"],type: {kind: "struct",fields: [{name: "craftingId",docs: ["crafting id"],type: "u64"}, {name: "recipeCategoryIndex",docs: ["the index of the recipes category"],type: "u16"}, {name: "quantity",docs: ["quantity of outputs to craft"],type: "u64"}, {name: "denyPermissionlessClaiming",docs: ["Whether or not to deny permission-less claiming. True when > 0"],type: "bool"}, {name: "useLocalTime",docs: ["Whether or not to local time supplied by the location. True when > 0"],type: "bool"}]}}, {name: "KeyIndexInput",docs: ["Struct for data input for that has `key_index`"],type: {kind: "struct",fields: [{name: "keyIndex",docs: ["the index of the key in the crafting permissions profile"],type: "u16"}]}}, {name: "LegitimizeRecipeIngredientInput",docs: ["Struct for data input to legitimize an ingredient"],type: {kind: "struct",fields: [{name: "amount",docs: ["the amount of ingredient to deposit"],type: "u64"}, {name: "ingredientIndex",docs: ["the index of the recipe ingredient"],type: "u16"}]}}, {name: "LocationType",docs: ["Represents different types of locations that a `CraftingFacility` might be found"],type: {kind: "enum",variants: [{name: "Starbase"}]}}, {name: "OptionalNonSystemPubkey",docs: ["A pubkey sized option that is none if set to the system program."],type: {kind: "struct",fields: [{name: "key",type: "publicKey"}]}}, {name: "ProcessStatus",docs: ["The `CraftingProcess` `status`"],type: {kind: "enum",variants: [{name: "Initialized"}, {name: "Started"}]}}, {name: "RecipeIngredients",docs: ["A copy of the [`RecipeInputsOutputs`] struct --> to be used as inputs into the program, avoiding using Borsch Serialization with Zero Copy serialization"],type: {kind: "struct",fields: [{name: "amount",docs: ["Amount of Input/Output required/produced."],type: "u64"}, {name: "mint",docs: ["Mint pubkey of the Input/Output."],type: "publicKey"}, {name: "keyIndex",docs: ["the index of the key in the crafting permissions profile"],type: "u16"}]}}, {name: "RecipeInputsOutputs",docs: ["The [`RecipeInputsOutputs`] struct."],type: {kind: "struct",fields: [{name: "amount",docs: ["Amount of Input/Output required/produced."],type: "u64"}, {name: "mint",docs: ["Mint pubkey of the Input/Output."],type: "publicKey"}]}}, {name: "RecipeStatus",docs: ["Represents the `Recipe` status"],type: {kind: "enum",variants: [{name: "Initializing"}, {name: "Active"}, {name: "Deactivated"}]}}, {name: "RegisterCraftableItemInput",docs: ["used as input struct when registering a `CraftableItem`"],type: {kind: "struct",fields: [{name: "namespace",docs: ["the `CraftableItem` namespace"],type: {array: ["u8", 32]}}, {name: "keyIndex",docs: ["the index of the key in the crafting permissions profile"],type: "u16"}]}}, {name: "RegisterCraftingFacilityInput",docs: ["Struct for data input to Register a `CraftingFacility`"],type: {kind: "struct",fields: [{name: "locationType",docs: ["`CraftingFacility` location type"],type: {defined: "LocationType"}}, {name: "efficiency",docs: ["`CraftingFacility` efficiency"],type: "u32"}, {name: "maxConcurrentProcesses",docs: ["the max. number of concurrent crafting processes that can be handled by this facility", "if 0 then there is no max"],type: "u32"}, {name: "keyIndex",docs: ["the index of the key in the crafting permissions profile"],type: "u16"}]}}, {name: "RegisterRecipeCategoryInput",docs: ["Struct for data input for `RegisterRecipeCategory`"],type: {kind: "struct",fields: [{name: "namespace",docs: ["the `RecipeCategory` namespace"],type: {array: ["u8", 32]}}, {name: "keyIndex",docs: ["the index of the key in the crafting permissions profile"],type: "u16"}]}}, {name: "RegisterRecipeInput",docs: ["used as input struct when registering a Recipe"],type: {kind: "struct",fields: [{name: "duration",docs: ["the recipe duration (seconds)"],type: "i64"}, {name: "minDuration",docs: ["the recipe minimum duration (seconds)"],type: "i64"}, {name: "namespace",docs: ["the recipe namespace"],type: {array: ["u8", 32]}}, {name: "feeAmount",docs: ["the recipe fee amount"],type: {option: "u64"}}, {name: "usageLimit",docs: ["the maximum number of times that this recipe can be used; if not provided a limit will not be set"],type: {option: "u64"}}, {name: "value",docs: ["the recipes value"],type: {option: "u64"}}, {name: "keyIndex",docs: ["the index of the key in the crafting permissions profile"],type: "u16"}]}}, {name: "RemoveCraftingFacilityRecipeCategoryInput",docs: ["Struct for data input for removing a [`CraftingFacility`] `RecipeCategory`"],type: {kind: "struct",fields: [{name: "recipeCategoryIndex",docs: ["the index of the `RecipeCategory` in the [`CraftingFacility`]"],type: "u16"}, {name: "keyIndex",docs: ["the index of the key in the crafting permissions profile"],type: "u16"}]}}, {name: "RemoveRecipeIngredientInput",docs: ["Struct for data input to remove an ingredient"],type: {kind: "struct",fields: [{name: "amount",docs: ["the amount of ingredient to withdraw/remove"],type: "u64"}, {name: "ingredientIndex",docs: ["the index of the recipe ingredient"],type: "u16"}]}}, {name: "RemoveRecipeIngredients",docs: ["used as input struct when removing recipe ingredients"],type: {kind: "struct",fields: [{name: "keyIndex",docs: ["the index of the key in the crafting permissions profile"],type: "u16"}, {name: "ingredientIndex",docs: ["the index of the recipe ingredient"],type: "u16"}]}}, {name: "StartCraftingProcessInput",docs: ["Inputs for `StartCraftingProcess`"],type: {kind: "struct",fields: [{name: "recipeDurationOverride",docs: ["recipe duration override"],type: {option: "u64"}}, {name: "localTime",docs: ["the current time as supplied by the location; required if `use_local_time` is set on the `CraftingProcess`"],type: {option: "i64"}}]}}, {name: "StopCraftingProcessInput",docs: ["Inputs for `StopCraftingProcess`"],type: {kind: "struct",fields: [{name: "localTime",docs: ["the current time as supplied by the location; required if `use_local_time` is set on the `CraftingProcess`"],type: {option: "i64"}}]}}, {name: "UpdateCraftingFacilityInput",docs: ["Struct for data input to Update `CraftingFacility`"],type: {kind: "struct",fields: [{name: "efficiency",docs: ["`CraftingFacility` efficiency"],type: {option: "u32"}}, {name: "maxConcurrentProcesses",docs: ["the max. number of concurrent crafting processes that can be handled by this facility", "if 0 then there is no max"],type: {option: "u32"}}, {name: "keyIndex",docs: ["the index of the key in the crafting permissions profile"],type: "u16"}]}}, {name: "UpdateRecipeInput",docs: ["Struct for data input to Update `Recipe`"],type: {kind: "struct",fields: [{name: "duration",docs: ["`Recipe` duration"],type: {option: "i64"}}, {name: "minDuration",docs: ["`Recipe` minimum duration"],type: {option: "i64"}}, {name: "feeAmount",docs: ["`Recipe` fee amount"],type: {option: "u64"}}, {name: "status",docs: ["`Recipe` status"],type: {option: "u8"}}, {name: "usageLimit",docs: ["the maximum number of times that this recipe can be used"],type: {option: "u64"}}, {name: "value",docs: ["the recipes value"],type: {option: "u64"}}, {name: "keyIndex",docs: ["the index of the key in the crafting permissions profile"],type: "u16"}]}}, {name: "WrappedRecipeCategory",docs: ["Wrapped recipe category", "We are wrapping this around Pubkey so that we can use Anchors coder to decode it"],type: {kind: "struct",fields: [{name: "id",docs: ["The recipe category public key"],type: "publicKey"}]}}],errors: [{code: 6e3,name: "IncorrectProfileAddress",msg: "Incorrect profile address."}, {code: 6001,name: "IncorrectAuthority",msg: "The authority is incorrect."}, {code: 6002,name: "NumericOverflow",msg: "Numeric overflow"}, {code: 6003,name: "MintAuthorityIsNone",msg: "The mint authority should exist."}, {code: 6004,name: "AdminNotMintAuthority",msg: "Admin wallet is not the mint authority of the entered token."}, {code: 6005,name: "IncorrectMintAddress",msg: "Incorrect mint address entered."}, {code: 6006,name: "LocationTypeNotSupported",msg: "The provided location type is not supported."}, {code: 6007,name: "IncorrectLocation",msg: "The location is incorrect."}, {code: 6008,name: "IncorrectDomain",msg: "The domain is incorrect."}, {code: 6009,name: "IncorrectRecipe",msg: "The recipe is incorrect."}, {code: 6010,name: "IncorrectRecipeCategory",msg: "The recipe category is incorrect."}, {code: 6011,name: "IncorrectCraftingFacility",msg: "The crafting facility is incorrect."}, {code: 6012,name: "OverCraftingFacilityCapacity",msg: "The crafting facility capacity has been exceeded."}, {code: 6013,name: "InsufficientAmount",msg: "The amount is insufficient."}, {code: 6014,name: "AmountRequired",msg: "An amount greater than 0 must be provided."}, {code: 6015,name: "AmountTooMuch",msg: "The amount is more than what is required."}, {code: 6016,name: "InputAlreadySupplied",msg: "The input has already been supplied."}, {code: 6017,name: "InputNotSupplied",msg: "The input has NOT been supplied."}, {code: 6018,name: "OutputAlreadyClaimed",msg: "The output has already been claimed."}, {code: 6019,name: "CraftingProcessAlreadyStarted",msg: "The crafting process has already started."}, {code: 6020,name: "CraftingProcessNotStarted",msg: "The crafting process has not started."}, {code: 6021,name: "CraftingProcessNotCompleted",msg: "The crafting process has not completed."}, {code: 6022,name: "CraftingProcessAlreadyCompleted",msg: "The crafting process has already completed."}, {code: 6023,name: "IngredientNotAnInput",msg: "The ingredient is not an input."}, {code: 6024,name: "IngredientNotAConsumableInput",msg: "The ingredient is not a consumable input."}, {code: 6025,name: "IngredientNotANonConsumableInput",msg: "The ingredient is not a non-consumable input."}, {code: 6026,name: "IngredientNotAnOutput",msg: "The ingredient is not an output."}, {code: 6027,name: "IncorrectInputsChecksum",msg: "The inputs checksum is incorrect."}, {code: 6028,name: "IncorrectOutputsChecksum",msg: "The outputs checksum is incorrect."}, {code: 6029,name: "RecipeCountNotZero",msg: "The recipe count is not zero."}, {code: 6030,name: "RecipeCategoryCountNotZero",msg: "The recipe category count is not zero."}, {code: 6031,name: "ConcurrentProcessCountNotZero",msg: "The concurrent process count is not zero."}, {code: 6032,name: "KeyIndexOutOfBounds",msg: "Key index out of bounds."}, {code: 6033,name: "InvalidDuration",msg: "Duration is invalid."}, {code: 6034,name: "MissingRequiredSignature",msg: "Missing required signature."}, {code: 6035,name: "AddressMismatchATA",msg: "ATA address does not match"}, {code: 6036,name: "CannotUpdateDeactivatedRecipe",msg: "Cannot Update Deactivated Recipe"}, {code: 6037,name: "InvalidRecipeStatus",msg: "Invalid Recipe Status"}, {code: 6038,name: "EfficiencyIsZero",msg: "Crafting Facility Efficiency Is Zero"}, {code: 6039,name: "AddressMismatch",msg: "Address Mismatch"}, {code: 6040,name: "RecipeLimitExceeded",msg: "Recipe Limit Exceeded"}]};
const marketIDL = await BrowserAnchor.anchor.Program.fetchIdl(marketProgramId, anchorProvider);
const atlasStakingIDL = await BrowserAnchor.anchor.Program.fetchIdl(atlasStakingProgramId, anchorProvider);
const sageProgram = new BrowserAnchor.anchor.Program(sageIDL, sageProgramId, anchorProvider);
const cargoProgram = new BrowserAnchor.anchor.Program(cargoIDL, cargoProgramId, anchorProvider);
const craftingProgram = new BrowserAnchor.anchor.Program(craftingIDL, craftingProgramId, anchorProvider);
const marketProgram = new BrowserAnchor.anchor.Program(marketIDL, marketProgramId, anchorProvider);
const atlasStakingProgram = new BrowserAnchor.anchor.Program(atlasStakingIDL, atlasStakingProgramId, anchorProvider);
let [cargoStatsDefinitionAcct] = await cargoProgram.account.cargoStatsDefinition.all();
let [registeredStake] = await atlasStakingProgram.account.registeredStake.all();
let cargoStatsDefSeqId = cargoStatsDefinitionAcct.account.seqId;
let seqBN = new BrowserAnchor.anchor.BN(cargoStatsDefSeqId);
let seqArr = seqBN.toTwos(64).toArrayLike(BrowserBuffer.Buffer.Buffer, "be", 2);
let seq58 = bs58.encode(seqArr);
let userPublicKey = null;
let cargoItems = [];
let craftRecipes = [];
let upgradeRecipes = [];
const cargoTypes = await cargoProgram.account.cargoType.all([
{
memcmp: {
offset: 75,
bytes: seq58,
},
},
]);
let addressLookupTables = [];
const addressLookupTableAddresses = [new solanaWeb3.PublicKey('AyC4m8fYEgR9mYcf6zzajevPjF8QhptY9Nae5LX6xgiu'), new solanaWeb3.PublicKey('F4jZvnU9fdi2mGp13TyewdAj96cKGUcwBBSMTsL1nRoC')];
function wait(ms) { return new Promise(resolve => { setTimeout(resolve, ms); }); }
async function getStoredValue(key) {
const storedValueJson = await GM.getValue(key, '{}');
return JSON.parse(storedValueJson);
}
async function setStoredValue(key, param, value) {
let storedValue = getStoredValue(key);
storedValue[param] = value;
await GM.setValue(key, JSON.stringify(storedValue));
}
async function getResourceTokens() {
const resources = await sageProgram.account.mineItem.all();
const craftables = await craftingProgram.account.craftableItem.all();
for (let resource of resources) {
let cargoType = cargoTypes.find(item => item.account.mint.toString() === resource.account.mint.toString());
let cargoName = (new TextDecoder().decode(new Uint8Array(resource.account.name)).replace(/\0/g, ''));
cargoItems.push({'name': cargoName, 'token': resource.account.mint.toString()});
}
for (let craftable of craftables) {
let cargoType = cargoTypes.find(item => item.account.mint.toString() === craftable.account.mint.toString());
let cargoName = (new TextDecoder().decode(new Uint8Array(craftable.account.namespace)).replace(/\0/g, ''));
cargoItems.push({'name': cargoName, 'token': craftable.account.mint.toString()});
}
cargoItems.sort(function (a, b) { return a.name.toUpperCase().localeCompare(b.name.toUpperCase()); });
}
async function getCraftRecipes() {
const allCraftCategories = await craftingProgram.account.recipeCategory.all();
let upgradeCategory = allCraftCategories.find(item => (new TextDecoder().decode(new Uint8Array(item.account.namespace)).replace(/\0/g, '')) === 'Upgrade');
let statusBN = new BrowserAnchor.anchor.BN(2);
let statusArr = statusBN.toTwos(64).toArrayLike(BrowserBuffer.Buffer.Buffer, "be", 2);
let status58 = bs58.encode(statusArr);
const allCraftRecipes = await craftingProgram.account.recipe.all([
{
memcmp: {
offset: 152,
bytes: status58,
},
},
]);
for (let craftRecipe of allCraftRecipes) {
let recipeAcctInfo = await solanaConnection.getAccountInfo(craftRecipe.publicKey);
let recipeName = (new TextDecoder().decode(new Uint8Array(craftRecipe.account.namespace)).replace(/\0/g, ''));
let recipeInputOutput = [];
let recipeData = recipeAcctInfo.data.subarray(223);
let recipeIter = 0;
while (recipeData.length >= 40) {
let currIngredient = recipeData.subarray(0, 40);
let ingredientDecoded = craftingProgram.coder.types.decode('RecipeInputsOutputs', currIngredient);
recipeInputOutput.push({mint: ingredientDecoded.mint, amount: ingredientDecoded.amount.toNumber(), idx: recipeIter});
recipeData = recipeData.subarray(40);
recipeIter += 1;
}
if (craftRecipe.account.category.toString() === upgradeCategory.publicKey.toString()) {
upgradeRecipes.push({'name': recipeName, 'publicKey': craftRecipe.publicKey, 'category': craftRecipe.account.category, 'domain': craftRecipe.account.domain, 'feeRecipient': craftRecipe.account.feeRecipient.key, 'duration': craftRecipe.account.duration.toNumber(), 'input': recipeInputOutput, 'output': []});
} else if (recipeName !== 'SDU') {
craftRecipes.push({'name': recipeName, 'publicKey': craftRecipe.publicKey, 'category': craftRecipe.account.category, 'domain': craftRecipe.account.domain, 'feeRecipient': craftRecipe.account.feeRecipient.key, 'duration': craftRecipe.account.duration.toNumber(), 'input': recipeInputOutput.slice(0, -1), 'output': recipeInputOutput.slice(-1)[0]});
}
}
upgradeRecipes.sort(function (a, b) { return a.name.toUpperCase().localeCompare(b.name.toUpperCase()); });
craftRecipes.sort(function (a, b) { return a.name.toUpperCase().localeCompare(b.name.toUpperCase()); });
}
async function getALTs() {
for (let lookupTableAddress of addressLookupTableAddresses) {
let lookupTableAccount = await solanaConnection.getAddressLookupTable(lookupTableAddress);
addressLookupTables.push(lookupTableAccount.value);
}
}
async function createAccountInstruction(program, keypair) {
let instruction = { instruction: await solanaWeb3.SystemProgram
.createAccount({
fromPubkey: userPublicKey,
newAccountPubkey: keypair.publicKey,
space: 201,
lamports: await solanaConnection.getMinimumBalanceForRentExemption(201),
programId: program.programId,
}),
signers: keypair,
};
return instruction;
}
async function createPDA(derived, derivedFrom1, derivedFrom2, fleet, send = true) {
const keys = [{
pubkey: userPublicKey,
isSigner: true,
isWritable: true
}, {
pubkey: derived,
isSigner: false,
isWritable: true
}, {
pubkey: derivedFrom1,
isSigner: false,
isWritable: false
}, {
pubkey: derivedFrom2,
isSigner: false,
isWritable: false
}, {
pubkey: solanaWeb3.SystemProgram.programId,
isSigner: false,
isWritable: false
}, {
pubkey: tokenProgramId,
isSigner: false,
isWritable: false
}];
let tx = {instruction: new solanaWeb3.TransactionInstruction({
keys: keys,
programId: associatedTokenProgramId,
//data: []
})}
let txResult = tx
if (send) txResult = await txSignAndSend(tx);
}
async function buildTransferInstruction(source, destination, amount) {
const keys = [{
pubkey: source,
isSigner: false,
isWritable: true
}, {
pubkey: destination,
isSigner: false,
isWritable: true
}, {
pubkey: userPublicKey,
isSigner: true,
isWritable: false
}];
let transferId = new Uint8Array(1);
transferId[0] = 3;
let transferIdBuffer = BrowserBuffer.Buffer.Buffer.from(transferId);
let transferAmt = new BrowserAnchor.anchor.BN(amount * 10**8);
let transferAmtBuffer = transferAmt.toArrayLike(BrowserBuffer.Buffer.Buffer, "le", 8);
let merged = new Uint8Array([ ...transferIdBuffer, ...transferAmtBuffer ]);
let ix = {instruction: new solanaWeb3.TransactionInstruction({
keys: keys,
programId: tokenProgramId,
data: merged
})};
return ix;
}
async function sendAndConfirmTx(txSerialized, lastValidBlockHeight, txHash) {
let {blockHeight: curBlockHeight} = await solanaConnection.getEpochInfo({ commitment: 'confirmed' });
let interimBlockHeight = curBlockHeight;
if (curBlockHeight > lastValidBlockHeight) return {txHash, confirmation: {name: 'TransactionExpiredBlockheightExceededError'}};
try {
txHash = await solanaConnection.sendRawTransaction(txSerialized, {skipPreflight: true, maxRetries: 0, preflightCommitment: 'confirmed'});
} catch (e) {
console.log('txHash: ', txHash);
}
// Force a retry if txHash is undefined. Not sure why sendRawTransaction would return nothing, but this happens occasionally.
if (!txHash) return {txHash, confirmation: {name: 'TransactionExpiredBlockheightExceededError'}};
while ((curBlockHeight - interimBlockHeight) < 10) {
const signatureStatus = await solanaConnection.getSignatureStatus(txHash);
if (signatureStatus.value && ['confirmed','finalized'].includes(signatureStatus.value.confirmationStatus)) {
return {txHash, confirmation: signatureStatus};
} else if (signatureStatus.err) {
return {txHash, confirmation: signatureStatus}
}
await wait(Math.max(2000, 2000));
let epochInfo = await solanaConnection.getEpochInfo({ commitment: 'confirmed' });
curBlockHeight = epochInfo.blockHeight;
}
console.log('-----TRYING-----');
return await sendAndConfirmTx(txSerialized, lastValidBlockHeight, txHash);
}
async function txSignAndSend(ix, extraSigner=false) {
let confirmed = false;
while (!confirmed) {
//let tx = new solanaWeb3.Transaction();
const priorityFee = Math.max(1, Math.ceil(1000000 * 5)); //Convert Lamports to microLamports ?
/*
if (priorityFee > 0) tx.add(solanaWeb3.ComputeBudgetProgram.setComputeUnitPrice({microLamports: priorityFee}));
if (ix.constructor === Array) {
ix.forEach(item => tx.add(item.instruction))
} else {
tx.add(ix.instruction);
}
let latestBH = await solanaReadConnection.getLatestBlockhash('confirmed');
tx.recentBlockhash = latestBH.blockhash;
tx.lastValidBlockHeight = latestBH.lastValidBlockHeight-150;
tx.feePayer = userPublicKey;
tx.signer = userPublicKey;
*/
let instructions = [];
//if (priorityFee > 0) instructions.push(solanaWeb3.ComputeBudgetProgram.setComputeUnitPrice({microLamports: priorityFee}));
if (ix.constructor === Array) {
ix.forEach(item => instructions.push(item.instruction))
} else {
instructions.push(ix.instruction);
}
let latestBH = await solanaConnection.getLatestBlockhash('confirmed');
let messageV0 = new solanaWeb3.TransactionMessage({
payerKey: userPublicKey,
recentBlockhash: latestBH.blockhash,
instructions,
}).compileToV0Message(addressLookupTables);
let tx = new solanaWeb3.VersionedTransaction(messageV0);
if (extraSigner) tx.sign([extraSigner]);
let txSigned = null;
if (typeof solflare === 'undefined') {
txSigned = phantom && phantom.solana ? await phantom.solana.signAllTransactions([tx]) : solana.signAllTransactions([tx]);
} else {
txSigned = await solflare.signAllTransactions([tx]);
}
let txSerialized = await txSigned[0].serialize();
let microOpStart = Date.now();
let response = await sendAndConfirmTx(txSerialized, latestBH.lastValidBlockHeight, null);
let txHash = response.txHash;
let confirmation = response.confirmation;
let txResult = txHash ? await solanaConnection.getTransaction(txHash, {commitment: 'confirmed', preflightCommitment: 'confirmed', maxSupportedTransactionVersion: 1}) : undefined;
if ((confirmation.value && confirmation.value.err && confirmation.value.err.InstructionError) || (txResult && txResult.meta && txResult.meta.err && txResult.meta.err.InstructionError)) {
let ixError = txResult && txResult.meta && txResult.meta.logMessages ? txResult.meta.logMessages : 'Unknown';
console.log('txResult.logMessages: ', ixError);
}
const confirmationTimeStr = `${Date.now() - microOpStart}ms`;
if (confirmation && confirmation.name == 'TransactionExpiredBlockheightExceededError' && !txResult) {
console.log(`CONFIRM ❌ ${confirmationTimeStr}`);
continue; //retart loop to try again
}
let tryCount = 1;
if (!confirmation.name) {
while (!txResult) {
tryCount++;
txResult = await solanaConnection.getTransaction(txHash, {commitment: 'confirmed', preflightCommitment: 'confirmed', maxSupportedTransactionVersion: 1});
if(!txResult) await wait(1000);
}
}
console.log('txResult: ', txResult);
confirmed = true;
return txResult;
}
}
async function initUser() {
if (typeof solflare === 'undefined') {
let walletConn = phantom && phantom.solana ? await phantom.solana.connect() : await solana.connect();
userPublicKey = walletConn.publicKey;
} else {
await solflare.connect();
userPublicKey = solflare.publicKey;
}
}
async function createOrder(side, price, quantity, itemMint, currencyMint = atlasProgramId) {
let instructions = [];
const receiveMint = side === 'buy' ? itemMint : currencyMint;
const depositMint = side === 'buy' ? currencyMint : itemMint;
let depositTokenAccount = await solanaConnection.getParsedTokenAccountsByOwner(userPublicKey, {mint: new solanaWeb3.PublicKey(depositMint)});
//const depositTokenAccount = await solanaConnection.getTokenAccount(userPublicKey, depositMint);
//await createPDA(depositTokenAccount, userPublicKey, depositMint)
const receiveTokenAccount = await solanaConnection.getParsedTokenAccountsByOwner(userPublicKey, {mint: new solanaWeb3.PublicKey(receiveMint)});
//const receiveTokenAccount = await solanaConnection.getTokenAccount(userPublicKey, receiveMint);
//await createPDA(receiveTokenAccount, userPublicKey, receiveMint)
const initializerDepositTokenAccount = 'publicKey' in depositTokenAccount ? depositTokenAccount.publicKey : depositTokenAccount.value[0].pubkey;
const initializerReceiveTokenAccount = 'publicKey' in receiveTokenAccount ? receiveTokenAccount.publicKey : receiveTokenAccount.value[0].pubkey;
const orderAccount = solanaWeb3.Keypair.generate();
let createOrderInstruction = await createAccountInstruction(marketProgram, orderAccount);
instructions.push(createOrderInstruction);
const [orderVaultAccount] = await BrowserAnchor.anchor.web3.PublicKey.findProgramAddressSync(
[
BrowserBuffer.Buffer.Buffer.from('order-vault-account'),
userPublicKey.toBuffer(),
new solanaWeb3.PublicKey(depositMint).toBuffer(),
],
marketProgramId,
);
const [orderVaultAuthority] = await BrowserAnchor.anchor.web3.PublicKey.findProgramAddressSync(
[
BrowserBuffer.Buffer.Buffer.from('order-vault-auth'),
userPublicKey.toBuffer()
],
marketProgramId,
);
let [marketVarsAccount] = await BrowserAnchor.anchor.web3.PublicKey.findProgramAddressSync(
[
BrowserBuffer.Buffer.Buffer.from('market-vars')
],
marketProgramId,
);
let [registeredCurrency] = await BrowserAnchor.anchor.web3.PublicKey.findProgramAddressSync(
[
BrowserBuffer.Buffer.Buffer.from('registered-currency'),
new solanaWeb3.PublicKey(currencyMint).toBuffer()
],
marketProgramId,
);
let [openOrdersCounter] = await BrowserAnchor.anchor.web3.PublicKey.findProgramAddressSync(
[
BrowserBuffer.Buffer.Buffer.from('open-orders-counter'),
userPublicKey.toBuffer(),
new solanaWeb3.PublicKey(depositMint).toBuffer(),
],
marketProgramId,
);
const openOrdersCounterAcct = await solanaConnection.getAccountInfo(openOrdersCounter);
if (openOrdersCounterAcct === null) {
let initializeOpenOrdersCounterIx = { instruction: await marketProgram.methods.initializeOpenOrdersCounter()
.accountsStrict({
payer: userPublicKey,
user: userPublicKey,
openOrdersCounter: openOrdersCounter,
depositMint,
systemProgram: systemProgramId,
}).instruction()};
instructions.push(initializeOpenOrdersCounterIx);
}
const programMethod = side === 'buy' ? marketProgram.methods.processInitializeBuy : marketProgram.methods.processInitializeSell;
let instruction = { instruction: await programMethod(new BrowserAnchor.anchor.BN(price), new BrowserAnchor.anchor.BN(quantity))
.accountsStrict({
orderVaultAccount: orderVaultAccount,
orderVaultAuthority,
orderInitializer: userPublicKey,
marketVarsAccount,
depositMint: depositMint,
receiveMint: receiveMint,
initializerDepositTokenAccount,
initializerReceiveTokenAccount,
orderAccount: orderAccount.publicKey,
registeredCurrency,
openOrdersCounter,
systemProgram: systemProgramId,
rent: rentProgramId,
tokenProgram: tokenProgramId,
}).instruction()};
instructions.push(instruction);
let txResult = await txSignAndSend(instructions, orderAccount);
return {txResult: txResult, orderAccount: orderAccount};
}
async function fillOrder(price, quantity, orderAccount, currencyMint = atlasProgramId) {
let orderAccountData = await marketProgram.account.orderAccount.fetch(orderAccount);
const orderInitializer = orderAccountData.orderInitializerPubkey;
const [openOrdersCounter] = await BrowserAnchor.anchor.web3.PublicKey.findProgramAddressSync(
[
BrowserBuffer.Buffer.Buffer.from('open-orders-counter'),
orderInitializer.toBuffer(),
new solanaWeb3.PublicKey(currencyMint).toBuffer(),
],
marketProgramId,
);
const [orderVaultAccount] = await BrowserAnchor.anchor.web3.PublicKey.findProgramAddressSync(
[
BrowserBuffer.Buffer.Buffer.from('order-vault-account'),
orderInitializer.toBuffer(),
new solanaWeb3.PublicKey(currencyMint).toBuffer(),
],
marketProgramId,
);
const [orderVaultAuthority] = await BrowserAnchor.anchor.web3.PublicKey.findProgramAddressSync(
[
BrowserBuffer.Buffer.Buffer.from('order-vault-auth'),
orderInitializer.toBuffer()
],
marketProgramId,
);
const [registeredCurrency] = await BrowserAnchor.anchor.web3.PublicKey.findProgramAddressSync(
[
BrowserBuffer.Buffer.Buffer.from('registered-currency'),
new solanaWeb3.PublicKey(currencyMint).toBuffer()
],
marketProgramId,
);
const registeredCurrencies = await marketProgram.account.registeredCurrency.all();
const saVaultAccount = registeredCurrencies.find(c => c.account.tokenMint.toString() == currencyMint.toString());;
const [stakeAccount] = await BrowserAnchor.anchor.web3.PublicKey.findProgramAddressSync(
[
BrowserBuffer.Buffer.Buffer.from('staking-account'),
userPublicKey.toBuffer(),
registeredStake.publicKey.toBuffer()
],
atlasStakingProgramId,
);
const [feeReduction] = await BrowserAnchor.anchor.web3.PublicKey.findProgramAddressSync(
[
BrowserBuffer.Buffer.Buffer.from('fee_exempt'),
userPublicKey.toBuffer(),
],
marketProgramId,
);
let depositTokenAccount = await solanaConnection.getParsedTokenAccountsByOwner(userPublicKey, {mint: new solanaWeb3.PublicKey(orderAccountData.assetMint)});
//const depositTokenAccount = await solanaConnection.getTokenAccount(userPublicKey, depositMint);
//await createPDA(depositTokenAccount, userPublicKey, depositMint)
const receiveTokenAccount = await solanaConnection.getParsedTokenAccountsByOwner(userPublicKey, {mint: new solanaWeb3.PublicKey(orderAccountData.currencyMint)});
//const receiveTokenAccount = await solanaConnection.getTokenAccount(userPublicKey, receiveMint);
//await createPDA(receiveTokenAccount, userPublicKey, receiveMint)
const orderTakerDepositTokenAccount = 'publicKey' in depositTokenAccount ? depositTokenAccount.publicKey : depositTokenAccount.value[0].pubkey;
const orderTakerReceiveTokenAccount = 'publicKey' in receiveTokenAccount ? receiveTokenAccount.publicKey : receiveTokenAccount.value[0].pubkey;
let instruction = { instruction: await marketProgram.methods.processExchange(new BrowserAnchor.anchor.BN(quantity), new BrowserAnchor.anchor.BN(price), userPublicKey)
.accountsStrict({
openOrdersCounter: openOrdersCounter,
orderAccount: orderAccount,
orderInitializer: orderInitializer,
orderVaultAccount: orderVaultAccount,
orderVaultAuthority: orderVaultAuthority,
initializerDepositTokenAccount: orderAccountData.initializerCurrencyTokenAccount,
initializerReceiveTokenAccount: orderAccountData.initializerAssetTokenAccount,
registeredCurrency: registeredCurrency,
tokenProgram: tokenProgramId,
orderTaker: userPublicKey,
orderTakerDepositTokenAccount,
orderTakerReceiveTokenAccount,
currencyMint: orderAccountData.currencyMint,
assetMint: orderAccountData.assetMint,
saVault: saVaultAccount.account.saCurrencyVault,
atlasStaking: atlasStakingProgramId,
registeredStake: registeredStake.publicKey,
stakingAccount: stakeAccount,
feeReduction,
}).instruction()};
let txResult = await txSignAndSend(instruction);
}
function getMinSellPrice(orderAccounts, itemMint) {
let itemSellOrders = orderAccounts.filter(i => {
return i.account.assetMint.toString() == itemMint && Object.keys(i.account.orderSide)[0] == 'sell';
});
let itemMinSellOrder = itemSellOrders.reduce((a,b) => a.account.price.toNumber() < b.account.price.toNumber() ? a : b);
return itemMinSellOrder.account.price.toNumber() / Math.pow(10, 8);
}
async function getMarketData(itemMint = null) {
let filters = [{dataSize: 201}];
if (itemMint) {
filters.push({
memcmp: {
offset: 72,
bytes: itemMint,
},
});
}
let orderAccounts = await marketProgram.account.orderAccount.all(filters);
return orderAccounts;
}
async function createBuildOrder(targetItem, amount) {
//get market data to set the price
targetItem = cargoItems.find(item => item.name === targetItem);
let marketData = await getMarketData(targetItem.token);
let marketPrice = getMinSellPrice(marketData, targetItem.token);
let orderResult = await createOrder('buy', 1, amount, targetItem.token);
return orderResult.orderAccount.publicKey.toString();
}
async function findBuildOrder(orderAccount) {
let orderAccountData = await marketProgram.account.orderAccount.fetch(orderAccount);
return orderAccountData;
}
async function fillBuildOrder(orderAccount, amount) {
await fillOrder(1, amount, orderAccount);
}
async function getBuildOrder(orderAccount, itemMint) {
let orderSignatureRecords = await solanaConnection.getSignaturesForAddress(new solanaWeb3.PublicKey(orderAccount));
let orderSignatures = orderSignatureRecords.map(record => record.signature);
let orderTransactions = await solanaConnection.getParsedTransactions(orderSignatures, {maxSupportedTransactionVersion: 1});
//let orderFillTransactions = orderTransactions.filter(tx => tx.meta.innerInstructions[0].instructions.find(ix => ix.parsed.info.mint == itemMint));
let orderFillTransactions = orderTransactions.map(tx => tx.meta.innerInstructions[0].instructions.find(ix => ix.parsed.info.mint == itemMint)).filter(Boolean);
let parsedContributors = orderFillTransactions.map(tx => ({contributor: tx.parsed.info.authority, itemMint: tx.parsed.info.mint, amount: tx.parsed.info.tokenAmount.uiAmount}));
return parsedContributors;
}
async function calcDistribution(orderId) {
let buildOrders = await getStoredValue('BuildOrders');
let storedOrder = buildOrders[orderId];
let totalContributionValue = storedOrder.orders.reduce((partialSum, a) => partialSum + (a.amount * a.price), 0);
let totalContributions = [];
for (const order of storedOrder.orders) {
let ingredientItem = cargoItems.find(item => item.name === order.item);
let contributions = await getBuildOrder(order.account, ingredientItem.token);
for (const contribution of contributions) {
let totalSellPrice = storedOrder.sellPrice * storedOrder.amount
let distibutionAmount = totalSellPrice * ((order.price * contribution.amount) / totalContributionValue);
totalContributions.push({contributor: contribution.contributor, distibutionAmount: distibutionAmount});
}
}
return totalContributions;
}
async function addOrderRow(buildOrderData, buildOrderId) {
let orderRow = document.createElement('tr');
orderRow.classList.add('sly-order-row');
orderRow.dataset.orderId = buildOrderId;
let orderId = document.createElement('span');
orderId.innerHTML = buildOrderData.id;
let orderIdTd = document.createElement('td');
orderIdTd.appendChild(orderId);
let orderName = document.createElement('span');
orderName.innerHTML = buildOrderData.name;
let orderNameTd = document.createElement('td');
orderNameTd.appendChild(orderName);
let orderAmount = document.createElement('span');
orderAmount.innerHTML = buildOrderData.amount;
let orderAmountTd = document.createElement('td');
orderAmountTd.appendChild(orderAmount);
let orderPrice = document.createElement('span');
orderPrice.innerHTML = buildOrderData.sellPrice;
let orderPriceTd = document.createElement('td');
orderPriceTd.appendChild(orderPrice);
let orderStatus = document.createElement('span');
orderStatus.innerHTML = buildOrderData.status;
let orderStatusTd = document.createElement('td');
orderStatusTd.appendChild(orderStatus);
let orderDetails = document.createElement('span');
orderDetails.innerHTML = buildOrderData.details.join('<br>');
let orderDetailsTd = document.createElement('td');
orderDetailsTd.appendChild(orderDetails);
let orderActions = document.createElement('div');
orderActions.classList.add('flex-column');
let updateButton = document.createElement('button');
updateButton.classList.add('sly-btn');
let updateButtonSpan = document.createElement('span');
updateButtonSpan.innerText = 'Update';
updateButtonSpan.style.fontSize = '14px';
updateButton.appendChild(updateButtonSpan);
let distributeButton = document.createElement('button');
distributeButton.classList.add('sly-btn');
let distributeButtonSpan = document.createElement('span');
distributeButtonSpan.innerText = 'Distribute';
distributeButtonSpan.style.fontSize = '14px';
distributeButton.appendChild(distributeButtonSpan);
let firstActionsContainer = document.createElement('div');
firstActionsContainer.classList.add('flex-row');
firstActionsContainer.style.columnGap = '5px';
firstActionsContainer.appendChild(updateButton);
firstActionsContainer.appendChild(distributeButton);
let sellInput = document.createElement('input');
sellInput.style.width = '6em';
let sellButton = document.createElement('button');
sellButton.classList.add('sly-btn');
let sellButtonSpan = document.createElement('span');
sellButtonSpan.innerText = 'Sell';
sellButtonSpan.style.fontSize = '14px';
sellButton.appendChild(sellButtonSpan);
let sellContainer = document.createElement('div');
sellContainer.classList.add('flex-row');
sellContainer.style.columnGap = '5px';
sellContainer.appendChild(sellInput);
sellContainer.appendChild(sellButton);
orderActions.appendChild(firstActionsContainer);
orderActions.appendChild(sellContainer);
let orderActionsTd = document.createElement('td');
orderActionsTd.appendChild(orderActions);
orderRow.appendChild(orderIdTd);
orderRow.appendChild(orderNameTd);
orderRow.appendChild(orderAmountTd);
orderRow.appendChild(orderPriceTd);
orderRow.appendChild(orderStatusTd);
orderRow.appendChild(orderDetailsTd);
orderRow.appendChild(orderActionsTd);
sellButton.addEventListener('click', async (event) => {
let targetRow = event.target.closest('.sly-order-row');
let orderId = targetRow.dataset.orderId;
let targetPrice = event.target.closest('div').firstChild.value;
let buildOrders = await getStoredValue('BuildOrders');
let storedOrder = buildOrders[orderId];
storedOrder.sellPrice = Number(targetPrice);
setStoredValue(`BuildOrders`, orderId, storedOrder);
storedOrder.item = 'Aerogel'; //temp fix this
let sellItem = cargoItems.find(item => item.name === storedOrder.item);
let orderResult = await createOrder('sell', storedOrder.sellPrice * 10**8, storedOrder.amount, sellItem.token);
});
distributeButton.addEventListener('click', async (event) => {
let targetRow = event.target.closest('.sly-order-row');
let orderId = targetRow.dataset.orderId;
slyDistributeModalToggle(orderId);
//await calcDistribution(orderId);
});
let targetElem = document.querySelector('#slybOrderTableCrafter');
targetElem.appendChild(orderRow);
}
async function addFillOrderRow(buildOrderData, buildOrderId) {
let orderRow = document.createElement('tr');
orderRow.classList.add('sly-order-row');
orderRow.dataset.orderId = buildOrderId;
let orderCrafter = document.createElement('span');
orderCrafter.innerHTML = buildOrderData.crafter;
let orderCrafterTd = document.createElement('td');
orderCrafterTd.appendChild(orderCrafter);
let orderAccount = document.createElement('span');
orderAccount.innerHTML = buildOrderData.orderAccount;
let orderAccountTd = document.createElement('td');
orderAccountTd.appendChild(orderAccount);
let orderIngredient = document.createElement('span');
orderIngredient.innerHTML = buildOrderData.ingredient;
let orderIngredientTd = document.createElement('td');
orderIngredientTd.appendChild(orderIngredient);
let orderAmtTarget = document.createElement('span');
orderAmtTarget.innerHTML = buildOrderData.amtTarget;
let orderAmtTargetTd = document.createElement('td');
orderAmtTargetTd.appendChild(orderAmtTarget);
let orderFilled = document.createElement('span');
orderFilled.innerHTML = buildOrderData.filled;
let orderFilledTd = document.createElement('td');
orderFilledTd.appendChild(orderFilled);
let orderAmtNeeded = document.createElement('span');
orderAmtNeeded.innerHTML = buildOrderData.amtNeeded;
let orderAmtNeededTd = document.createElement('td');
orderAmtNeededTd.appendChild(orderAmtNeeded);
let orderActions = document.createElement('div');
let fillInput = document.createElement('input');
fillInput.style.width = '6em';
let fillButton = document.createElement('button');
fillButton.classList.add('sly-btn');
let fillButtonSpan = document.createElement('span');
fillButtonSpan.innerText = 'Fill';
fillButtonSpan.style.fontSize = '14px';
fillButton.appendChild(fillButtonSpan);
orderActions.appendChild(fillInput);
orderActions.appendChild(fillButton);
let orderActionsTd = document.createElement('td');
orderActionsTd.appendChild(orderActions);
orderRow.appendChild(orderCrafterTd);
orderRow.appendChild(orderAccountTd);
orderRow.appendChild(orderIngredientTd);
orderRow.appendChild(orderAmtTargetTd);
orderRow.appendChild(orderFilledTd);
orderRow.appendChild(orderAmtNeededTd);
orderRow.appendChild(orderActionsTd);
fillButton.addEventListener('click', async (event) => {
let targetRow = event.target.closest('.sly-order-row');
let targetOrderAccount = targetRow.children[1].firstChild.innerHTML;
let targetAmount = event.target.closest('div').firstChild.value;
await fillBuildOrder(targetOrderAccount, targetAmount);
await updateContributorOrderRows();
});
let targetElem = document.querySelector('#slybOrderTableContributor');
targetElem.appendChild(orderRow);
}
async function updateOrderRows() {
document.querySelectorAll('#slybCrafterModal .sly-modal-body table .sly-order-row').forEach(e => e.remove());
let buildOrders = await getStoredValue('BuildOrders');
for (const [buildOrderId, buildOrderData] of Object.entries(buildOrders)) {
let orderDetails = [];
for (const ingredientOrder of buildOrderData.orders) {
let ingredientItem = cargoItems.find(item => item.name === ingredientOrder.item);
let orderAccountData = await marketProgram.account.orderAccount.fetch(ingredientOrder.account);
let amtTarget = orderAccountData.orderOriginationQty.toNumber();
let amtNeeded = orderAccountData.orderRemainingQty.toNumber();
let percentFilled = Number(((amtTarget-amtNeeded)/amtTarget)/100).toLocaleString(undefined,{style: 'percent', minimumFractionDigits:2});
orderDetails.push(`${ingredientOrder.account} | ${ingredientOrder.item} | ${amtTarget} | ${percentFilled} | ${ingredientOrder.price}`);
}
let orderData = {id: buildOrderId, name: buildOrderData.name, amount: buildOrderData.amount, sellPrice: buildOrderData.sellPrice, status: 'Open', details: orderDetails};
addOrderRow(orderData, buildOrderId);
}
}
async function slyDistributeModalToggle(orderId) {
let targetElem = document.getElementById('slybDistributeModal');
if (targetElem.style.display === 'none') {
targetElem.style.display = 'block';
let distributeSpan = document.getElementById('slybDistributeSpan');
let execDistributeBtn = document.getElementById('slybExecDistributeBtn');
let totalContributions = await calcDistribution(orderId);
let spanText = '';
for (let contribution of totalContributions) {
spanText += `${contribution.contributor}: ${contribution.distibutionAmount} ATLAS<br>`;
}
distributeSpan.innerHTML = spanText;
execDistributeBtn.addEventListener('click', async (event) => {
let instructions = [];
for (let contribution of totalContributions) {
let sourceTokenAccount = await solanaConnection.getParsedTokenAccountsByOwner(userPublicKey, {mint: new solanaWeb3.PublicKey(atlasProgramId)});
let destinationTokenAccount = await solanaConnection.getParsedTokenAccountsByOwner(new solanaWeb3.PublicKey(contribution.contributor), {mint: new solanaWeb3.PublicKey(atlasProgramId)});
let instruction = buildTransferInstruction(sourceTokenAccount.value[0].pubkey, destinationTokenAccount.value[0].pubkey, contribution.distibutionAmount);
instructions.push(instruction);
}
let txResult = await txSignAndSend(instructions);
});
} else {
targetElem.style.display = 'none';
document.getElementById('slybDistributeSpan').innerHTML = '';
}
}
async function slyCrafterModalToggle() {
let targetElem = document.querySelector('#slybCrafterModal');
if (targetElem.style.display === 'none') {
targetElem.style.display = 'block';
let allRecipes = craftRecipes;
const craftItems = [''].concat(allRecipes.map((r) => r.name));
let craftOptStr = '';
craftItems.forEach( function(item) {craftOptStr += '<option value="' + item + '">' + item + '</option>';});
let craftItem = document.getElementById('slybCraftItem');
craftItem.innerHTML = craftOptStr;
await updateOrderRows();
let createOrderBtn = document.getElementById('slybCreateOrderBtn');
createOrderBtn.addEventListener('click', async () => {
let craftItemElem = document.getElementById('slybCraftItem');
let craftRecipe = allRecipes.find(item => item.name === craftItemElem.value);
let craftAmountElem = document.getElementById('slybCraftAmount');
let craftNameElem = document.getElementById('slybCraftName');
let inputOrders = [];
for (const input of craftRecipe.input) {
let inputItem = cargoItems.find(item => item.token === input.mint.toString());
let inputAmountNeeded = input.amount * craftAmountElem.value;
let marketData = await getMarketData(inputItem.token);
let marketPrice = getMinSellPrice(marketData, inputItem.token);
let orderResult = await createOrder('buy', 1, inputAmountNeeded, inputItem.token);
inputOrders.push({account: orderResult.orderAccount.publicKey.toString(), item: inputItem.name, amount: inputAmountNeeded, price: marketPrice});
}
let buildOrders = await getStoredValue('BuildOrders');
let buildOrderId = Object.keys(buildOrders).length;
let buildOrderRecord = {name: craftNameElem.value, item: craftItemElem.value, amount: craftAmountElem.value, sellPrice: 0, orders: inputOrders};
setStoredValue(`BuildOrders`, buildOrderId, buildOrderRecord);
await updateOrderRows();
});
} else {
targetElem.style.display = 'none';
document.querySelectorAll('#slybCrafterModal .sly-modal-body table .sly-order-row').forEach(e => e.remove());
}
}
async function updateContributorOrderRows() {
document.querySelectorAll('#slybContributorModal .sly-modal-body table .sly-order-row').forEach(e => e.remove());
let orderAccountElem = document.getElementById('slybOrderAccount');
let order = await findBuildOrder(orderAccountElem.value);
let inputItem = cargoItems.find(item => item.token === order.assetMint.toString());
let amtTarget = order.orderOriginationQty.toNumber();
let amtNeeded = order.orderRemainingQty.toNumber();
let percentFilled = Number(((amtTarget-amtNeeded)/amtTarget)/100).toLocaleString(undefined,{style: 'percent', minimumFractionDigits:2});
let orderData = {crafter: order.orderInitializerPubkey.toString(), orderAccount: orderAccountElem.value, ingredient: inputItem.name, amtTarget: amtTarget, filled: percentFilled, amtNeeded: amtNeeded};
addFillOrderRow(orderData, 0);
}
async function slyContributorModalToggle() {
let targetElem = document.querySelector('#slybContributorModal');
if (targetElem.style.display === 'none') {
targetElem.style.display = 'block';
let getOrderBtn = document.getElementById('slybGetOrderBtn');
getOrderBtn.addEventListener('click', async () => {
await updateContributorOrderRows();
});
} else {
targetElem.style.display = 'none';
}
}
let observer = new MutationObserver(waitForLoad);
function waitForLoad(mutations, observer){
let elemTrigger = '#app #topNav';
if(document.querySelectorAll(elemTrigger).length > 0 && !document.getElementById("managerContainer")) {
observer && observer.disconnect();
let appElem = document.querySelector('#app main main');
let targetElem = document.querySelector('#app #topNav > div:nth-child(2) > div > div');
let referenceTab = document.querySelector('#app #topNav > div:nth-child(2) > div > div > div:nth-child(2)');
let slyPrimaryColor = 'rgb(255, 190, 77)';
let slyPrimaryColor20 = 'rgba(255, 190, 77, 0.2)';
let slyDisabledColor = 'rgb(100, 100, 100)';
let slyCSS = document.createElement('style');
slyCSS.innerHTML = `.sly-btn {border: 2px solid white; background: none; color: white; cursor: pointer; margin-left: 2px; margin-right: 2px;}
.sly-btn-primary {border-color: ${slyPrimaryColor}; color: ${slyPrimaryColor};}
.sly-btn-primary:disabled {border-color: ${slyDisabledColor}; color: ${slyDisabledColor}; cursor: not-allowed;}
.sly-menu {position: relative; display: none; margin-top: 0px; margin-left: 10px; background-color: rgb(41, 41, 48); min-width: 120px; box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2); z-index: 2;}
.sly-menu.show {display: block;}
.sly-menu button {width: 100%; text-align: left;}
.sly-menu-btn {color: ${slyPrimaryColor}; padding: 2px 16px; text-decoration: none; display: block; background-color: rgb(41, 41, 48); border: none;}
.sly-menu-btn:hover {background-color: ${slyPrimaryColor20};}
.sly-btn-close:hover, .sly-btn-close:focus {font-weight: bold; text-decoration: none; cursor: pointer;}
.sly-modal {display: none; position: fixed; z-index: 100; padding-top: 100px; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0,0,0,0.4);}
.sly-modal-content {position: relative; display: flex; flex-direction: column; background-color: rgb(41, 41, 48); margin: auto; padding: 0; border: 1px solid #888; width: 785px; min-width: 450px; max-width: 85%; height: auto; min-height: 50px; max-height: 85%; overflow-y: auto; overflow-x: auto; box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19); -webkit-animation-name: animatetop; -webkit-animation-duration: 0.4s; animation-name: animatetop; animation-duration: 0.4s;}
.sly-modal-header {display: flex; align-items: center; padding: 2px 16px; background-color: ${slyPrimaryColor20}; border-bottom: 2px solid ${slyPrimaryColor}; color: ${slyPrimaryColor};}
.sly-modal-header-right {color: ${slyPrimaryColor}; margin-left: auto !important; font-size: 20px;}
.sly-modal-body {padding: 2px 16px; font-size: 12px;}
.flex-row {display: flex; flex-direction: row; column-gap: 25px; flex-wrap: wrap;}
.flex-column {display: flex; flex-direction: column; row-gap: 7px; flex: 1;}
.sly-label {padding-right: 10px;}`;
let slyContainer = document.createElement('div');
slyContainer.id = 'managerContainer';
slyContainer.style.position = 'absolute';
slyContainer.style.top = '25%';
slyContainer.style.zIndex = '100';
let slyMenuContainer = document.createElement('div');
slyMenuContainer.classList.add('sly-menu');
slyMenuContainer.addEventListener('click', function() {slyMenuContainer.classList.remove('show');});
let slyMainButton = document.createElement('div');
slyMainButton.id = 'slyMainBtn';
slyMainButton.classList.add(...referenceTab.classList);
slyMainButton.role = 'button';
slyMainButton.tabIndex = '2';
slyMainButton.addEventListener('click', function() {slyMenuContainer.classList.toggle('show');});
//slyMainButton.addEventListener('click', function() {slyModalToggle();});
let slyMainButtonP = document.createElement('p');
slyMainButtonP.innerText = 'SLY Bookie';
let slyMainButtonDiv = document.createElement('div');
slyMainButtonDiv.classList.add('tabBorder');
slyMainButton.appendChild(slyMainButtonP);
slyMainButton.appendChild(slyMainButtonDiv);
let slyCrafterMenuButton = document.createElement('button');
slyCrafterMenuButton.id = 'slyCrafterMenuBtn';
slyCrafterMenuButton.classList.add('sly-btn','sly-menu-btn');
slyCrafterMenuButton.addEventListener('click', function() {slyCrafterModalToggle();});
let slyCrafterMenuButtonSpan = document.createElement('span');
slyCrafterMenuButtonSpan.innerText = 'Crafter';
slyCrafterMenuButtonSpan.style.fontSize = '14px';
slyCrafterMenuButton.appendChild(slyCrafterMenuButtonSpan);
let slyContributorMenuButton = document.createElement('button');
slyContributorMenuButton.id = 'slyContributorMenuBtn';
slyContributorMenuButton.classList.add('sly-btn','sly-menu-btn');
slyContributorMenuButton.addEventListener('click', function() {slyContributorModalToggle();});
let slyContributorMenuButtonSpan = document.createElement('span');
slyContributorMenuButtonSpan.innerText = 'Contributor';
slyContributorMenuButtonSpan.style.fontSize = '14px';
slyContributorMenuButton.appendChild(slyContributorMenuButtonSpan);
let slyCrafterModal = document.createElement('div');
slyCrafterModal.classList.add('sly-modal');
slyCrafterModal.id = 'slybCrafterModal';
slyCrafterModal.style.display = 'none';
let slyCrafterModalContent = document.createElement('div');
slyCrafterModalContent.classList.add('sly-modal-content');
slyCrafterModalContent.style.width = '1150px';
slyCrafterModalContent.innerHTML = `<div class="sly-modal-header">
<span style="padding-left: 15px;">SLY Bookie v${GM_info.script.version} - Crafter</span>
<div class="sly-modal-header-right"><span class="sly-btn-close">x</span></div>
</div>
<div class="sly-modal-body flex-column">
<div class="flex-row" style="align-items: end;">
<div><span>Craft: </span><select id="slybCraftItem"></select></div>
<div><span>Amount: </span><input id="slybCraftAmount" type="number" min="1" placeholder="1" value="1" style="width: 10em;"></div>
<div><span>Name: </span><input id="slybCraftName" type="text" style="width: 10em;"></div>
<div><button id="slybCreateOrderBtn" class="sly-btn sly-btn-primary">Create Order</button></div>
</div>
<table id="slybOrderTableCrafter">
<tr>
<th>ID</th>
<th>Name</th>
<th>Amount</th>
<th>Sell Price</th>
<th>Status</th>
<th>Details [Order Account | Item | Amount | Filled | Price]</th>
<th>Actions</th>
</tr>
</table>
</div>`;