Skip to content

Commit e99a8e8

Browse files
committed
change implementation
1 parent bfd460b commit e99a8e8

File tree

10 files changed

+356
-276
lines changed

10 files changed

+356
-276
lines changed

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ export * from './compressV1';
1717
export * from './createCollectionV1';
1818
export * from './createV1';
1919
export * from './decompressV1';
20-
export * from './extendAtrributesPluginV1';
21-
export * from './extendCollectionAtrributesPluginV1';
2220
export * from './removeCollectionPluginV1';
2321
export * from './removePluginV1';
2422
export * from './revokeCollectionPluginAuthorityV1';
2523
export * from './revokePluginAuthorityV1';
2624
export * from './transferV1';
2725
export * from './updateCollectionPluginV1';
26+
export * from './updateCollectionPluginV2';
2827
export * from './updateCollectionV1';
2928
export * from './updatePluginV1';
29+
export * from './updatePluginV2';
3030
export * from './updateV1';

clients/js/src/generated/instructions/extendCollectionAtrributesPluginV1.ts clients/js/src/generated/instructions/updateCollectionPluginV2.ts

+35-28
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
import {
1010
Context,
11+
Option,
12+
OptionOrNullable,
1113
Pda,
1214
PublicKey,
1315
Signer,
@@ -17,6 +19,7 @@ import {
1719
import {
1820
Serializer,
1921
mapSerializer,
22+
option,
2023
struct,
2124
u8,
2225
} from '@metaplex-foundation/umi/serializers';
@@ -25,10 +28,10 @@ import {
2528
ResolvedAccountsWithIndices,
2629
getAccountMetasAndSigners,
2730
} from '../shared';
28-
import { Attribute, AttributeArgs, getAttributeSerializer } from '../types';
31+
import { Plugin, PluginArgs, getPluginSerializer } from '../types';
2932

3033
// Accounts.
31-
export type ExtendCollectionAtrributesPluginV1InstructionAccounts = {
34+
export type UpdateCollectionPluginV2InstructionAccounts = {
3235
/** The address of the asset */
3336
collection: PublicKey | Pda;
3437
/** The account paying for the storage fees */
@@ -39,50 +42,52 @@ export type ExtendCollectionAtrributesPluginV1InstructionAccounts = {
3942
systemProgram?: PublicKey | Pda;
4043
/** The SPL Noop Program */
4144
logWrapper?: PublicKey | Pda;
45+
/** Optional buffer account containing plugin data */
46+
bufferAccount?: PublicKey | Pda;
4247
};
4348

4449
// Data.
45-
export type ExtendCollectionAtrributesPluginV1InstructionData = {
50+
export type UpdateCollectionPluginV2InstructionData = {
4651
discriminator: number;
47-
attribute: Attribute;
52+
plugin: Option<Plugin>;
4853
};
4954

50-
export type ExtendCollectionAtrributesPluginV1InstructionDataArgs = {
51-
attribute: AttributeArgs;
55+
export type UpdateCollectionPluginV2InstructionDataArgs = {
56+
plugin: OptionOrNullable<PluginArgs>;
5257
};
5358

54-
export function getExtendCollectionAtrributesPluginV1InstructionDataSerializer(): Serializer<
55-
ExtendCollectionAtrributesPluginV1InstructionDataArgs,
56-
ExtendCollectionAtrributesPluginV1InstructionData
59+
export function getUpdateCollectionPluginV2InstructionDataSerializer(): Serializer<
60+
UpdateCollectionPluginV2InstructionDataArgs,
61+
UpdateCollectionPluginV2InstructionData
5762
> {
5863
return mapSerializer<
59-
ExtendCollectionAtrributesPluginV1InstructionDataArgs,
64+
UpdateCollectionPluginV2InstructionDataArgs,
6065
any,
61-
ExtendCollectionAtrributesPluginV1InstructionData
66+
UpdateCollectionPluginV2InstructionData
6267
>(
63-
struct<ExtendCollectionAtrributesPluginV1InstructionData>(
68+
struct<UpdateCollectionPluginV2InstructionData>(
6469
[
6570
['discriminator', u8()],
66-
['attribute', getAttributeSerializer()],
71+
['plugin', option(getPluginSerializer())],
6772
],
68-
{ description: 'ExtendCollectionAtrributesPluginV1InstructionData' }
73+
{ description: 'UpdateCollectionPluginV2InstructionData' }
6974
),
7075
(value) => ({ ...value, discriminator: 21 })
7176
) as Serializer<
72-
ExtendCollectionAtrributesPluginV1InstructionDataArgs,
73-
ExtendCollectionAtrributesPluginV1InstructionData
77+
UpdateCollectionPluginV2InstructionDataArgs,
78+
UpdateCollectionPluginV2InstructionData
7479
>;
7580
}
7681

7782
// Args.
78-
export type ExtendCollectionAtrributesPluginV1InstructionArgs =
79-
ExtendCollectionAtrributesPluginV1InstructionDataArgs;
83+
export type UpdateCollectionPluginV2InstructionArgs =
84+
UpdateCollectionPluginV2InstructionDataArgs;
8085

8186
// Instruction.
82-
export function extendCollectionAtrributesPluginV1(
87+
export function updateCollectionPluginV2(
8388
context: Pick<Context, 'payer' | 'programs'>,
84-
input: ExtendCollectionAtrributesPluginV1InstructionAccounts &
85-
ExtendCollectionAtrributesPluginV1InstructionArgs
89+
input: UpdateCollectionPluginV2InstructionAccounts &
90+
UpdateCollectionPluginV2InstructionArgs
8691
): TransactionBuilder {
8792
// Program ID.
8893
const programId = context.programs.getPublicKey(
@@ -117,12 +122,15 @@ export function extendCollectionAtrributesPluginV1(
117122
isWritable: false as boolean,
118123
value: input.logWrapper ?? null,
119124
},
125+
bufferAccount: {
126+
index: 5,
127+
isWritable: false as boolean,
128+
value: input.bufferAccount ?? null,
129+
},
120130
} satisfies ResolvedAccountsWithIndices;
121131

122132
// Arguments.
123-
const resolvedArgs: ExtendCollectionAtrributesPluginV1InstructionArgs = {
124-
...input,
125-
};
133+
const resolvedArgs: UpdateCollectionPluginV2InstructionArgs = { ...input };
126134

127135
// Default values.
128136
if (!resolvedAccounts.payer.value) {
@@ -149,10 +157,9 @@ export function extendCollectionAtrributesPluginV1(
149157
);
150158

151159
// Data.
152-
const data =
153-
getExtendCollectionAtrributesPluginV1InstructionDataSerializer().serialize(
154-
resolvedArgs as ExtendCollectionAtrributesPluginV1InstructionDataArgs
155-
);
160+
const data = getUpdateCollectionPluginV2InstructionDataSerializer().serialize(
161+
resolvedArgs as UpdateCollectionPluginV2InstructionDataArgs
162+
);
156163

157164
// Bytes Created On Chain.
158165
const bytesCreatedOnChain = 0;

clients/js/src/generated/instructions/extendAtrributesPluginV1.ts clients/js/src/generated/instructions/updatePluginV2.ts

+32-24
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
import {
1010
Context,
11+
Option,
12+
OptionOrNullable,
1113
Pda,
1214
PublicKey,
1315
Signer,
@@ -17,6 +19,7 @@ import {
1719
import {
1820
Serializer,
1921
mapSerializer,
22+
option,
2023
struct,
2124
u8,
2225
} from '@metaplex-foundation/umi/serializers';
@@ -25,10 +28,10 @@ import {
2528
ResolvedAccountsWithIndices,
2629
getAccountMetasAndSigners,
2730
} from '../shared';
28-
import { Attribute, AttributeArgs, getAttributeSerializer } from '../types';
31+
import { Plugin, PluginArgs, getPluginSerializer } from '../types';
2932

3033
// Accounts.
31-
export type ExtendAtrributesPluginV1InstructionAccounts = {
34+
export type UpdatePluginV2InstructionAccounts = {
3235
/** The address of the asset */
3336
asset: PublicKey | Pda;
3437
/** The collection to which the asset belongs */
@@ -41,50 +44,50 @@ export type ExtendAtrributesPluginV1InstructionAccounts = {
4144
systemProgram?: PublicKey | Pda;
4245
/** The SPL Noop Program */
4346
logWrapper?: PublicKey | Pda;
47+
/** Optional buffer account containing plugin data */
48+
bufferAccount?: PublicKey | Pda;
4449
};
4550

4651
// Data.
47-
export type ExtendAtrributesPluginV1InstructionData = {
52+
export type UpdatePluginV2InstructionData = {
4853
discriminator: number;
49-
attribute: Attribute;
54+
plugin: Option<Plugin>;
5055
};
5156

52-
export type ExtendAtrributesPluginV1InstructionDataArgs = {
53-
attribute: AttributeArgs;
57+
export type UpdatePluginV2InstructionDataArgs = {
58+
plugin: OptionOrNullable<PluginArgs>;
5459
};
5560

56-
export function getExtendAtrributesPluginV1InstructionDataSerializer(): Serializer<
57-
ExtendAtrributesPluginV1InstructionDataArgs,
58-
ExtendAtrributesPluginV1InstructionData
61+
export function getUpdatePluginV2InstructionDataSerializer(): Serializer<
62+
UpdatePluginV2InstructionDataArgs,
63+
UpdatePluginV2InstructionData
5964
> {
6065
return mapSerializer<
61-
ExtendAtrributesPluginV1InstructionDataArgs,
66+
UpdatePluginV2InstructionDataArgs,
6267
any,
63-
ExtendAtrributesPluginV1InstructionData
68+
UpdatePluginV2InstructionData
6469
>(
65-
struct<ExtendAtrributesPluginV1InstructionData>(
70+
struct<UpdatePluginV2InstructionData>(
6671
[
6772
['discriminator', u8()],
68-
['attribute', getAttributeSerializer()],
73+
['plugin', option(getPluginSerializer())],
6974
],
70-
{ description: 'ExtendAtrributesPluginV1InstructionData' }
75+
{ description: 'UpdatePluginV2InstructionData' }
7176
),
7277
(value) => ({ ...value, discriminator: 20 })
7378
) as Serializer<
74-
ExtendAtrributesPluginV1InstructionDataArgs,
75-
ExtendAtrributesPluginV1InstructionData
79+
UpdatePluginV2InstructionDataArgs,
80+
UpdatePluginV2InstructionData
7681
>;
7782
}
7883

7984
// Args.
80-
export type ExtendAtrributesPluginV1InstructionArgs =
81-
ExtendAtrributesPluginV1InstructionDataArgs;
85+
export type UpdatePluginV2InstructionArgs = UpdatePluginV2InstructionDataArgs;
8286

8387
// Instruction.
84-
export function extendAtrributesPluginV1(
88+
export function updatePluginV2(
8589
context: Pick<Context, 'payer' | 'programs'>,
86-
input: ExtendAtrributesPluginV1InstructionAccounts &
87-
ExtendAtrributesPluginV1InstructionArgs
90+
input: UpdatePluginV2InstructionAccounts & UpdatePluginV2InstructionArgs
8891
): TransactionBuilder {
8992
// Program ID.
9093
const programId = context.programs.getPublicKey(
@@ -124,10 +127,15 @@ export function extendAtrributesPluginV1(
124127
isWritable: false as boolean,
125128
value: input.logWrapper ?? null,
126129
},
130+
bufferAccount: {
131+
index: 6,
132+
isWritable: false as boolean,
133+
value: input.bufferAccount ?? null,
134+
},
127135
} satisfies ResolvedAccountsWithIndices;
128136

129137
// Arguments.
130-
const resolvedArgs: ExtendAtrributesPluginV1InstructionArgs = { ...input };
138+
const resolvedArgs: UpdatePluginV2InstructionArgs = { ...input };
131139

132140
// Default values.
133141
if (!resolvedAccounts.payer.value) {
@@ -154,8 +162,8 @@ export function extendAtrributesPluginV1(
154162
);
155163

156164
// Data.
157-
const data = getExtendAtrributesPluginV1InstructionDataSerializer().serialize(
158-
resolvedArgs as ExtendAtrributesPluginV1InstructionDataArgs
165+
const data = getUpdatePluginV2InstructionDataSerializer().serialize(
166+
resolvedArgs as UpdatePluginV2InstructionDataArgs
159167
);
160168

161169
// Bytes Created On Chain.

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

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,16 @@ pub(crate) mod r#compress_v1;
1616
pub(crate) mod r#create_collection_v1;
1717
pub(crate) mod r#create_v1;
1818
pub(crate) mod r#decompress_v1;
19-
pub(crate) mod r#extend_atrributes_plugin_v1;
20-
pub(crate) mod r#extend_collection_atrributes_plugin_v1;
2119
pub(crate) mod r#remove_collection_plugin_v1;
2220
pub(crate) mod r#remove_plugin_v1;
2321
pub(crate) mod r#revoke_collection_plugin_authority_v1;
2422
pub(crate) mod r#revoke_plugin_authority_v1;
2523
pub(crate) mod r#transfer_v1;
2624
pub(crate) mod r#update_collection_plugin_v1;
25+
pub(crate) mod r#update_collection_plugin_v2;
2726
pub(crate) mod r#update_collection_v1;
2827
pub(crate) mod r#update_plugin_v1;
28+
pub(crate) mod r#update_plugin_v2;
2929
pub(crate) mod r#update_v1;
3030

3131
pub use self::r#add_collection_plugin_v1::*;
@@ -39,14 +39,14 @@ pub use self::r#compress_v1::*;
3939
pub use self::r#create_collection_v1::*;
4040
pub use self::r#create_v1::*;
4141
pub use self::r#decompress_v1::*;
42-
pub use self::r#extend_atrributes_plugin_v1::*;
43-
pub use self::r#extend_collection_atrributes_plugin_v1::*;
4442
pub use self::r#remove_collection_plugin_v1::*;
4543
pub use self::r#remove_plugin_v1::*;
4644
pub use self::r#revoke_collection_plugin_authority_v1::*;
4745
pub use self::r#revoke_plugin_authority_v1::*;
4846
pub use self::r#transfer_v1::*;
4947
pub use self::r#update_collection_plugin_v1::*;
48+
pub use self::r#update_collection_plugin_v2::*;
5049
pub use self::r#update_collection_v1::*;
5150
pub use self::r#update_plugin_v1::*;
51+
pub use self::r#update_plugin_v2::*;
5252
pub use self::r#update_v1::*;

0 commit comments

Comments
 (0)