Skip to content

Commit dc6fad2

Browse files
committed
add functionis to extend attributes
1 parent b02f850 commit dc6fad2

File tree

13 files changed

+5459
-806
lines changed

13 files changed

+5459
-806
lines changed

clients/js/src/generated/instructions/index.ts

+2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ export * from './revokeCollectionPluginAuthorityV1';
2323
export * from './revokePluginAuthorityV1';
2424
export * from './transferV1';
2525
export * from './updateCollectionPluginV1';
26+
export * from './updateCollectionPluginV2';
2627
export * from './updateCollectionV1';
2728
export * from './updatePluginV1';
29+
export * from './updatePluginV2';
2830
export * from './updateV1';
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
/**
2+
* This code was AUTOGENERATED using the kinobi library.
3+
* Please DO NOT EDIT THIS FILE, instead use visitors
4+
* to add features, then rerun kinobi to update it.
5+
*
6+
* @see https://github.com/metaplex-foundation/kinobi
7+
*/
8+
9+
import {
10+
Context,
11+
Option,
12+
OptionOrNullable,
13+
Pda,
14+
PublicKey,
15+
Signer,
16+
TransactionBuilder,
17+
transactionBuilder,
18+
} from '@metaplex-foundation/umi';
19+
import {
20+
Serializer,
21+
mapSerializer,
22+
option,
23+
struct,
24+
u8,
25+
} from '@metaplex-foundation/umi/serializers';
26+
import {
27+
ResolvedAccount,
28+
ResolvedAccountsWithIndices,
29+
getAccountMetasAndSigners,
30+
} from '../shared';
31+
import { Plugin, PluginArgs, getPluginSerializer } from '../types';
32+
33+
// Accounts.
34+
export type UpdateCollectionPluginV2InstructionAccounts = {
35+
/** The address of the asset */
36+
collection: PublicKey | Pda;
37+
/** The account paying for the storage fees */
38+
payer?: Signer;
39+
/** The owner or delegate of the asset */
40+
authority?: Signer;
41+
/** The system program */
42+
systemProgram?: PublicKey | Pda;
43+
/** The SPL Noop Program */
44+
logWrapper?: PublicKey | Pda;
45+
/** Optional buffer account containing plugin data */
46+
bufferAccount?: PublicKey | Pda;
47+
};
48+
49+
// Data.
50+
export type UpdateCollectionPluginV2InstructionData = {
51+
discriminator: number;
52+
plugin: Option<Plugin>;
53+
};
54+
55+
export type UpdateCollectionPluginV2InstructionDataArgs = {
56+
plugin: OptionOrNullable<PluginArgs>;
57+
};
58+
59+
export function getUpdateCollectionPluginV2InstructionDataSerializer(): Serializer<
60+
UpdateCollectionPluginV2InstructionDataArgs,
61+
UpdateCollectionPluginV2InstructionData
62+
> {
63+
return mapSerializer<
64+
UpdateCollectionPluginV2InstructionDataArgs,
65+
any,
66+
UpdateCollectionPluginV2InstructionData
67+
>(
68+
struct<UpdateCollectionPluginV2InstructionData>(
69+
[
70+
['discriminator', u8()],
71+
['plugin', option(getPluginSerializer())],
72+
],
73+
{ description: 'UpdateCollectionPluginV2InstructionData' }
74+
),
75+
(value) => ({ ...value, discriminator: 21 })
76+
) as Serializer<
77+
UpdateCollectionPluginV2InstructionDataArgs,
78+
UpdateCollectionPluginV2InstructionData
79+
>;
80+
}
81+
82+
// Args.
83+
export type UpdateCollectionPluginV2InstructionArgs =
84+
UpdateCollectionPluginV2InstructionDataArgs;
85+
86+
// Instruction.
87+
export function updateCollectionPluginV2(
88+
context: Pick<Context, 'payer' | 'programs'>,
89+
input: UpdateCollectionPluginV2InstructionAccounts &
90+
UpdateCollectionPluginV2InstructionArgs
91+
): TransactionBuilder {
92+
// Program ID.
93+
const programId = context.programs.getPublicKey(
94+
'mplCore',
95+
'CoREENxT6tW1HoK8ypY1SxRMZTcVPm7R94rH4PZNhX7d'
96+
);
97+
98+
// Accounts.
99+
const resolvedAccounts = {
100+
collection: {
101+
index: 0,
102+
isWritable: true as boolean,
103+
value: input.collection ?? null,
104+
},
105+
payer: {
106+
index: 1,
107+
isWritable: true as boolean,
108+
value: input.payer ?? null,
109+
},
110+
authority: {
111+
index: 2,
112+
isWritable: false as boolean,
113+
value: input.authority ?? null,
114+
},
115+
systemProgram: {
116+
index: 3,
117+
isWritable: false as boolean,
118+
value: input.systemProgram ?? null,
119+
},
120+
logWrapper: {
121+
index: 4,
122+
isWritable: false as boolean,
123+
value: input.logWrapper ?? null,
124+
},
125+
bufferAccount: {
126+
index: 5,
127+
isWritable: false as boolean,
128+
value: input.bufferAccount ?? null,
129+
},
130+
} satisfies ResolvedAccountsWithIndices;
131+
132+
// Arguments.
133+
const resolvedArgs: UpdateCollectionPluginV2InstructionArgs = { ...input };
134+
135+
// Default values.
136+
if (!resolvedAccounts.payer.value) {
137+
resolvedAccounts.payer.value = context.payer;
138+
}
139+
if (!resolvedAccounts.systemProgram.value) {
140+
resolvedAccounts.systemProgram.value = context.programs.getPublicKey(
141+
'splSystem',
142+
'11111111111111111111111111111111'
143+
);
144+
resolvedAccounts.systemProgram.isWritable = false;
145+
}
146+
147+
// Accounts in order.
148+
const orderedAccounts: ResolvedAccount[] = Object.values(
149+
resolvedAccounts
150+
).sort((a, b) => a.index - b.index);
151+
152+
// Keys and Signers.
153+
const [keys, signers] = getAccountMetasAndSigners(
154+
orderedAccounts,
155+
'programId',
156+
programId
157+
);
158+
159+
// Data.
160+
const data = getUpdateCollectionPluginV2InstructionDataSerializer().serialize(
161+
resolvedArgs as UpdateCollectionPluginV2InstructionDataArgs
162+
);
163+
164+
// Bytes Created On Chain.
165+
const bytesCreatedOnChain = 0;
166+
167+
return transactionBuilder([
168+
{ instruction: { keys, programId, data }, signers, bytesCreatedOnChain },
169+
]);
170+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,175 @@
1+
/**
2+
* This code was AUTOGENERATED using the kinobi library.
3+
* Please DO NOT EDIT THIS FILE, instead use visitors
4+
* to add features, then rerun kinobi to update it.
5+
*
6+
* @see https://github.com/metaplex-foundation/kinobi
7+
*/
8+
9+
import {
10+
Context,
11+
Option,
12+
OptionOrNullable,
13+
Pda,
14+
PublicKey,
15+
Signer,
16+
TransactionBuilder,
17+
transactionBuilder,
18+
} from '@metaplex-foundation/umi';
19+
import {
20+
Serializer,
21+
mapSerializer,
22+
option,
23+
struct,
24+
u8,
25+
} from '@metaplex-foundation/umi/serializers';
26+
import {
27+
ResolvedAccount,
28+
ResolvedAccountsWithIndices,
29+
getAccountMetasAndSigners,
30+
} from '../shared';
31+
import { Plugin, PluginArgs, getPluginSerializer } from '../types';
32+
33+
// Accounts.
34+
export type UpdatePluginV2InstructionAccounts = {
35+
/** The address of the asset */
36+
asset: PublicKey | Pda;
37+
/** The collection to which the asset belongs */
38+
collection?: PublicKey | Pda;
39+
/** The account paying for the storage fees */
40+
payer?: Signer;
41+
/** The owner or delegate of the asset */
42+
authority?: Signer;
43+
/** The system program */
44+
systemProgram?: PublicKey | Pda;
45+
/** The SPL Noop Program */
46+
logWrapper?: PublicKey | Pda;
47+
/** Optional buffer account containing plugin data */
48+
bufferAccount?: PublicKey | Pda;
49+
};
50+
51+
// Data.
52+
export type UpdatePluginV2InstructionData = {
53+
discriminator: number;
54+
plugin: Option<Plugin>;
55+
};
56+
57+
export type UpdatePluginV2InstructionDataArgs = {
58+
plugin: OptionOrNullable<PluginArgs>;
59+
};
60+
61+
export function getUpdatePluginV2InstructionDataSerializer(): Serializer<
62+
UpdatePluginV2InstructionDataArgs,
63+
UpdatePluginV2InstructionData
64+
> {
65+
return mapSerializer<
66+
UpdatePluginV2InstructionDataArgs,
67+
any,
68+
UpdatePluginV2InstructionData
69+
>(
70+
struct<UpdatePluginV2InstructionData>(
71+
[
72+
['discriminator', u8()],
73+
['plugin', option(getPluginSerializer())],
74+
],
75+
{ description: 'UpdatePluginV2InstructionData' }
76+
),
77+
(value) => ({ ...value, discriminator: 20 })
78+
) as Serializer<
79+
UpdatePluginV2InstructionDataArgs,
80+
UpdatePluginV2InstructionData
81+
>;
82+
}
83+
84+
// Args.
85+
export type UpdatePluginV2InstructionArgs = UpdatePluginV2InstructionDataArgs;
86+
87+
// Instruction.
88+
export function updatePluginV2(
89+
context: Pick<Context, 'payer' | 'programs'>,
90+
input: UpdatePluginV2InstructionAccounts & UpdatePluginV2InstructionArgs
91+
): TransactionBuilder {
92+
// Program ID.
93+
const programId = context.programs.getPublicKey(
94+
'mplCore',
95+
'CoREENxT6tW1HoK8ypY1SxRMZTcVPm7R94rH4PZNhX7d'
96+
);
97+
98+
// Accounts.
99+
const resolvedAccounts = {
100+
asset: {
101+
index: 0,
102+
isWritable: true as boolean,
103+
value: input.asset ?? null,
104+
},
105+
collection: {
106+
index: 1,
107+
isWritable: true as boolean,
108+
value: input.collection ?? null,
109+
},
110+
payer: {
111+
index: 2,
112+
isWritable: true as boolean,
113+
value: input.payer ?? null,
114+
},
115+
authority: {
116+
index: 3,
117+
isWritable: false as boolean,
118+
value: input.authority ?? null,
119+
},
120+
systemProgram: {
121+
index: 4,
122+
isWritable: false as boolean,
123+
value: input.systemProgram ?? null,
124+
},
125+
logWrapper: {
126+
index: 5,
127+
isWritable: false as boolean,
128+
value: input.logWrapper ?? null,
129+
},
130+
bufferAccount: {
131+
index: 6,
132+
isWritable: false as boolean,
133+
value: input.bufferAccount ?? null,
134+
},
135+
} satisfies ResolvedAccountsWithIndices;
136+
137+
// Arguments.
138+
const resolvedArgs: UpdatePluginV2InstructionArgs = { ...input };
139+
140+
// Default values.
141+
if (!resolvedAccounts.payer.value) {
142+
resolvedAccounts.payer.value = context.payer;
143+
}
144+
if (!resolvedAccounts.systemProgram.value) {
145+
resolvedAccounts.systemProgram.value = context.programs.getPublicKey(
146+
'splSystem',
147+
'11111111111111111111111111111111'
148+
);
149+
resolvedAccounts.systemProgram.isWritable = false;
150+
}
151+
152+
// Accounts in order.
153+
const orderedAccounts: ResolvedAccount[] = Object.values(
154+
resolvedAccounts
155+
).sort((a, b) => a.index - b.index);
156+
157+
// Keys and Signers.
158+
const [keys, signers] = getAccountMetasAndSigners(
159+
orderedAccounts,
160+
'programId',
161+
programId
162+
);
163+
164+
// Data.
165+
const data = getUpdatePluginV2InstructionDataSerializer().serialize(
166+
resolvedArgs as UpdatePluginV2InstructionDataArgs
167+
);
168+
169+
// Bytes Created On Chain.
170+
const bytesCreatedOnChain = 0;
171+
172+
return transactionBuilder([
173+
{ instruction: { keys, programId, data }, signers, bytesCreatedOnChain },
174+
]);
175+
}

clients/rust/Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ num-derive = "^0.3"
2020
num-traits = "^0.2"
2121
serde = { version = "^1.0", features = ["derive"], optional = true }
2222
serde_with = { version = "^3.0", optional = true }
23-
solana-program = "> 1.14, < 1.18"
23+
solana-program = "> 1.14, < 1.19"
2424
thiserror = "^1.0"
2525
base64 = "0.22.0"
2626

2727
[dev-dependencies]
2828
assert_matches = "1.5.0"
29-
solana-program-test = "> 1.14, < 1.18"
30-
solana-sdk = "> 1.14, < 1.18"
29+
solana-program-test = "> 1.14, < 1.19"
30+
solana-sdk = "> 1.14, < 1.19"

clients/rust/src/generated/instructions/mod.rs

+4
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@ pub(crate) mod r#revoke_collection_plugin_authority_v1;
2222
pub(crate) mod r#revoke_plugin_authority_v1;
2323
pub(crate) mod r#transfer_v1;
2424
pub(crate) mod r#update_collection_plugin_v1;
25+
pub(crate) mod r#update_collection_plugin_v2;
2526
pub(crate) mod r#update_collection_v1;
2627
pub(crate) mod r#update_plugin_v1;
28+
pub(crate) mod r#update_plugin_v2;
2729
pub(crate) mod r#update_v1;
2830

2931
pub use self::r#add_collection_plugin_v1::*;
@@ -43,6 +45,8 @@ pub use self::r#revoke_collection_plugin_authority_v1::*;
4345
pub use self::r#revoke_plugin_authority_v1::*;
4446
pub use self::r#transfer_v1::*;
4547
pub use self::r#update_collection_plugin_v1::*;
48+
pub use self::r#update_collection_plugin_v2::*;
4649
pub use self::r#update_collection_v1::*;
4750
pub use self::r#update_plugin_v1::*;
51+
pub use self::r#update_plugin_v2::*;
4852
pub use self::r#update_v1::*;

0 commit comments

Comments
 (0)