-
Notifications
You must be signed in to change notification settings - Fork 30
/
RedeemPrintingV2Bid.go
699 lines (632 loc) · 29 KB
/
RedeemPrintingV2Bid.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
// Code generated by https://github.com/gagliardetto/anchor-go. DO NOT EDIT.
package metaplex
import (
"errors"
ag_binary "github.com/gagliardetto/binary"
ag_solanago "github.com/gagliardetto/solana-go"
ag_format "github.com/gagliardetto/solana-go/text/format"
ag_treeout "github.com/gagliardetto/treeout"
)
// Note: This requires that auction manager be in a Running state and that be of the V1 type.
//
// If an auction is complete, you can redeem your printing v2 bid for a specific item here. If you are the first to do this,
// The auction manager will switch from Running state to Disbursing state. If you are the last, this may change
// the auction manager state to Finished provided that no authorities remain to be delegated for Master Edition tokens.
//
// NOTE: Please note that it is totally possible to redeem a bid 2x - once for a prize you won and once at the RedeemParticipationBid point for an open edition
// that comes as a 'token of appreciation' for bidding. They are not mutually exclusive unless explicitly set to be that way.
type RedeemPrintingV2Bid struct {
Args *RedeemPrintingV2BidArgs
// [0] = [WRITE] auctionManager
// ··········· Auction manager
//
// [1] = [WRITE] safetyDepositTokenStorage
// ··········· Safety deposit token storage account
//
// [2] = [WRITE] singleItemAccount
// ··········· Account containing 1 token of your new mint type.
// ··········· MUST be an associated token account of pda [wallet, token program, mint] relative to ata program.
//
// [3] = [WRITE] bidRedemptionKey
// ··········· Bid redemption key -
// ··········· Just a PDA with seed ['metaplex', auction_key, bidder_metadata_key] that we will allocate to mark that you redeemed your bid
//
// [4] = [WRITE] safetyDepositBox
// ··········· Safety deposit box account
//
// [5] = [WRITE] vaultAccount
// ··········· Vault account
//
// [6] = [] safetyDepositConfig
// ··········· Safety deposit config pda of ['metaplex', program id, auction manager, safety deposit]
// ··········· This account will only get used in the event this is an AuctionManagerV2
//
// [7] = [] auction
// ··········· Auction
//
// [8] = [] bidderMetadata
// ··········· Your BidderMetadata account
//
// [9] = [] bidder
// ··········· Your Bidder account - Only needs to be signer if payer does not own
//
// [10] = [SIGNER] payer
// ··········· Payer
//
// [11] = [] tokenProgram
// ··········· Token program
//
// [12] = [] tokenVaultProgram
// ··········· Token Vault program
//
// [13] = [] tokenMetadataProgram
// ··········· Token metadata program
//
// [14] = [] store
// ··········· Store
//
// [15] = [] system
// ··········· System
//
// [16] = [] rentSysvar
// ··········· Rent sysvar
//
// [17] = [WRITE] prizeTrackingTicket
// ··········· Prize tracking ticket (pda of ['metaplex', program id, auction manager key, metadata mint id])
//
// [18] = [WRITE] newMetadataKey
// ··········· New Metadata key (pda of ['metadata', program id, mint id])
//
// [19] = [WRITE] newEditionPDA
// ··········· New Edition (pda of ['metadata', program id, mint id, 'edition'])
//
// [20] = [WRITE] masterEdition
// ··········· Master Edition of token in vault V2 (pda of ['metadata', program id, master metadata mint id, 'edition']) PDA is relative to token metadata.
//
// [21] = [WRITE] newTokenMint
// ··········· Mint of new token
//
// [22] = [WRITE] editionPDA
// ··········· Edition pda to mark creation - will be checked for pre-existence. (pda of ['metadata', program id, master metadata mint id, 'edition', edition_number])
// ··········· where edition_number is NOT the edition number you pass in args but actually edition_number = floor(edition/EDITION_MARKER_BIT_SIZE). PDA is relative to token metadata.
//
// [23] = [SIGNER] mintAuthority
// ··········· Mint authority of new mint - THIS WILL TRANSFER AUTHORITY AWAY FROM THIS KEY
//
// [24] = [] metadataAccount
// ··········· Metadata account of token in vault
//
// [25] = [] auctionExtendedPDA
// ··········· Auction extended (pda relative to auction of ['auction', program id, vault key, 'extended'])
ag_solanago.AccountMetaSlice `bin:"-"`
}
// NewRedeemPrintingV2BidInstructionBuilder creates a new `RedeemPrintingV2Bid` instruction builder.
func NewRedeemPrintingV2BidInstructionBuilder() *RedeemPrintingV2Bid {
nd := &RedeemPrintingV2Bid{
AccountMetaSlice: make(ag_solanago.AccountMetaSlice, 26),
}
return nd
}
// SetArgs sets the "args" parameter.
func (inst *RedeemPrintingV2Bid) SetArgs(args RedeemPrintingV2BidArgs) *RedeemPrintingV2Bid {
inst.Args = &args
return inst
}
// SetAuctionManagerAccount sets the "auctionManager" account.
// Auction manager
func (inst *RedeemPrintingV2Bid) SetAuctionManagerAccount(auctionManager ag_solanago.PublicKey) *RedeemPrintingV2Bid {
inst.AccountMetaSlice[0] = ag_solanago.Meta(auctionManager).WRITE()
return inst
}
// GetAuctionManagerAccount gets the "auctionManager" account.
// Auction manager
func (inst *RedeemPrintingV2Bid) GetAuctionManagerAccount() *ag_solanago.AccountMeta {
return inst.AccountMetaSlice.Get(0)
}
// SetSafetyDepositTokenStorageAccount sets the "safetyDepositTokenStorage" account.
// Safety deposit token storage account
func (inst *RedeemPrintingV2Bid) SetSafetyDepositTokenStorageAccount(safetyDepositTokenStorage ag_solanago.PublicKey) *RedeemPrintingV2Bid {
inst.AccountMetaSlice[1] = ag_solanago.Meta(safetyDepositTokenStorage).WRITE()
return inst
}
// GetSafetyDepositTokenStorageAccount gets the "safetyDepositTokenStorage" account.
// Safety deposit token storage account
func (inst *RedeemPrintingV2Bid) GetSafetyDepositTokenStorageAccount() *ag_solanago.AccountMeta {
return inst.AccountMetaSlice.Get(1)
}
// SetSingleItemAccount sets the "singleItemAccount" account.
// Account containing 1 token of your new mint type.
// MUST be an associated token account of pda [wallet, token program, mint] relative to ata program.
func (inst *RedeemPrintingV2Bid) SetSingleItemAccount(singleItemAccount ag_solanago.PublicKey) *RedeemPrintingV2Bid {
inst.AccountMetaSlice[2] = ag_solanago.Meta(singleItemAccount).WRITE()
return inst
}
// GetSingleItemAccount gets the "singleItemAccount" account.
// Account containing 1 token of your new mint type.
// MUST be an associated token account of pda [wallet, token program, mint] relative to ata program.
func (inst *RedeemPrintingV2Bid) GetSingleItemAccount() *ag_solanago.AccountMeta {
return inst.AccountMetaSlice.Get(2)
}
// SetBidRedemptionKeyAccount sets the "bidRedemptionKey" account.
// Bid redemption key -
// Just a PDA with seed ['metaplex', auction_key, bidder_metadata_key] that we will allocate to mark that you redeemed your bid
func (inst *RedeemPrintingV2Bid) SetBidRedemptionKeyAccount(bidRedemptionKey ag_solanago.PublicKey) *RedeemPrintingV2Bid {
inst.AccountMetaSlice[3] = ag_solanago.Meta(bidRedemptionKey).WRITE()
return inst
}
// GetBidRedemptionKeyAccount gets the "bidRedemptionKey" account.
// Bid redemption key -
// Just a PDA with seed ['metaplex', auction_key, bidder_metadata_key] that we will allocate to mark that you redeemed your bid
func (inst *RedeemPrintingV2Bid) GetBidRedemptionKeyAccount() *ag_solanago.AccountMeta {
return inst.AccountMetaSlice.Get(3)
}
// SetSafetyDepositBoxAccount sets the "safetyDepositBox" account.
// Safety deposit box account
func (inst *RedeemPrintingV2Bid) SetSafetyDepositBoxAccount(safetyDepositBox ag_solanago.PublicKey) *RedeemPrintingV2Bid {
inst.AccountMetaSlice[4] = ag_solanago.Meta(safetyDepositBox).WRITE()
return inst
}
// GetSafetyDepositBoxAccount gets the "safetyDepositBox" account.
// Safety deposit box account
func (inst *RedeemPrintingV2Bid) GetSafetyDepositBoxAccount() *ag_solanago.AccountMeta {
return inst.AccountMetaSlice.Get(4)
}
// SetVaultAccount sets the "vaultAccount" account.
// Vault account
func (inst *RedeemPrintingV2Bid) SetVaultAccount(vaultAccount ag_solanago.PublicKey) *RedeemPrintingV2Bid {
inst.AccountMetaSlice[5] = ag_solanago.Meta(vaultAccount).WRITE()
return inst
}
// GetVaultAccount gets the "vaultAccount" account.
// Vault account
func (inst *RedeemPrintingV2Bid) GetVaultAccount() *ag_solanago.AccountMeta {
return inst.AccountMetaSlice.Get(5)
}
// SetSafetyDepositConfigAccount sets the "safetyDepositConfig" account.
// Safety deposit config pda of ['metaplex', program id, auction manager, safety deposit]
// This account will only get used in the event this is an AuctionManagerV2
func (inst *RedeemPrintingV2Bid) SetSafetyDepositConfigAccount(safetyDepositConfig ag_solanago.PublicKey) *RedeemPrintingV2Bid {
inst.AccountMetaSlice[6] = ag_solanago.Meta(safetyDepositConfig)
return inst
}
// GetSafetyDepositConfigAccount gets the "safetyDepositConfig" account.
// Safety deposit config pda of ['metaplex', program id, auction manager, safety deposit]
// This account will only get used in the event this is an AuctionManagerV2
func (inst *RedeemPrintingV2Bid) GetSafetyDepositConfigAccount() *ag_solanago.AccountMeta {
return inst.AccountMetaSlice.Get(6)
}
// SetAuctionAccount sets the "auction" account.
// Auction
func (inst *RedeemPrintingV2Bid) SetAuctionAccount(auction ag_solanago.PublicKey) *RedeemPrintingV2Bid {
inst.AccountMetaSlice[7] = ag_solanago.Meta(auction)
return inst
}
// GetAuctionAccount gets the "auction" account.
// Auction
func (inst *RedeemPrintingV2Bid) GetAuctionAccount() *ag_solanago.AccountMeta {
return inst.AccountMetaSlice.Get(7)
}
// SetBidderMetadataAccount sets the "bidderMetadata" account.
// Your BidderMetadata account
func (inst *RedeemPrintingV2Bid) SetBidderMetadataAccount(bidderMetadata ag_solanago.PublicKey) *RedeemPrintingV2Bid {
inst.AccountMetaSlice[8] = ag_solanago.Meta(bidderMetadata)
return inst
}
// GetBidderMetadataAccount gets the "bidderMetadata" account.
// Your BidderMetadata account
func (inst *RedeemPrintingV2Bid) GetBidderMetadataAccount() *ag_solanago.AccountMeta {
return inst.AccountMetaSlice.Get(8)
}
// SetBidderAccount sets the "bidder" account.
// Your Bidder account - Only needs to be signer if payer does not own
func (inst *RedeemPrintingV2Bid) SetBidderAccount(bidder ag_solanago.PublicKey) *RedeemPrintingV2Bid {
inst.AccountMetaSlice[9] = ag_solanago.Meta(bidder)
return inst
}
// GetBidderAccount gets the "bidder" account.
// Your Bidder account - Only needs to be signer if payer does not own
func (inst *RedeemPrintingV2Bid) GetBidderAccount() *ag_solanago.AccountMeta {
return inst.AccountMetaSlice.Get(9)
}
// SetPayerAccount sets the "payer" account.
// Payer
func (inst *RedeemPrintingV2Bid) SetPayerAccount(payer ag_solanago.PublicKey) *RedeemPrintingV2Bid {
inst.AccountMetaSlice[10] = ag_solanago.Meta(payer).SIGNER()
return inst
}
// GetPayerAccount gets the "payer" account.
// Payer
func (inst *RedeemPrintingV2Bid) GetPayerAccount() *ag_solanago.AccountMeta {
return inst.AccountMetaSlice.Get(10)
}
// SetTokenProgramAccount sets the "tokenProgram" account.
// Token program
func (inst *RedeemPrintingV2Bid) SetTokenProgramAccount(tokenProgram ag_solanago.PublicKey) *RedeemPrintingV2Bid {
inst.AccountMetaSlice[11] = ag_solanago.Meta(tokenProgram)
return inst
}
// GetTokenProgramAccount gets the "tokenProgram" account.
// Token program
func (inst *RedeemPrintingV2Bid) GetTokenProgramAccount() *ag_solanago.AccountMeta {
return inst.AccountMetaSlice.Get(11)
}
// SetTokenVaultProgramAccount sets the "tokenVaultProgram" account.
// Token Vault program
func (inst *RedeemPrintingV2Bid) SetTokenVaultProgramAccount(tokenVaultProgram ag_solanago.PublicKey) *RedeemPrintingV2Bid {
inst.AccountMetaSlice[12] = ag_solanago.Meta(tokenVaultProgram)
return inst
}
// GetTokenVaultProgramAccount gets the "tokenVaultProgram" account.
// Token Vault program
func (inst *RedeemPrintingV2Bid) GetTokenVaultProgramAccount() *ag_solanago.AccountMeta {
return inst.AccountMetaSlice.Get(12)
}
// SetTokenMetadataProgramAccount sets the "tokenMetadataProgram" account.
// Token metadata program
func (inst *RedeemPrintingV2Bid) SetTokenMetadataProgramAccount(tokenMetadataProgram ag_solanago.PublicKey) *RedeemPrintingV2Bid {
inst.AccountMetaSlice[13] = ag_solanago.Meta(tokenMetadataProgram)
return inst
}
// GetTokenMetadataProgramAccount gets the "tokenMetadataProgram" account.
// Token metadata program
func (inst *RedeemPrintingV2Bid) GetTokenMetadataProgramAccount() *ag_solanago.AccountMeta {
return inst.AccountMetaSlice.Get(13)
}
// SetStoreAccount sets the "store" account.
// Store
func (inst *RedeemPrintingV2Bid) SetStoreAccount(store ag_solanago.PublicKey) *RedeemPrintingV2Bid {
inst.AccountMetaSlice[14] = ag_solanago.Meta(store)
return inst
}
// GetStoreAccount gets the "store" account.
// Store
func (inst *RedeemPrintingV2Bid) GetStoreAccount() *ag_solanago.AccountMeta {
return inst.AccountMetaSlice.Get(14)
}
// SetSystemAccount sets the "system" account.
// System
func (inst *RedeemPrintingV2Bid) SetSystemAccount(system ag_solanago.PublicKey) *RedeemPrintingV2Bid {
inst.AccountMetaSlice[15] = ag_solanago.Meta(system)
return inst
}
// GetSystemAccount gets the "system" account.
// System
func (inst *RedeemPrintingV2Bid) GetSystemAccount() *ag_solanago.AccountMeta {
return inst.AccountMetaSlice.Get(15)
}
// SetRentSysvarAccount sets the "rentSysvar" account.
// Rent sysvar
func (inst *RedeemPrintingV2Bid) SetRentSysvarAccount(rentSysvar ag_solanago.PublicKey) *RedeemPrintingV2Bid {
inst.AccountMetaSlice[16] = ag_solanago.Meta(rentSysvar)
return inst
}
// GetRentSysvarAccount gets the "rentSysvar" account.
// Rent sysvar
func (inst *RedeemPrintingV2Bid) GetRentSysvarAccount() *ag_solanago.AccountMeta {
return inst.AccountMetaSlice.Get(16)
}
// SetPrizeTrackingTicketAccount sets the "prizeTrackingTicket" account.
// Prize tracking ticket (pda of ['metaplex', program id, auction manager key, metadata mint id])
func (inst *RedeemPrintingV2Bid) SetPrizeTrackingTicketAccount(prizeTrackingTicket ag_solanago.PublicKey) *RedeemPrintingV2Bid {
inst.AccountMetaSlice[17] = ag_solanago.Meta(prizeTrackingTicket).WRITE()
return inst
}
// GetPrizeTrackingTicketAccount gets the "prizeTrackingTicket" account.
// Prize tracking ticket (pda of ['metaplex', program id, auction manager key, metadata mint id])
func (inst *RedeemPrintingV2Bid) GetPrizeTrackingTicketAccount() *ag_solanago.AccountMeta {
return inst.AccountMetaSlice.Get(17)
}
// SetNewMetadataKeyAccount sets the "newMetadataKey" account.
// New Metadata key (pda of ['metadata', program id, mint id])
func (inst *RedeemPrintingV2Bid) SetNewMetadataKeyAccount(newMetadataKey ag_solanago.PublicKey) *RedeemPrintingV2Bid {
inst.AccountMetaSlice[18] = ag_solanago.Meta(newMetadataKey).WRITE()
return inst
}
// GetNewMetadataKeyAccount gets the "newMetadataKey" account.
// New Metadata key (pda of ['metadata', program id, mint id])
func (inst *RedeemPrintingV2Bid) GetNewMetadataKeyAccount() *ag_solanago.AccountMeta {
return inst.AccountMetaSlice.Get(18)
}
// SetNewEditionPDAAccount sets the "newEditionPDA" account.
// New Edition (pda of ['metadata', program id, mint id, 'edition'])
func (inst *RedeemPrintingV2Bid) SetNewEditionPDAAccount(newEditionPDA ag_solanago.PublicKey) *RedeemPrintingV2Bid {
inst.AccountMetaSlice[19] = ag_solanago.Meta(newEditionPDA).WRITE()
return inst
}
// GetNewEditionPDAAccount gets the "newEditionPDA" account.
// New Edition (pda of ['metadata', program id, mint id, 'edition'])
func (inst *RedeemPrintingV2Bid) GetNewEditionPDAAccount() *ag_solanago.AccountMeta {
return inst.AccountMetaSlice.Get(19)
}
// SetMasterEditionAccount sets the "masterEdition" account.
// Master Edition of token in vault V2 (pda of ['metadata', program id, master metadata mint id, 'edition']) PDA is relative to token metadata.
func (inst *RedeemPrintingV2Bid) SetMasterEditionAccount(masterEdition ag_solanago.PublicKey) *RedeemPrintingV2Bid {
inst.AccountMetaSlice[20] = ag_solanago.Meta(masterEdition).WRITE()
return inst
}
// GetMasterEditionAccount gets the "masterEdition" account.
// Master Edition of token in vault V2 (pda of ['metadata', program id, master metadata mint id, 'edition']) PDA is relative to token metadata.
func (inst *RedeemPrintingV2Bid) GetMasterEditionAccount() *ag_solanago.AccountMeta {
return inst.AccountMetaSlice.Get(20)
}
// SetNewTokenMintAccount sets the "newTokenMint" account.
// Mint of new token
func (inst *RedeemPrintingV2Bid) SetNewTokenMintAccount(newTokenMint ag_solanago.PublicKey) *RedeemPrintingV2Bid {
inst.AccountMetaSlice[21] = ag_solanago.Meta(newTokenMint).WRITE()
return inst
}
// GetNewTokenMintAccount gets the "newTokenMint" account.
// Mint of new token
func (inst *RedeemPrintingV2Bid) GetNewTokenMintAccount() *ag_solanago.AccountMeta {
return inst.AccountMetaSlice.Get(21)
}
// SetEditionPDAAccount sets the "editionPDA" account.
// Edition pda to mark creation - will be checked for pre-existence. (pda of ['metadata', program id, master metadata mint id, 'edition', edition_number])
// where edition_number is NOT the edition number you pass in args but actually edition_number = floor(edition/EDITION_MARKER_BIT_SIZE). PDA is relative to token metadata.
func (inst *RedeemPrintingV2Bid) SetEditionPDAAccount(editionPDA ag_solanago.PublicKey) *RedeemPrintingV2Bid {
inst.AccountMetaSlice[22] = ag_solanago.Meta(editionPDA).WRITE()
return inst
}
// GetEditionPDAAccount gets the "editionPDA" account.
// Edition pda to mark creation - will be checked for pre-existence. (pda of ['metadata', program id, master metadata mint id, 'edition', edition_number])
// where edition_number is NOT the edition number you pass in args but actually edition_number = floor(edition/EDITION_MARKER_BIT_SIZE). PDA is relative to token metadata.
func (inst *RedeemPrintingV2Bid) GetEditionPDAAccount() *ag_solanago.AccountMeta {
return inst.AccountMetaSlice.Get(22)
}
// SetMintAuthorityAccount sets the "mintAuthority" account.
// Mint authority of new mint - THIS WILL TRANSFER AUTHORITY AWAY FROM THIS KEY
func (inst *RedeemPrintingV2Bid) SetMintAuthorityAccount(mintAuthority ag_solanago.PublicKey) *RedeemPrintingV2Bid {
inst.AccountMetaSlice[23] = ag_solanago.Meta(mintAuthority).SIGNER()
return inst
}
// GetMintAuthorityAccount gets the "mintAuthority" account.
// Mint authority of new mint - THIS WILL TRANSFER AUTHORITY AWAY FROM THIS KEY
func (inst *RedeemPrintingV2Bid) GetMintAuthorityAccount() *ag_solanago.AccountMeta {
return inst.AccountMetaSlice.Get(23)
}
// SetMetadataAccount sets the "metadataAccount" account.
// Metadata account of token in vault
func (inst *RedeemPrintingV2Bid) SetMetadataAccount(metadataAccount ag_solanago.PublicKey) *RedeemPrintingV2Bid {
inst.AccountMetaSlice[24] = ag_solanago.Meta(metadataAccount)
return inst
}
// GetMetadataAccount gets the "metadataAccount" account.
// Metadata account of token in vault
func (inst *RedeemPrintingV2Bid) GetMetadataAccount() *ag_solanago.AccountMeta {
return inst.AccountMetaSlice.Get(24)
}
// SetAuctionExtendedPDAAccount sets the "auctionExtendedPDA" account.
// Auction extended (pda relative to auction of ['auction', program id, vault key, 'extended'])
func (inst *RedeemPrintingV2Bid) SetAuctionExtendedPDAAccount(auctionExtendedPDA ag_solanago.PublicKey) *RedeemPrintingV2Bid {
inst.AccountMetaSlice[25] = ag_solanago.Meta(auctionExtendedPDA)
return inst
}
// GetAuctionExtendedPDAAccount gets the "auctionExtendedPDA" account.
// Auction extended (pda relative to auction of ['auction', program id, vault key, 'extended'])
func (inst *RedeemPrintingV2Bid) GetAuctionExtendedPDAAccount() *ag_solanago.AccountMeta {
return inst.AccountMetaSlice.Get(25)
}
func (inst RedeemPrintingV2Bid) Build() *Instruction {
return &Instruction{BaseVariant: ag_binary.BaseVariant{
Impl: inst,
TypeID: ag_binary.TypeIDFromUint8(Instruction_RedeemPrintingV2Bid),
}}
}
// ValidateAndBuild validates the instruction parameters and accounts;
// if there is a validation error, it returns the error.
// Otherwise, it builds and returns the instruction.
func (inst RedeemPrintingV2Bid) ValidateAndBuild() (*Instruction, error) {
if err := inst.Validate(); err != nil {
return nil, err
}
return inst.Build(), nil
}
func (inst *RedeemPrintingV2Bid) Validate() error {
// Check whether all (required) parameters are set:
{
if inst.Args == nil {
return errors.New("Args parameter is not set")
}
}
// Check whether all (required) accounts are set:
{
if inst.AccountMetaSlice[0] == nil {
return errors.New("accounts.AuctionManager is not set")
}
if inst.AccountMetaSlice[1] == nil {
return errors.New("accounts.SafetyDepositTokenStorage is not set")
}
if inst.AccountMetaSlice[2] == nil {
return errors.New("accounts.SingleItemAccount is not set")
}
if inst.AccountMetaSlice[3] == nil {
return errors.New("accounts.BidRedemptionKey is not set")
}
if inst.AccountMetaSlice[4] == nil {
return errors.New("accounts.SafetyDepositBox is not set")
}
if inst.AccountMetaSlice[5] == nil {
return errors.New("accounts.VaultAccount is not set")
}
if inst.AccountMetaSlice[6] == nil {
return errors.New("accounts.SafetyDepositConfig is not set")
}
if inst.AccountMetaSlice[7] == nil {
return errors.New("accounts.Auction is not set")
}
if inst.AccountMetaSlice[8] == nil {
return errors.New("accounts.BidderMetadata is not set")
}
if inst.AccountMetaSlice[9] == nil {
return errors.New("accounts.Bidder is not set")
}
if inst.AccountMetaSlice[10] == nil {
return errors.New("accounts.Payer is not set")
}
if inst.AccountMetaSlice[11] == nil {
return errors.New("accounts.TokenProgram is not set")
}
if inst.AccountMetaSlice[12] == nil {
return errors.New("accounts.TokenVaultProgram is not set")
}
if inst.AccountMetaSlice[13] == nil {
return errors.New("accounts.TokenMetadataProgram is not set")
}
if inst.AccountMetaSlice[14] == nil {
return errors.New("accounts.Store is not set")
}
if inst.AccountMetaSlice[15] == nil {
return errors.New("accounts.System is not set")
}
if inst.AccountMetaSlice[16] == nil {
return errors.New("accounts.RentSysvar is not set")
}
if inst.AccountMetaSlice[17] == nil {
return errors.New("accounts.PrizeTrackingTicket is not set")
}
if inst.AccountMetaSlice[18] == nil {
return errors.New("accounts.NewMetadataKey is not set")
}
if inst.AccountMetaSlice[19] == nil {
return errors.New("accounts.NewEditionPDA is not set")
}
if inst.AccountMetaSlice[20] == nil {
return errors.New("accounts.MasterEdition is not set")
}
if inst.AccountMetaSlice[21] == nil {
return errors.New("accounts.NewTokenMint is not set")
}
if inst.AccountMetaSlice[22] == nil {
return errors.New("accounts.EditionPDA is not set")
}
if inst.AccountMetaSlice[23] == nil {
return errors.New("accounts.MintAuthority is not set")
}
if inst.AccountMetaSlice[24] == nil {
return errors.New("accounts.MetadataAccount is not set")
}
if inst.AccountMetaSlice[25] == nil {
return errors.New("accounts.AuctionExtendedPDA is not set")
}
}
return nil
}
func (inst *RedeemPrintingV2Bid) EncodeToTree(parent ag_treeout.Branches) {
parent.Child(ag_format.Program(ProgramName, ProgramID)).
//
ParentFunc(func(programBranch ag_treeout.Branches) {
programBranch.Child(ag_format.Instruction("RedeemPrintingV2Bid")).
//
ParentFunc(func(instructionBranch ag_treeout.Branches) {
// Parameters of the instruction:
instructionBranch.Child("Params[len=1]").ParentFunc(func(paramsBranch ag_treeout.Branches) {
paramsBranch.Child(ag_format.Param("Args", *inst.Args))
})
// Accounts of the instruction:
instructionBranch.Child("Accounts[len=26]").ParentFunc(func(accountsBranch ag_treeout.Branches) {
accountsBranch.Child(ag_format.Meta(" auctionManager", inst.AccountMetaSlice.Get(0)))
accountsBranch.Child(ag_format.Meta("safetyDepositTokenStorage", inst.AccountMetaSlice.Get(1)))
accountsBranch.Child(ag_format.Meta(" singleItem", inst.AccountMetaSlice.Get(2)))
accountsBranch.Child(ag_format.Meta(" bidRedemptionKey", inst.AccountMetaSlice.Get(3)))
accountsBranch.Child(ag_format.Meta(" safetyDepositBox", inst.AccountMetaSlice.Get(4)))
accountsBranch.Child(ag_format.Meta(" vault", inst.AccountMetaSlice.Get(5)))
accountsBranch.Child(ag_format.Meta(" safetyDepositConfig", inst.AccountMetaSlice.Get(6)))
accountsBranch.Child(ag_format.Meta(" auction", inst.AccountMetaSlice.Get(7)))
accountsBranch.Child(ag_format.Meta(" bidderMetadata", inst.AccountMetaSlice.Get(8)))
accountsBranch.Child(ag_format.Meta(" bidder", inst.AccountMetaSlice.Get(9)))
accountsBranch.Child(ag_format.Meta(" payer", inst.AccountMetaSlice.Get(10)))
accountsBranch.Child(ag_format.Meta(" tokenProgram", inst.AccountMetaSlice.Get(11)))
accountsBranch.Child(ag_format.Meta(" tokenVaultProgram", inst.AccountMetaSlice.Get(12)))
accountsBranch.Child(ag_format.Meta(" tokenMetadataProgram", inst.AccountMetaSlice.Get(13)))
accountsBranch.Child(ag_format.Meta(" store", inst.AccountMetaSlice.Get(14)))
accountsBranch.Child(ag_format.Meta(" system", inst.AccountMetaSlice.Get(15)))
accountsBranch.Child(ag_format.Meta(" rentSysvar", inst.AccountMetaSlice.Get(16)))
accountsBranch.Child(ag_format.Meta(" prizeTrackingTicket", inst.AccountMetaSlice.Get(17)))
accountsBranch.Child(ag_format.Meta(" newMetadataKey", inst.AccountMetaSlice.Get(18)))
accountsBranch.Child(ag_format.Meta(" newEditionPDA", inst.AccountMetaSlice.Get(19)))
accountsBranch.Child(ag_format.Meta(" masterEdition", inst.AccountMetaSlice.Get(20)))
accountsBranch.Child(ag_format.Meta(" newTokenMint", inst.AccountMetaSlice.Get(21)))
accountsBranch.Child(ag_format.Meta(" editionPDA", inst.AccountMetaSlice.Get(22)))
accountsBranch.Child(ag_format.Meta(" mintAuthority", inst.AccountMetaSlice.Get(23)))
accountsBranch.Child(ag_format.Meta(" metadata", inst.AccountMetaSlice.Get(24)))
accountsBranch.Child(ag_format.Meta(" auctionExtendedPDA", inst.AccountMetaSlice.Get(25)))
})
})
})
}
func (obj RedeemPrintingV2Bid) MarshalWithEncoder(encoder *ag_binary.Encoder) (err error) {
// Serialize `Args` param:
err = encoder.Encode(obj.Args)
if err != nil {
return err
}
return nil
}
func (obj *RedeemPrintingV2Bid) UnmarshalWithDecoder(decoder *ag_binary.Decoder) (err error) {
// Deserialize `Args`:
err = decoder.Decode(&obj.Args)
if err != nil {
return err
}
return nil
}
// NewRedeemPrintingV2BidInstruction declares a new RedeemPrintingV2Bid instruction with the provided parameters and accounts.
func NewRedeemPrintingV2BidInstruction(
// Parameters:
args RedeemPrintingV2BidArgs,
// Accounts:
auctionManager ag_solanago.PublicKey,
safetyDepositTokenStorage ag_solanago.PublicKey,
singleItemAccount ag_solanago.PublicKey,
bidRedemptionKey ag_solanago.PublicKey,
safetyDepositBox ag_solanago.PublicKey,
vaultAccount ag_solanago.PublicKey,
safetyDepositConfig ag_solanago.PublicKey,
auction ag_solanago.PublicKey,
bidderMetadata ag_solanago.PublicKey,
bidder ag_solanago.PublicKey,
payer ag_solanago.PublicKey,
tokenProgram ag_solanago.PublicKey,
tokenVaultProgram ag_solanago.PublicKey,
tokenMetadataProgram ag_solanago.PublicKey,
store ag_solanago.PublicKey,
system ag_solanago.PublicKey,
rentSysvar ag_solanago.PublicKey,
prizeTrackingTicket ag_solanago.PublicKey,
newMetadataKey ag_solanago.PublicKey,
newEditionPDA ag_solanago.PublicKey,
masterEdition ag_solanago.PublicKey,
newTokenMint ag_solanago.PublicKey,
editionPDA ag_solanago.PublicKey,
mintAuthority ag_solanago.PublicKey,
metadataAccount ag_solanago.PublicKey,
auctionExtendedPDA ag_solanago.PublicKey) *RedeemPrintingV2Bid {
return NewRedeemPrintingV2BidInstructionBuilder().
SetArgs(args).
SetAuctionManagerAccount(auctionManager).
SetSafetyDepositTokenStorageAccount(safetyDepositTokenStorage).
SetSingleItemAccount(singleItemAccount).
SetBidRedemptionKeyAccount(bidRedemptionKey).
SetSafetyDepositBoxAccount(safetyDepositBox).
SetVaultAccount(vaultAccount).
SetSafetyDepositConfigAccount(safetyDepositConfig).
SetAuctionAccount(auction).
SetBidderMetadataAccount(bidderMetadata).
SetBidderAccount(bidder).
SetPayerAccount(payer).
SetTokenProgramAccount(tokenProgram).
SetTokenVaultProgramAccount(tokenVaultProgram).
SetTokenMetadataProgramAccount(tokenMetadataProgram).
SetStoreAccount(store).
SetSystemAccount(system).
SetRentSysvarAccount(rentSysvar).
SetPrizeTrackingTicketAccount(prizeTrackingTicket).
SetNewMetadataKeyAccount(newMetadataKey).
SetNewEditionPDAAccount(newEditionPDA).
SetMasterEditionAccount(masterEdition).
SetNewTokenMintAccount(newTokenMint).
SetEditionPDAAccount(editionPDA).
SetMintAuthorityAccount(mintAuthority).
SetMetadataAccount(metadataAccount).
SetAuctionExtendedPDAAccount(auctionExtendedPDA)
}