-
Notifications
You must be signed in to change notification settings - Fork 30
/
accounts.go
1958 lines (1830 loc) · 45.4 KB
/
accounts.go
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
// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT.
package metaplex
import (
ag_binary "github.com/gagliardetto/binary"
ag_solanago "github.com/gagliardetto/solana-go"
)
type Key ag_binary.BorshEnum
const (
KeyUninitialized Key = iota
KeyOriginalAuthorityLookupV1
KeyBidRedemptionTicketV1
KeyStoreV1
KeyWhitelistedCreatorV1
KeyPayoutTicketV1
KeySafetyDepositValidationTicketV1
KeyAuctionManagerV1
KeyPrizeTrackingTicketV1
KeySafetyDepositConfigV1
KeyAuctionManagerV2
KeyBidRedemptionTicketV2
KeyAuctionWinnerTokenTypeTrackerV1
KeyStoreIndexerV1
KeyAuctionCacheV1
KeyStoreConfigV1
)
func (value Key) String() string {
switch value {
case KeyUninitialized:
return "Uninitialized"
case KeyOriginalAuthorityLookupV1:
return "OriginalAuthorityLookupV1"
case KeyBidRedemptionTicketV1:
return "BidRedemptionTicketV1"
case KeyStoreV1:
return "StoreV1"
case KeyWhitelistedCreatorV1:
return "WhitelistedCreatorV1"
case KeyPayoutTicketV1:
return "PayoutTicketV1"
case KeySafetyDepositValidationTicketV1:
return "SafetyDepositValidationTicketV1"
case KeyAuctionManagerV1:
return "AuctionManagerV1"
case KeyPrizeTrackingTicketV1:
return "PrizeTrackingTicketV1"
case KeySafetyDepositConfigV1:
return "SafetyDepositConfigV1"
case KeyAuctionManagerV2:
return "AuctionManagerV2"
case KeyBidRedemptionTicketV2:
return "BidRedemptionTicketV2"
case KeyAuctionWinnerTokenTypeTrackerV1:
return "AuctionWinnerTokenTypeTrackerV1"
case KeyStoreIndexerV1:
return "StoreIndexerV1"
case KeyAuctionCacheV1:
return "AuctionCacheV1"
case KeyStoreConfigV1:
return "StoreConfigV1"
default:
return ""
}
}
type CommonWinningIndexReturn struct {
Amount uint64
WinningConfigType WinningConfigType
WinningConfigItemIndex *uint64 `bin:"optional"`
}
func (obj CommonWinningIndexReturn) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) {
// Serialize `Amount` param:
err = encoder.Encode(obj.Amount)
if err != nil {
return err
}
// Serialize `WinningConfigType` param:
err = encoder.Encode(obj.WinningConfigType)
if err != nil {
return err
}
// Serialize `WinningConfigItemIndex` param (optional):
{
if obj.WinningConfigItemIndex == nil {
err = encoder.WriteBool(false)
if err != nil {
return err
}
} else {
err = encoder.WriteBool(true)
if err != nil {
return err
}
err = encoder.Encode(obj.WinningConfigItemIndex)
if err != nil {
return err
}
}
}
return nil
}
func (obj *CommonWinningIndexReturn) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) {
// Deserialize `Amount`:
err = decoder.Decode(&obj.Amount)
if err != nil {
return err
}
// Deserialize `WinningConfigType`:
err = decoder.Decode(&obj.WinningConfigType)
if err != nil {
return err
}
// Deserialize `WinningConfigItemIndex` (optional):
{
ok, err := decoder.ReadBool()
if err != nil {
return err
}
if ok {
err = decoder.Decode(&obj.WinningConfigItemIndex)
if err != nil {
return err
}
}
}
return nil
}
type PrintingV2CalculationCheckReturn struct {
ExpectedRedemptions uint64
WinningConfigType WinningConfigType
WinningConfigItemIndex *uint64 `bin:"optional"`
}
func (obj PrintingV2CalculationCheckReturn) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) {
// Serialize `ExpectedRedemptions` param:
err = encoder.Encode(obj.ExpectedRedemptions)
if err != nil {
return err
}
// Serialize `WinningConfigType` param:
err = encoder.Encode(obj.WinningConfigType)
if err != nil {
return err
}
// Serialize `WinningConfigItemIndex` param (optional):
{
if obj.WinningConfigItemIndex == nil {
err = encoder.WriteBool(false)
if err != nil {
return err
}
} else {
err = encoder.WriteBool(true)
if err != nil {
return err
}
err = encoder.Encode(obj.WinningConfigItemIndex)
if err != nil {
return err
}
}
}
return nil
}
func (obj *PrintingV2CalculationCheckReturn) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) {
// Deserialize `ExpectedRedemptions`:
err = decoder.Decode(&obj.ExpectedRedemptions)
if err != nil {
return err
}
// Deserialize `WinningConfigType`:
err = decoder.Decode(&obj.WinningConfigType)
if err != nil {
return err
}
// Deserialize `WinningConfigItemIndex` (optional):
{
ok, err := decoder.ReadBool()
if err != nil {
return err
}
if ok {
err = decoder.Decode(&obj.WinningConfigItemIndex)
if err != nil {
return err
}
}
}
return nil
}
type AuctionManagerV2 struct {
Key Key
Store ag_solanago.PublicKey
Authority ag_solanago.PublicKey
Auction ag_solanago.PublicKey
Vault ag_solanago.PublicKey
AcceptPayment ag_solanago.PublicKey
State AuctionManagerStateV2
}
func (obj AuctionManagerV2) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) {
// Serialize `Key` param:
err = encoder.Encode(obj.Key)
if err != nil {
return err
}
// Serialize `Store` param:
err = encoder.Encode(obj.Store)
if err != nil {
return err
}
// Serialize `Authority` param:
err = encoder.Encode(obj.Authority)
if err != nil {
return err
}
// Serialize `Auction` param:
err = encoder.Encode(obj.Auction)
if err != nil {
return err
}
// Serialize `Vault` param:
err = encoder.Encode(obj.Vault)
if err != nil {
return err
}
// Serialize `AcceptPayment` param:
err = encoder.Encode(obj.AcceptPayment)
if err != nil {
return err
}
// Serialize `State` param:
err = encoder.Encode(obj.State)
if err != nil {
return err
}
return nil
}
func (obj *AuctionManagerV2) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) {
// Deserialize `Key`:
err = decoder.Decode(&obj.Key)
if err != nil {
return err
}
// Deserialize `Store`:
err = decoder.Decode(&obj.Store)
if err != nil {
return err
}
// Deserialize `Authority`:
err = decoder.Decode(&obj.Authority)
if err != nil {
return err
}
// Deserialize `Auction`:
err = decoder.Decode(&obj.Auction)
if err != nil {
return err
}
// Deserialize `Vault`:
err = decoder.Decode(&obj.Vault)
if err != nil {
return err
}
// Deserialize `AcceptPayment`:
err = decoder.Decode(&obj.AcceptPayment)
if err != nil {
return err
}
// Deserialize `State`:
err = decoder.Decode(&obj.State)
if err != nil {
return err
}
return nil
}
type AuctionManagerStateV2 struct {
Status AuctionManagerStatus
// When all configs are validated the auction is started and auction manager moves to Running
SafetyConfigItemsValidated uint64
// how many bids have been pushed to accept payment
BidsPushedToAcceptPayment uint64
HasParticipation bool
}
func (obj AuctionManagerStateV2) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) {
// Serialize `Status` param:
err = encoder.Encode(obj.Status)
if err != nil {
return err
}
// Serialize `SafetyConfigItemsValidated` param:
err = encoder.Encode(obj.SafetyConfigItemsValidated)
if err != nil {
return err
}
// Serialize `BidsPushedToAcceptPayment` param:
err = encoder.Encode(obj.BidsPushedToAcceptPayment)
if err != nil {
return err
}
// Serialize `HasParticipation` param:
err = encoder.Encode(obj.HasParticipation)
if err != nil {
return err
}
return nil
}
func (obj *AuctionManagerStateV2) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) {
// Deserialize `Status`:
err = decoder.Decode(&obj.Status)
if err != nil {
return err
}
// Deserialize `SafetyConfigItemsValidated`:
err = decoder.Decode(&obj.SafetyConfigItemsValidated)
if err != nil {
return err
}
// Deserialize `BidsPushedToAcceptPayment`:
err = decoder.Decode(&obj.BidsPushedToAcceptPayment)
if err != nil {
return err
}
// Deserialize `HasParticipation`:
err = decoder.Decode(&obj.HasParticipation)
if err != nil {
return err
}
return nil
}
type ParticipationStateV2 struct {
// We have this variable below to keep track in the case of the participation NFTs, whose
// income will trickle in over time, how much the artists have in the escrow account and
// how much would/should be owed to them if they try to claim it relative to the winning bids.
// It's abit tougher than a straightforward bid which has a price attached to it, because
// there are many bids of differing amounts (in the case of GivenForBidPrice) and they dont all
// come in at one time, so this little ledger here keeps track.
CollectedToAcceptPayment uint64
}
func (obj ParticipationStateV2) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) {
// Serialize `CollectedToAcceptPayment` param:
err = encoder.Encode(obj.CollectedToAcceptPayment)
if err != nil {
return err
}
return nil
}
func (obj *ParticipationStateV2) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) {
// Deserialize `CollectedToAcceptPayment`:
err = decoder.Decode(&obj.CollectedToAcceptPayment)
if err != nil {
return err
}
return nil
}
type ParticipationConfigV2 struct {
// Setups:
// 1. Winners get participation + not charged extra
// 2. Winners dont get participation prize
WinnerConstraint WinningConstraint
// Setups:
// 1. Losers get prize for free
// 2. Losers get prize but pay fixed price
// 3. Losers get prize but pay bid price
NonWinningConstraint NonWinningConstraint
// Setting this field disconnects the participation prizes price from the bid. Any bid you submit, regardless
// of amount, charges you the same fixed price.
FixedPrice *uint64 `bin:"optional"`
}
func (obj ParticipationConfigV2) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) {
// Serialize `WinnerConstraint` param:
err = encoder.Encode(obj.WinnerConstraint)
if err != nil {
return err
}
// Serialize `NonWinningConstraint` param:
err = encoder.Encode(obj.NonWinningConstraint)
if err != nil {
return err
}
// Serialize `FixedPrice` param (optional):
{
if obj.FixedPrice == nil {
err = encoder.WriteBool(false)
if err != nil {
return err
}
} else {
err = encoder.WriteBool(true)
if err != nil {
return err
}
err = encoder.Encode(obj.FixedPrice)
if err != nil {
return err
}
}
}
return nil
}
func (obj *ParticipationConfigV2) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) {
// Deserialize `WinnerConstraint`:
err = decoder.Decode(&obj.WinnerConstraint)
if err != nil {
return err
}
// Deserialize `NonWinningConstraint`:
err = decoder.Decode(&obj.NonWinningConstraint)
if err != nil {
return err
}
// Deserialize `FixedPrice` (optional):
{
ok, err := decoder.ReadBool()
if err != nil {
return err
}
if ok {
err = decoder.Decode(&obj.FixedPrice)
if err != nil {
return err
}
}
}
return nil
}
type WinningConstraint ag_binary.BorshEnum
const (
WinningConstraintNoParticipationPrize WinningConstraint = iota
WinningConstraintParticipationPrizeGiven
)
func (value WinningConstraint) String() string {
switch value {
case WinningConstraintNoParticipationPrize:
return "NoParticipationPrize"
case WinningConstraintParticipationPrizeGiven:
return "ParticipationPrizeGiven"
default:
return ""
}
}
type NonWinningConstraint ag_binary.BorshEnum
const (
NonWinningConstraintNoParticipationPrize NonWinningConstraint = iota
NonWinningConstraintGivenForFixedPrice
NonWinningConstraintGivenForBidPrice
)
func (value NonWinningConstraint) String() string {
switch value {
case NonWinningConstraintNoParticipationPrize:
return "NoParticipationPrize"
case NonWinningConstraintGivenForFixedPrice:
return "GivenForFixedPrice"
case NonWinningConstraintGivenForBidPrice:
return "GivenForBidPrice"
default:
return ""
}
}
type WinningConfigType ag_binary.BorshEnum
const (
// You may be selling your one-of-a-kind NFT for the first time, but not it's accompanying Metadata,
// of which you would like to retain ownership. You get 100% of the payment the first sale, then
// royalties forever after.
//
// You may be re-selling something like a Limited/Open Edition print from another auction,
// a master edition record token by itself (Without accompanying metadata/printing ownership), etc.
// This means artists will get royalty fees according to the top level royalty % on the metadata
// split according to their percentages of contribution.
//
// No metadata ownership is transferred in this instruction, which means while you may be transferring
// the token for a limited/open edition away, you would still be (nominally) the owner of the limited edition
// metadata, though it confers no rights or privileges of any kind.
WinningConfigTypeTokenOnlyTransfer WinningConfigType = iota
// Means you are auctioning off the master edition record and it's metadata ownership as well as the
// token itself. The other person will be able to mint authorization tokens and make changes to the
// artwork.
WinningConfigTypeFullRightsTransfer
// Means you are using authorization tokens to print off editions during the auction using
// from a MasterEditionV1
WinningConfigTypePrintingV1
// Means you are using the MasterEditionV2 to print off editions
WinningConfigTypePrintingV2
// Means you are using a MasterEditionV2 as a participation prize.
WinningConfigTypeParticipation
)
func (value WinningConfigType) String() string {
switch value {
case WinningConfigTypeTokenOnlyTransfer:
return "TokenOnlyTransfer"
case WinningConfigTypeFullRightsTransfer:
return "FullRightsTransfer"
case WinningConfigTypePrintingV1:
return "PrintingV1"
case WinningConfigTypePrintingV2:
return "PrintingV2"
case WinningConfigTypeParticipation:
return "Participation"
default:
return ""
}
}
type AuctionManagerStatus ag_binary.BorshEnum
const (
AuctionManagerStatusInitialized AuctionManagerStatus = iota
AuctionManagerStatusValidated
AuctionManagerStatusRunning
AuctionManagerStatusDisbursing
AuctionManagerStatusFinished
)
func (value AuctionManagerStatus) String() string {
switch value {
case AuctionManagerStatusInitialized:
return "Initialized"
case AuctionManagerStatusValidated:
return "Validated"
case AuctionManagerStatusRunning:
return "Running"
case AuctionManagerStatusDisbursing:
return "Disbursing"
case AuctionManagerStatusFinished:
return "Finished"
default:
return ""
}
}
type OriginalAuthorityLookup struct {
Key Key
OriginalAuthority ag_solanago.PublicKey
}
func (obj OriginalAuthorityLookup) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) {
// Serialize `Key` param:
err = encoder.Encode(obj.Key)
if err != nil {
return err
}
// Serialize `OriginalAuthority` param:
err = encoder.Encode(obj.OriginalAuthority)
if err != nil {
return err
}
return nil
}
func (obj *OriginalAuthorityLookup) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) {
// Deserialize `Key`:
err = decoder.Decode(&obj.Key)
if err != nil {
return err
}
// Deserialize `OriginalAuthority`:
err = decoder.Decode(&obj.OriginalAuthority)
if err != nil {
return err
}
return nil
}
type PayoutTicket struct {
Key Key
Recipient ag_solanago.PublicKey
AmountPaid uint64
}
func (obj PayoutTicket) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) {
// Serialize `Key` param:
err = encoder.Encode(obj.Key)
if err != nil {
return err
}
// Serialize `Recipient` param:
err = encoder.Encode(obj.Recipient)
if err != nil {
return err
}
// Serialize `AmountPaid` param:
err = encoder.Encode(obj.AmountPaid)
if err != nil {
return err
}
return nil
}
func (obj *PayoutTicket) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) {
// Deserialize `Key`:
err = decoder.Decode(&obj.Key)
if err != nil {
return err
}
// Deserialize `Recipient`:
err = decoder.Decode(&obj.Recipient)
if err != nil {
return err
}
// Deserialize `AmountPaid`:
err = decoder.Decode(&obj.AmountPaid)
if err != nil {
return err
}
return nil
}
type StoreIndexer struct {
Key Key
Store ag_solanago.PublicKey
Page uint64
AuctionCaches []ag_solanago.PublicKey
}
func (obj StoreIndexer) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) {
// Serialize `Key` param:
err = encoder.Encode(obj.Key)
if err != nil {
return err
}
// Serialize `Store` param:
err = encoder.Encode(obj.Store)
if err != nil {
return err
}
// Serialize `Page` param:
err = encoder.Encode(obj.Page)
if err != nil {
return err
}
// Serialize `AuctionCaches` param:
err = encoder.Encode(obj.AuctionCaches)
if err != nil {
return err
}
return nil
}
func (obj *StoreIndexer) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) {
// Deserialize `Key`:
err = decoder.Decode(&obj.Key)
if err != nil {
return err
}
// Deserialize `Store`:
err = decoder.Decode(&obj.Store)
if err != nil {
return err
}
// Deserialize `Page`:
err = decoder.Decode(&obj.Page)
if err != nil {
return err
}
// Deserialize `AuctionCaches`:
err = decoder.Decode(&obj.AuctionCaches)
if err != nil {
return err
}
return nil
}
type AuctionCache struct {
Key Key
Store ag_solanago.PublicKey
Timestamp int64
Metadata []ag_solanago.PublicKey
Auction ag_solanago.PublicKey
Vault ag_solanago.PublicKey
AuctionManager ag_solanago.PublicKey
}
func (obj AuctionCache) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) {
// Serialize `Key` param:
err = encoder.Encode(obj.Key)
if err != nil {
return err
}
// Serialize `Store` param:
err = encoder.Encode(obj.Store)
if err != nil {
return err
}
// Serialize `Timestamp` param:
err = encoder.Encode(obj.Timestamp)
if err != nil {
return err
}
// Serialize `Metadata` param:
err = encoder.Encode(obj.Metadata)
if err != nil {
return err
}
// Serialize `Auction` param:
err = encoder.Encode(obj.Auction)
if err != nil {
return err
}
// Serialize `Vault` param:
err = encoder.Encode(obj.Vault)
if err != nil {
return err
}
// Serialize `AuctionManager` param:
err = encoder.Encode(obj.AuctionManager)
if err != nil {
return err
}
return nil
}
func (obj *AuctionCache) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) {
// Deserialize `Key`:
err = decoder.Decode(&obj.Key)
if err != nil {
return err
}
// Deserialize `Store`:
err = decoder.Decode(&obj.Store)
if err != nil {
return err
}
// Deserialize `Timestamp`:
err = decoder.Decode(&obj.Timestamp)
if err != nil {
return err
}
// Deserialize `Metadata`:
err = decoder.Decode(&obj.Metadata)
if err != nil {
return err
}
// Deserialize `Auction`:
err = decoder.Decode(&obj.Auction)
if err != nil {
return err
}
// Deserialize `Vault`:
err = decoder.Decode(&obj.Vault)
if err != nil {
return err
}
// Deserialize `AuctionManager`:
err = decoder.Decode(&obj.AuctionManager)
if err != nil {
return err
}
return nil
}
type Store struct {
Key Key
Public bool
AuctionProgram ag_solanago.PublicKey
TokenVaultProgram ag_solanago.PublicKey
TokenMetadataProgram ag_solanago.PublicKey
TokenProgram ag_solanago.PublicKey
}
func (obj Store) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) {
// Serialize `Key` param:
err = encoder.Encode(obj.Key)
if err != nil {
return err
}
// Serialize `Public` param:
err = encoder.Encode(obj.Public)
if err != nil {
return err
}
// Serialize `AuctionProgram` param:
err = encoder.Encode(obj.AuctionProgram)
if err != nil {
return err
}
// Serialize `TokenVaultProgram` param:
err = encoder.Encode(obj.TokenVaultProgram)
if err != nil {
return err
}
// Serialize `TokenMetadataProgram` param:
err = encoder.Encode(obj.TokenMetadataProgram)
if err != nil {
return err
}
// Serialize `TokenProgram` param:
err = encoder.Encode(obj.TokenProgram)
if err != nil {
return err
}
return nil
}
func (obj *Store) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) {
// Deserialize `Key`:
err = decoder.Decode(&obj.Key)
if err != nil {
return err
}
// Deserialize `Public`:
err = decoder.Decode(&obj.Public)
if err != nil {
return err
}
// Deserialize `AuctionProgram`:
err = decoder.Decode(&obj.AuctionProgram)
if err != nil {
return err
}
// Deserialize `TokenVaultProgram`:
err = decoder.Decode(&obj.TokenVaultProgram)
if err != nil {
return err
}
// Deserialize `TokenMetadataProgram`:
err = decoder.Decode(&obj.TokenMetadataProgram)
if err != nil {
return err
}
// Deserialize `TokenProgram`:
err = decoder.Decode(&obj.TokenProgram)
if err != nil {
return err
}
return nil
}
type StoreConfig struct {
Key Key
SettingsUri *string `bin:"optional"`
}
func (obj StoreConfig) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) {
// Serialize `Key` param:
err = encoder.Encode(obj.Key)
if err != nil {
return err
}
// Serialize `SettingsUri` param (optional):
{
if obj.SettingsUri == nil {
err = encoder.WriteBool(false)
if err != nil {
return err
}
} else {
err = encoder.WriteBool(true)
if err != nil {
return err
}
err = encoder.Encode(obj.SettingsUri)
if err != nil {
return err
}
}
}
return nil
}
func (obj *StoreConfig) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) {
// Deserialize `Key`:
err = decoder.Decode(&obj.Key)
if err != nil {
return err
}
// Deserialize `SettingsUri` (optional):
{
ok, err := decoder.ReadBool()
if err != nil {
return err
}
if ok {
err = decoder.Decode(&obj.SettingsUri)
if err != nil {
return err
}
}
}
return nil
}
type WhitelistedCreator struct {
Key Key
Address ag_solanago.PublicKey
Activated bool
}
func (obj WhitelistedCreator) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) {
// Serialize `Key` param:
err = encoder.Encode(obj.Key)
if err != nil {
return err
}
// Serialize `Address` param:
err = encoder.Encode(obj.Address)
if err != nil {
return err
}
// Serialize `Activated` param:
err = encoder.Encode(obj.Activated)
if err != nil {
return err
}
return nil
}
func (obj *WhitelistedCreator) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) {
// Deserialize `Key`:
err = decoder.Decode(&obj.Key)
if err != nil {
return err
}
// Deserialize `Address`:
err = decoder.Decode(&obj.Address)
if err != nil {
return err
}
// Deserialize `Activated`:
err = decoder.Decode(&obj.Activated)
if err != nil {
return err
}
return nil
}
type PrizeTrackingTicket struct {
Key Key
Metadata ag_solanago.PublicKey
SupplySnapshot uint64
ExpectedRedemptions uint64
Redemptions uint64
}
func (obj PrizeTrackingTicket) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) {
// Serialize `Key` param:
err = encoder.Encode(obj.Key)
if err != nil {
return err
}
// Serialize `Metadata` param:
err = encoder.Encode(obj.Metadata)
if err != nil {
return err
}
// Serialize `SupplySnapshot` param:
err = encoder.Encode(obj.SupplySnapshot)
if err != nil {
return err
}
// Serialize `ExpectedRedemptions` param:
err = encoder.Encode(obj.ExpectedRedemptions)
if err != nil {
return err
}
// Serialize `Redemptions` param:
err = encoder.Encode(obj.Redemptions)
if err != nil {
return err
}
return nil
}
func (obj *PrizeTrackingTicket) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) {
// Deserialize `Key`: