-
Notifications
You must be signed in to change notification settings - Fork 511
/
SetAndVerifySizedCollectionItem.ts
114 lines (108 loc) · 3.37 KB
/
SetAndVerifySizedCollectionItem.ts
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
/**
* This code was GENERATED using the solita package.
* Please DO NOT EDIT THIS FILE, instead rerun solita to update it or write a wrapper to add functionality.
*
* See: https://github.com/metaplex-foundation/solita
*/
import * as beet from '@metaplex-foundation/beet';
import * as web3 from '@solana/web3.js';
/**
* @category Instructions
* @category SetAndVerifySizedCollectionItem
* @category generated
*/
export const SetAndVerifySizedCollectionItemStruct = new beet.BeetArgsStruct<{
instructionDiscriminator: number;
}>([['instructionDiscriminator', beet.u8]], 'SetAndVerifySizedCollectionItemInstructionArgs');
/**
* Accounts required by the _SetAndVerifySizedCollectionItem_ instruction
*
* @property [_writable_] metadata Metadata account
* @property [**signer**] collectionAuthority Collection Update authority
* @property [_writable_, **signer**] payer payer
* @property [] updateAuthority Update Authority of Collection NFT and NFT
* @property [] collectionMint Mint of the Collection
* @property [_writable_] collection Metadata Account of the Collection
* @property [_writable_] collectionMasterEditionAccount MasterEdition2 Account of the Collection Token
* @property [] collectionAuthorityRecord (optional) Collection Authority Record PDA
* @category Instructions
* @category SetAndVerifySizedCollectionItem
* @category generated
*/
export type SetAndVerifySizedCollectionItemInstructionAccounts = {
metadata: web3.PublicKey;
collectionAuthority: web3.PublicKey;
payer: web3.PublicKey;
updateAuthority: web3.PublicKey;
collectionMint: web3.PublicKey;
collection: web3.PublicKey;
collectionMasterEditionAccount: web3.PublicKey;
collectionAuthorityRecord?: web3.PublicKey;
};
export const setAndVerifySizedCollectionItemInstructionDiscriminator = 32;
/**
* Creates a _SetAndVerifySizedCollectionItem_ instruction.
*
* @param accounts that will be accessed while the instruction is processed
* @category Instructions
* @category SetAndVerifySizedCollectionItem
* @category generated
*/
export function createSetAndVerifySizedCollectionItemInstruction(
accounts: SetAndVerifySizedCollectionItemInstructionAccounts,
programId = new web3.PublicKey('metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s'),
) {
const [data] = SetAndVerifySizedCollectionItemStruct.serialize({
instructionDiscriminator: setAndVerifySizedCollectionItemInstructionDiscriminator,
});
const keys: web3.AccountMeta[] = [
{
pubkey: accounts.metadata,
isWritable: true,
isSigner: false,
},
{
pubkey: accounts.collectionAuthority,
isWritable: false,
isSigner: true,
},
{
pubkey: accounts.payer,
isWritable: true,
isSigner: true,
},
{
pubkey: accounts.updateAuthority,
isWritable: false,
isSigner: false,
},
{
pubkey: accounts.collectionMint,
isWritable: false,
isSigner: false,
},
{
pubkey: accounts.collection,
isWritable: true,
isSigner: false,
},
{
pubkey: accounts.collectionMasterEditionAccount,
isWritable: true,
isSigner: false,
},
];
if (accounts.collectionAuthorityRecord != null) {
keys.push({
pubkey: accounts.collectionAuthorityRecord,
isWritable: false,
isSigner: false,
});
}
const ix = new web3.TransactionInstruction({
programId,
keys,
data,
});
return ix;
}