diff --git a/clients/js/src/generated/instructions/addCollectionPlugin.ts b/clients/js/src/generated/instructions/addCollectionPlugin.ts index 8c936e27..a00317f0 100644 --- a/clients/js/src/generated/instructions/addCollectionPlugin.ts +++ b/clients/js/src/generated/instructions/addCollectionPlugin.ts @@ -25,11 +25,7 @@ import { ResolvedAccountsWithIndices, getAccountMetasAndSigners, } from '../shared'; -import { - AddPluginArgs, - AddPluginArgsArgs, - getAddPluginArgsSerializer, -} from '../types'; +import { Plugin, PluginArgs, getPluginSerializer } from '../types'; // Accounts. export type AddCollectionPluginInstructionAccounts = { @@ -48,12 +44,10 @@ export type AddCollectionPluginInstructionAccounts = { // Data. export type AddCollectionPluginInstructionData = { discriminator: number; - addPluginArgs: AddPluginArgs; + plugin: Plugin; }; -export type AddCollectionPluginInstructionDataArgs = { - addPluginArgs: AddPluginArgsArgs; -}; +export type AddCollectionPluginInstructionDataArgs = { plugin: PluginArgs }; export function getAddCollectionPluginInstructionDataSerializer(): Serializer< AddCollectionPluginInstructionDataArgs, @@ -67,7 +61,7 @@ export function getAddCollectionPluginInstructionDataSerializer(): Serializer< struct( [ ['discriminator', u8()], - ['addPluginArgs', getAddPluginArgsSerializer()], + ['plugin', getPluginSerializer()], ], { description: 'AddCollectionPluginInstructionData' } ), diff --git a/clients/js/src/generated/instructions/addCollectionPluginAuthority.ts b/clients/js/src/generated/instructions/addCollectionPluginAuthority.ts index 6bd226bf..c0f586ab 100644 --- a/clients/js/src/generated/instructions/addCollectionPluginAuthority.ts +++ b/clients/js/src/generated/instructions/addCollectionPluginAuthority.ts @@ -26,9 +26,12 @@ import { getAccountMetasAndSigners, } from '../shared'; import { - AddPluginAuthorityArgs, - AddPluginAuthorityArgsArgs, - getAddPluginAuthorityArgsSerializer, + Authority, + AuthorityArgs, + PluginType, + PluginTypeArgs, + getAuthoritySerializer, + getPluginTypeSerializer, } from '../types'; // Accounts. @@ -48,11 +51,13 @@ export type AddCollectionPluginAuthorityInstructionAccounts = { // Data. export type AddCollectionPluginAuthorityInstructionData = { discriminator: number; - addPluginAuthorityArgs: AddPluginAuthorityArgs; + pluginType: PluginType; + newAuthority: Authority; }; export type AddCollectionPluginAuthorityInstructionDataArgs = { - addPluginAuthorityArgs: AddPluginAuthorityArgsArgs; + pluginType: PluginTypeArgs; + newAuthority: AuthorityArgs; }; export function getAddCollectionPluginAuthorityInstructionDataSerializer(): Serializer< @@ -67,7 +72,8 @@ export function getAddCollectionPluginAuthorityInstructionDataSerializer(): Seri struct( [ ['discriminator', u8()], - ['addPluginAuthorityArgs', getAddPluginAuthorityArgsSerializer()], + ['pluginType', getPluginTypeSerializer()], + ['newAuthority', getAuthoritySerializer()], ], { description: 'AddCollectionPluginAuthorityInstructionData' } ), diff --git a/clients/js/src/generated/instructions/addPlugin.ts b/clients/js/src/generated/instructions/addPlugin.ts index 912c56f0..0dc4957f 100644 --- a/clients/js/src/generated/instructions/addPlugin.ts +++ b/clients/js/src/generated/instructions/addPlugin.ts @@ -25,11 +25,7 @@ import { ResolvedAccountsWithIndices, getAccountMetasAndSigners, } from '../shared'; -import { - AddPluginArgs, - AddPluginArgsArgs, - getAddPluginArgsSerializer, -} from '../types'; +import { Plugin, PluginArgs, getPluginSerializer } from '../types'; // Accounts. export type AddPluginInstructionAccounts = { @@ -50,10 +46,10 @@ export type AddPluginInstructionAccounts = { // Data. export type AddPluginInstructionData = { discriminator: number; - addPluginArgs: AddPluginArgs; + plugin: Plugin; }; -export type AddPluginInstructionDataArgs = { addPluginArgs: AddPluginArgsArgs }; +export type AddPluginInstructionDataArgs = { plugin: PluginArgs }; export function getAddPluginInstructionDataSerializer(): Serializer< AddPluginInstructionDataArgs, @@ -67,7 +63,7 @@ export function getAddPluginInstructionDataSerializer(): Serializer< struct( [ ['discriminator', u8()], - ['addPluginArgs', getAddPluginArgsSerializer()], + ['plugin', getPluginSerializer()], ], { description: 'AddPluginInstructionData' } ), diff --git a/clients/js/src/generated/instructions/addPluginAuthority.ts b/clients/js/src/generated/instructions/addPluginAuthority.ts index 8df8afcb..371cf03f 100644 --- a/clients/js/src/generated/instructions/addPluginAuthority.ts +++ b/clients/js/src/generated/instructions/addPluginAuthority.ts @@ -26,9 +26,12 @@ import { getAccountMetasAndSigners, } from '../shared'; import { - AddPluginAuthorityArgs, - AddPluginAuthorityArgsArgs, - getAddPluginAuthorityArgsSerializer, + Authority, + AuthorityArgs, + PluginType, + PluginTypeArgs, + getAuthoritySerializer, + getPluginTypeSerializer, } from '../types'; // Accounts. @@ -50,11 +53,13 @@ export type AddPluginAuthorityInstructionAccounts = { // Data. export type AddPluginAuthorityInstructionData = { discriminator: number; - addPluginAuthorityArgs: AddPluginAuthorityArgs; + pluginType: PluginType; + newAuthority: Authority; }; export type AddPluginAuthorityInstructionDataArgs = { - addPluginAuthorityArgs: AddPluginAuthorityArgsArgs; + pluginType: PluginTypeArgs; + newAuthority: AuthorityArgs; }; export function getAddPluginAuthorityInstructionDataSerializer(): Serializer< @@ -69,7 +74,8 @@ export function getAddPluginAuthorityInstructionDataSerializer(): Serializer< struct( [ ['discriminator', u8()], - ['addPluginAuthorityArgs', getAddPluginAuthorityArgsSerializer()], + ['pluginType', getPluginTypeSerializer()], + ['newAuthority', getAuthoritySerializer()], ], { description: 'AddPluginAuthorityInstructionData' } ), diff --git a/clients/js/src/generated/instructions/burnCollection.ts b/clients/js/src/generated/instructions/burnCollection.ts index e09f2a5f..a5d78e66 100644 --- a/clients/js/src/generated/instructions/burnCollection.ts +++ b/clients/js/src/generated/instructions/burnCollection.ts @@ -8,6 +8,8 @@ import { Context, + Option, + OptionOrNullable, Pda, PublicKey, Signer, @@ -17,6 +19,7 @@ import { import { Serializer, mapSerializer, + option, struct, u8, } from '@metaplex-foundation/umi/serializers'; @@ -25,6 +28,11 @@ import { ResolvedAccountsWithIndices, getAccountMetasAndSigners, } from '../shared'; +import { + CompressionProof, + CompressionProofArgs, + getCompressionProofSerializer, +} from '../types'; // Accounts. export type BurnCollectionInstructionAccounts = { @@ -39,9 +47,14 @@ export type BurnCollectionInstructionAccounts = { }; // Data. -export type BurnCollectionInstructionData = { discriminator: number }; +export type BurnCollectionInstructionData = { + discriminator: number; + compressionProof: Option; +}; -export type BurnCollectionInstructionDataArgs = {}; +export type BurnCollectionInstructionDataArgs = { + compressionProof: OptionOrNullable; +}; export function getBurnCollectionInstructionDataSerializer(): Serializer< BurnCollectionInstructionDataArgs, @@ -52,9 +65,13 @@ export function getBurnCollectionInstructionDataSerializer(): Serializer< any, BurnCollectionInstructionData >( - struct([['discriminator', u8()]], { - description: 'BurnCollectionInstructionData', - }), + struct( + [ + ['discriminator', u8()], + ['compressionProof', option(getCompressionProofSerializer())], + ], + { description: 'BurnCollectionInstructionData' } + ), (value) => ({ ...value, discriminator: 13 }) ) as Serializer< BurnCollectionInstructionDataArgs, @@ -62,10 +79,13 @@ export function getBurnCollectionInstructionDataSerializer(): Serializer< >; } +// Args. +export type BurnCollectionInstructionArgs = BurnCollectionInstructionDataArgs; + // Instruction. export function burnCollection( context: Pick, - input: BurnCollectionInstructionAccounts + input: BurnCollectionInstructionAccounts & BurnCollectionInstructionArgs ): TransactionBuilder { // Program ID. const programId = context.programs.getPublicKey( @@ -85,6 +105,9 @@ export function burnCollection( }, }; + // Arguments. + const resolvedArgs: BurnCollectionInstructionArgs = { ...input }; + // Default values. if (!resolvedAccounts.authority.value) { resolvedAccounts.authority.value = context.identity; @@ -103,7 +126,9 @@ export function burnCollection( ); // Data. - const data = getBurnCollectionInstructionDataSerializer().serialize({}); + const data = getBurnCollectionInstructionDataSerializer().serialize( + resolvedArgs as BurnCollectionInstructionDataArgs + ); // Bytes Created On Chain. const bytesCreatedOnChain = 0; diff --git a/clients/js/src/generated/instructions/removeCollectionPlugin.ts b/clients/js/src/generated/instructions/removeCollectionPlugin.ts index 3ff04d17..bbab7cb3 100644 --- a/clients/js/src/generated/instructions/removeCollectionPlugin.ts +++ b/clients/js/src/generated/instructions/removeCollectionPlugin.ts @@ -25,11 +25,7 @@ import { ResolvedAccountsWithIndices, getAccountMetasAndSigners, } from '../shared'; -import { - RemovePluginArgs, - RemovePluginArgsArgs, - getRemovePluginArgsSerializer, -} from '../types'; +import { PluginType, PluginTypeArgs, getPluginTypeSerializer } from '../types'; // Accounts. export type RemoveCollectionPluginInstructionAccounts = { @@ -48,11 +44,11 @@ export type RemoveCollectionPluginInstructionAccounts = { // Data. export type RemoveCollectionPluginInstructionData = { discriminator: number; - removePluginArgs: RemovePluginArgs; + pluginType: PluginType; }; export type RemoveCollectionPluginInstructionDataArgs = { - removePluginArgs: RemovePluginArgsArgs; + pluginType: PluginTypeArgs; }; export function getRemoveCollectionPluginInstructionDataSerializer(): Serializer< @@ -67,7 +63,7 @@ export function getRemoveCollectionPluginInstructionDataSerializer(): Serializer struct( [ ['discriminator', u8()], - ['removePluginArgs', getRemovePluginArgsSerializer()], + ['pluginType', getPluginTypeSerializer()], ], { description: 'RemoveCollectionPluginInstructionData' } ), diff --git a/clients/js/src/generated/instructions/removeCollectionPluginAuthority.ts b/clients/js/src/generated/instructions/removeCollectionPluginAuthority.ts index 727a79b7..baca20e6 100644 --- a/clients/js/src/generated/instructions/removeCollectionPluginAuthority.ts +++ b/clients/js/src/generated/instructions/removeCollectionPluginAuthority.ts @@ -26,9 +26,12 @@ import { getAccountMetasAndSigners, } from '../shared'; import { - RemovePluginAuthorityArgs, - RemovePluginAuthorityArgsArgs, - getRemovePluginAuthorityArgsSerializer, + Authority, + AuthorityArgs, + PluginType, + PluginTypeArgs, + getAuthoritySerializer, + getPluginTypeSerializer, } from '../types'; // Accounts. @@ -48,11 +51,13 @@ export type RemoveCollectionPluginAuthorityInstructionAccounts = { // Data. export type RemoveCollectionPluginAuthorityInstructionData = { discriminator: number; - removePluginAuthorityArgs: RemovePluginAuthorityArgs; + pluginType: PluginType; + authorityToRemove: Authority; }; export type RemoveCollectionPluginAuthorityInstructionDataArgs = { - removePluginAuthorityArgs: RemovePluginAuthorityArgsArgs; + pluginType: PluginTypeArgs; + authorityToRemove: AuthorityArgs; }; export function getRemoveCollectionPluginAuthorityInstructionDataSerializer(): Serializer< @@ -67,7 +72,8 @@ export function getRemoveCollectionPluginAuthorityInstructionDataSerializer(): S struct( [ ['discriminator', u8()], - ['removePluginAuthorityArgs', getRemovePluginAuthorityArgsSerializer()], + ['pluginType', getPluginTypeSerializer()], + ['authorityToRemove', getAuthoritySerializer()], ], { description: 'RemoveCollectionPluginAuthorityInstructionData' } ), diff --git a/clients/js/src/generated/instructions/removePlugin.ts b/clients/js/src/generated/instructions/removePlugin.ts index 9df652b8..429a5a34 100644 --- a/clients/js/src/generated/instructions/removePlugin.ts +++ b/clients/js/src/generated/instructions/removePlugin.ts @@ -25,11 +25,7 @@ import { ResolvedAccountsWithIndices, getAccountMetasAndSigners, } from '../shared'; -import { - RemovePluginArgs, - RemovePluginArgsArgs, - getRemovePluginArgsSerializer, -} from '../types'; +import { PluginType, PluginTypeArgs, getPluginTypeSerializer } from '../types'; // Accounts. export type RemovePluginInstructionAccounts = { @@ -50,12 +46,10 @@ export type RemovePluginInstructionAccounts = { // Data. export type RemovePluginInstructionData = { discriminator: number; - removePluginArgs: RemovePluginArgs; + pluginType: PluginType; }; -export type RemovePluginInstructionDataArgs = { - removePluginArgs: RemovePluginArgsArgs; -}; +export type RemovePluginInstructionDataArgs = { pluginType: PluginTypeArgs }; export function getRemovePluginInstructionDataSerializer(): Serializer< RemovePluginInstructionDataArgs, @@ -69,7 +63,7 @@ export function getRemovePluginInstructionDataSerializer(): Serializer< struct( [ ['discriminator', u8()], - ['removePluginArgs', getRemovePluginArgsSerializer()], + ['pluginType', getPluginTypeSerializer()], ], { description: 'RemovePluginInstructionData' } ), diff --git a/clients/js/src/generated/instructions/removePluginAuthority.ts b/clients/js/src/generated/instructions/removePluginAuthority.ts index 8f37db6f..8fb8aa2e 100644 --- a/clients/js/src/generated/instructions/removePluginAuthority.ts +++ b/clients/js/src/generated/instructions/removePluginAuthority.ts @@ -26,9 +26,12 @@ import { getAccountMetasAndSigners, } from '../shared'; import { - RemovePluginAuthorityArgs, - RemovePluginAuthorityArgsArgs, - getRemovePluginAuthorityArgsSerializer, + Authority, + AuthorityArgs, + PluginType, + PluginTypeArgs, + getAuthoritySerializer, + getPluginTypeSerializer, } from '../types'; // Accounts. @@ -50,11 +53,13 @@ export type RemovePluginAuthorityInstructionAccounts = { // Data. export type RemovePluginAuthorityInstructionData = { discriminator: number; - removePluginAuthorityArgs: RemovePluginAuthorityArgs; + pluginType: PluginType; + authorityToRemove: Authority; }; export type RemovePluginAuthorityInstructionDataArgs = { - removePluginAuthorityArgs: RemovePluginAuthorityArgsArgs; + pluginType: PluginTypeArgs; + authorityToRemove: AuthorityArgs; }; export function getRemovePluginAuthorityInstructionDataSerializer(): Serializer< @@ -69,7 +74,8 @@ export function getRemovePluginAuthorityInstructionDataSerializer(): Serializer< struct( [ ['discriminator', u8()], - ['removePluginAuthorityArgs', getRemovePluginAuthorityArgsSerializer()], + ['pluginType', getPluginTypeSerializer()], + ['authorityToRemove', getAuthoritySerializer()], ], { description: 'RemovePluginAuthorityInstructionData' } ), diff --git a/clients/js/src/generated/instructions/update.ts b/clients/js/src/generated/instructions/update.ts index c8f7510b..04394082 100644 --- a/clients/js/src/generated/instructions/update.ts +++ b/clients/js/src/generated/instructions/update.ts @@ -8,6 +8,8 @@ import { Context, + Option, + OptionOrNullable, Pda, PublicKey, Signer, @@ -17,6 +19,8 @@ import { import { Serializer, mapSerializer, + option, + string, struct, u8, } from '@metaplex-foundation/umi/serializers'; @@ -25,7 +29,6 @@ import { ResolvedAccountsWithIndices, getAccountMetasAndSigners, } from '../shared'; -import { UpdateArgs, UpdateArgsArgs, getUpdateArgsSerializer } from '../types'; // Accounts. export type UpdateInstructionAccounts = { @@ -46,10 +49,14 @@ export type UpdateInstructionAccounts = { // Data. export type UpdateInstructionData = { discriminator: number; - updateArgs: UpdateArgs; + newName: Option; + newUri: Option; }; -export type UpdateInstructionDataArgs = { updateArgs: UpdateArgsArgs }; +export type UpdateInstructionDataArgs = { + newName: OptionOrNullable; + newUri: OptionOrNullable; +}; export function getUpdateInstructionDataSerializer(): Serializer< UpdateInstructionDataArgs, @@ -59,7 +66,8 @@ export function getUpdateInstructionDataSerializer(): Serializer< struct( [ ['discriminator', u8()], - ['updateArgs', getUpdateArgsSerializer()], + ['newName', option(string())], + ['newUri', option(string())], ], { description: 'UpdateInstructionData' } ), diff --git a/clients/js/src/generated/instructions/updateCollection.ts b/clients/js/src/generated/instructions/updateCollection.ts index 24ecd8e3..9f162a86 100644 --- a/clients/js/src/generated/instructions/updateCollection.ts +++ b/clients/js/src/generated/instructions/updateCollection.ts @@ -8,6 +8,8 @@ import { Context, + Option, + OptionOrNullable, Pda, PublicKey, Signer, @@ -17,6 +19,8 @@ import { import { Serializer, mapSerializer, + option, + string, struct, u8, } from '@metaplex-foundation/umi/serializers'; @@ -25,7 +29,6 @@ import { ResolvedAccountsWithIndices, getAccountMetasAndSigners, } from '../shared'; -import { UpdateArgs, UpdateArgsArgs, getUpdateArgsSerializer } from '../types'; // Accounts. export type UpdateCollectionInstructionAccounts = { @@ -46,11 +49,13 @@ export type UpdateCollectionInstructionAccounts = { // Data. export type UpdateCollectionInstructionData = { discriminator: number; - updateArgs: UpdateArgs; + newName: Option; + newUri: Option; }; export type UpdateCollectionInstructionDataArgs = { - updateArgs: UpdateArgsArgs; + newName: OptionOrNullable; + newUri: OptionOrNullable; }; export function getUpdateCollectionInstructionDataSerializer(): Serializer< @@ -65,7 +70,8 @@ export function getUpdateCollectionInstructionDataSerializer(): Serializer< struct( [ ['discriminator', u8()], - ['updateArgs', getUpdateArgsSerializer()], + ['newName', option(string())], + ['newUri', option(string())], ], { description: 'UpdateCollectionInstructionData' } ), diff --git a/clients/js/src/generated/instructions/updateCollectionPlugin.ts b/clients/js/src/generated/instructions/updateCollectionPlugin.ts index 21272e8b..2b28c9f7 100644 --- a/clients/js/src/generated/instructions/updateCollectionPlugin.ts +++ b/clients/js/src/generated/instructions/updateCollectionPlugin.ts @@ -25,11 +25,7 @@ import { ResolvedAccountsWithIndices, getAccountMetasAndSigners, } from '../shared'; -import { - UpdatePluginArgs, - UpdatePluginArgsArgs, - getUpdatePluginArgsSerializer, -} from '../types'; +import { Plugin, PluginArgs, getPluginSerializer } from '../types'; // Accounts. export type UpdateCollectionPluginInstructionAccounts = { @@ -48,12 +44,10 @@ export type UpdateCollectionPluginInstructionAccounts = { // Data. export type UpdateCollectionPluginInstructionData = { discriminator: number; - updatePluginArgs: UpdatePluginArgs; + plugin: Plugin; }; -export type UpdateCollectionPluginInstructionDataArgs = { - updatePluginArgs: UpdatePluginArgsArgs; -}; +export type UpdateCollectionPluginInstructionDataArgs = { plugin: PluginArgs }; export function getUpdateCollectionPluginInstructionDataSerializer(): Serializer< UpdateCollectionPluginInstructionDataArgs, @@ -67,7 +61,7 @@ export function getUpdateCollectionPluginInstructionDataSerializer(): Serializer struct( [ ['discriminator', u8()], - ['updatePluginArgs', getUpdatePluginArgsSerializer()], + ['plugin', getPluginSerializer()], ], { description: 'UpdateCollectionPluginInstructionData' } ), diff --git a/clients/js/src/generated/instructions/updatePlugin.ts b/clients/js/src/generated/instructions/updatePlugin.ts index ebe55885..8df58a28 100644 --- a/clients/js/src/generated/instructions/updatePlugin.ts +++ b/clients/js/src/generated/instructions/updatePlugin.ts @@ -25,11 +25,7 @@ import { ResolvedAccountsWithIndices, getAccountMetasAndSigners, } from '../shared'; -import { - UpdatePluginArgs, - UpdatePluginArgsArgs, - getUpdatePluginArgsSerializer, -} from '../types'; +import { Plugin, PluginArgs, getPluginSerializer } from '../types'; // Accounts. export type UpdatePluginInstructionAccounts = { @@ -50,12 +46,10 @@ export type UpdatePluginInstructionAccounts = { // Data. export type UpdatePluginInstructionData = { discriminator: number; - updatePluginArgs: UpdatePluginArgs; + plugin: Plugin; }; -export type UpdatePluginInstructionDataArgs = { - updatePluginArgs: UpdatePluginArgsArgs; -}; +export type UpdatePluginInstructionDataArgs = { plugin: PluginArgs }; export function getUpdatePluginInstructionDataSerializer(): Serializer< UpdatePluginInstructionDataArgs, @@ -69,7 +63,7 @@ export function getUpdatePluginInstructionDataSerializer(): Serializer< struct( [ ['discriminator', u8()], - ['updatePluginArgs', getUpdatePluginArgsSerializer()], + ['plugin', getPluginSerializer()], ], { description: 'UpdatePluginInstructionData' } ), diff --git a/clients/js/src/generated/types/addPluginArgs.ts b/clients/js/src/generated/types/addPluginArgs.ts deleted file mode 100644 index 1e702f06..00000000 --- a/clients/js/src/generated/types/addPluginArgs.ts +++ /dev/null @@ -1,23 +0,0 @@ -/** - * This code was AUTOGENERATED using the kinobi library. - * Please DO NOT EDIT THIS FILE, instead use visitors - * to add features, then rerun kinobi to update it. - * - * @see https://github.com/metaplex-foundation/kinobi - */ - -import { Serializer, struct } from '@metaplex-foundation/umi/serializers'; -import { Plugin, PluginArgs, getPluginSerializer } from '.'; - -export type AddPluginArgs = { plugin: Plugin }; - -export type AddPluginArgsArgs = { plugin: PluginArgs }; - -export function getAddPluginArgsSerializer(): Serializer< - AddPluginArgsArgs, - AddPluginArgs -> { - return struct([['plugin', getPluginSerializer()]], { - description: 'AddPluginArgs', - }) as Serializer; -} diff --git a/clients/js/src/generated/types/addPluginAuthorityArgs.ts b/clients/js/src/generated/types/addPluginAuthorityArgs.ts deleted file mode 100644 index 208b18e9..00000000 --- a/clients/js/src/generated/types/addPluginAuthorityArgs.ts +++ /dev/null @@ -1,40 +0,0 @@ -/** - * This code was AUTOGENERATED using the kinobi library. - * Please DO NOT EDIT THIS FILE, instead use visitors - * to add features, then rerun kinobi to update it. - * - * @see https://github.com/metaplex-foundation/kinobi - */ - -import { Serializer, struct } from '@metaplex-foundation/umi/serializers'; -import { - Authority, - AuthorityArgs, - PluginType, - PluginTypeArgs, - getAuthoritySerializer, - getPluginTypeSerializer, -} from '.'; - -export type AddPluginAuthorityArgs = { - pluginType: PluginType; - newAuthority: Authority; -}; - -export type AddPluginAuthorityArgsArgs = { - pluginType: PluginTypeArgs; - newAuthority: AuthorityArgs; -}; - -export function getAddPluginAuthorityArgsSerializer(): Serializer< - AddPluginAuthorityArgsArgs, - AddPluginAuthorityArgs -> { - return struct( - [ - ['pluginType', getPluginTypeSerializer()], - ['newAuthority', getAuthoritySerializer()], - ], - { description: 'AddPluginAuthorityArgs' } - ) as Serializer; -} diff --git a/clients/js/src/generated/types/index.ts b/clients/js/src/generated/types/index.ts index 8dd8bdf0..49d32f65 100644 --- a/clients/js/src/generated/types/index.ts +++ b/clients/js/src/generated/types/index.ts @@ -6,8 +6,6 @@ * @see https://github.com/metaplex-foundation/kinobi */ -export * from './addPluginArgs'; -export * from './addPluginAuthorityArgs'; export * from './authority'; export * from './burn'; export * from './compressionProof'; @@ -22,12 +20,8 @@ export * from './key'; export * from './plugin'; export * from './pluginType'; export * from './registryRecord'; -export * from './removePluginArgs'; -export * from './removePluginAuthorityArgs'; export * from './royalties'; export * from './ruleSet'; export * from './transfer'; -export * from './updateArgs'; export * from './updateAuthority'; export * from './updateDelegate'; -export * from './updatePluginArgs'; diff --git a/clients/js/src/generated/types/removePluginArgs.ts b/clients/js/src/generated/types/removePluginArgs.ts deleted file mode 100644 index fce54fd7..00000000 --- a/clients/js/src/generated/types/removePluginArgs.ts +++ /dev/null @@ -1,23 +0,0 @@ -/** - * This code was AUTOGENERATED using the kinobi library. - * Please DO NOT EDIT THIS FILE, instead use visitors - * to add features, then rerun kinobi to update it. - * - * @see https://github.com/metaplex-foundation/kinobi - */ - -import { Serializer, struct } from '@metaplex-foundation/umi/serializers'; -import { PluginType, PluginTypeArgs, getPluginTypeSerializer } from '.'; - -export type RemovePluginArgs = { pluginType: PluginType }; - -export type RemovePluginArgsArgs = { pluginType: PluginTypeArgs }; - -export function getRemovePluginArgsSerializer(): Serializer< - RemovePluginArgsArgs, - RemovePluginArgs -> { - return struct([['pluginType', getPluginTypeSerializer()]], { - description: 'RemovePluginArgs', - }) as Serializer; -} diff --git a/clients/js/src/generated/types/removePluginAuthorityArgs.ts b/clients/js/src/generated/types/removePluginAuthorityArgs.ts deleted file mode 100644 index 153862a0..00000000 --- a/clients/js/src/generated/types/removePluginAuthorityArgs.ts +++ /dev/null @@ -1,40 +0,0 @@ -/** - * This code was AUTOGENERATED using the kinobi library. - * Please DO NOT EDIT THIS FILE, instead use visitors - * to add features, then rerun kinobi to update it. - * - * @see https://github.com/metaplex-foundation/kinobi - */ - -import { Serializer, struct } from '@metaplex-foundation/umi/serializers'; -import { - Authority, - AuthorityArgs, - PluginType, - PluginTypeArgs, - getAuthoritySerializer, - getPluginTypeSerializer, -} from '.'; - -export type RemovePluginAuthorityArgs = { - pluginType: PluginType; - authorityToRemove: Authority; -}; - -export type RemovePluginAuthorityArgsArgs = { - pluginType: PluginTypeArgs; - authorityToRemove: AuthorityArgs; -}; - -export function getRemovePluginAuthorityArgsSerializer(): Serializer< - RemovePluginAuthorityArgsArgs, - RemovePluginAuthorityArgs -> { - return struct( - [ - ['pluginType', getPluginTypeSerializer()], - ['authorityToRemove', getAuthoritySerializer()], - ], - { description: 'RemovePluginAuthorityArgs' } - ) as Serializer; -} diff --git a/clients/js/src/generated/types/updateArgs.ts b/clients/js/src/generated/types/updateArgs.ts deleted file mode 100644 index 589b5221..00000000 --- a/clients/js/src/generated/types/updateArgs.ts +++ /dev/null @@ -1,35 +0,0 @@ -/** - * This code was AUTOGENERATED using the kinobi library. - * Please DO NOT EDIT THIS FILE, instead use visitors - * to add features, then rerun kinobi to update it. - * - * @see https://github.com/metaplex-foundation/kinobi - */ - -import { Option, OptionOrNullable } from '@metaplex-foundation/umi'; -import { - Serializer, - option, - string, - struct, -} from '@metaplex-foundation/umi/serializers'; - -export type UpdateArgs = { newName: Option; newUri: Option }; - -export type UpdateArgsArgs = { - newName: OptionOrNullable; - newUri: OptionOrNullable; -}; - -export function getUpdateArgsSerializer(): Serializer< - UpdateArgsArgs, - UpdateArgs -> { - return struct( - [ - ['newName', option(string())], - ['newUri', option(string())], - ], - { description: 'UpdateArgs' } - ) as Serializer; -} diff --git a/clients/js/src/generated/types/updatePluginArgs.ts b/clients/js/src/generated/types/updatePluginArgs.ts deleted file mode 100644 index 62e83823..00000000 --- a/clients/js/src/generated/types/updatePluginArgs.ts +++ /dev/null @@ -1,23 +0,0 @@ -/** - * This code was AUTOGENERATED using the kinobi library. - * Please DO NOT EDIT THIS FILE, instead use visitors - * to add features, then rerun kinobi to update it. - * - * @see https://github.com/metaplex-foundation/kinobi - */ - -import { Serializer, struct } from '@metaplex-foundation/umi/serializers'; -import { Plugin, PluginArgs, getPluginSerializer } from '.'; - -export type UpdatePluginArgs = { plugin: Plugin }; - -export type UpdatePluginArgsArgs = { plugin: PluginArgs }; - -export function getUpdatePluginArgsSerializer(): Serializer< - UpdatePluginArgsArgs, - UpdatePluginArgs -> { - return struct([['plugin', getPluginSerializer()]], { - description: 'UpdatePluginArgs', - }) as Serializer; -} diff --git a/clients/js/test/addAuthority.test.ts b/clients/js/test/addAuthority.test.ts index 3778f1fe..1d664d3f 100644 --- a/clients/js/test/addAuthority.test.ts +++ b/clients/js/test/addAuthority.test.ts @@ -44,17 +44,15 @@ test('it can add an authority to a plugin', async (t) => { await addPlugin(umi, { asset: assetAddress.publicKey, - addPluginArgs: { plugin: plugin('Freeze', [{ frozen: false }]) } + plugin: plugin('Freeze', [{ frozen: false }]) }) .append( addPluginAuthority(umi, { asset: assetAddress.publicKey, - addPluginAuthorityArgs: { - pluginType: PluginType.Freeze, - newAuthority: { - __kind: 'Pubkey', - address: delegateAddress.publicKey, - }, + pluginType: PluginType.Freeze, + newAuthority: { + __kind: 'Pubkey', + address: delegateAddress.publicKey, }, }) ) diff --git a/clients/js/test/addPlugin.test.ts b/clients/js/test/addPlugin.test.ts index 5478f05b..e788b2b7 100644 --- a/clients/js/test/addPlugin.test.ts +++ b/clients/js/test/addPlugin.test.ts @@ -47,11 +47,9 @@ test('it can add a plugin to an asset', async (t) => { await addPlugin(umi, { asset: assetAddress.publicKey, - addPluginArgs: { - plugin: { - __kind: 'Freeze', - fields: [{ frozen: false }], - }, + plugin: { + __kind: 'Freeze', + fields: [{ frozen: false }], } }).sendAndConfirm(umi); @@ -114,11 +112,9 @@ test('it can add a plugin to a collection', async (t) => { await addCollectionPlugin(umi, { collection: collectionAddress.publicKey, - addPluginArgs: { - plugin: { - __kind: 'Freeze', - fields: [{ frozen: false }], - }, + plugin: { + __kind: 'Freeze', + fields: [{ frozen: false }], } }).sendAndConfirm(umi); diff --git a/clients/js/test/collect.test.ts b/clients/js/test/collect.test.ts index c9e84626..c20689be 100644 --- a/clients/js/test/collect.test.ts +++ b/clients/js/test/collect.test.ts @@ -68,7 +68,7 @@ test('it can add asset plugin with collect amount', async (t) => { await addPlugin(umi, { asset: assetAddress.publicKey, - addPluginArgs: { plugin: plugin('Freeze', [{ frozen: true }]) } + plugin: plugin('Freeze', [{ frozen: true }]) }).sendAndConfirm(umi); t.assert(await hasCollectAmount(umi, assetAddress.publicKey), 'Collect amount not found') @@ -93,7 +93,7 @@ test('it can add remove asset plugin with collect amount', async (t) => { await removePlugin(umi, { asset: assetAddress.publicKey, - removePluginArgs: { pluginType: PluginType.Freeze, } + pluginType: PluginType.Freeze, }).sendAndConfirm(umi); t.assert(await hasCollectAmount(umi, assetAddress.publicKey), 'Collect amount not found') }); \ No newline at end of file diff --git a/clients/js/test/plugins/asset/delegate.test.ts b/clients/js/test/plugins/asset/delegate.test.ts index 32af44d5..35151c27 100644 --- a/clients/js/test/plugins/asset/delegate.test.ts +++ b/clients/js/test/plugins/asset/delegate.test.ts @@ -31,23 +31,19 @@ test('it can delegate a new authority', async (t) => { await addPlugin(umi, { asset: assetAddress.publicKey, - addPluginArgs: { - plugin: { - __kind: 'Freeze', - fields: [{ frozen: false }], - }, - } + plugin: { + __kind: 'Freeze', + fields: [{ frozen: false }], + }, }).sendAndConfirm(umi); await addPluginAuthority(umi, { asset: assetAddress.publicKey, - addPluginAuthorityArgs: { - pluginType: PluginType.Freeze, - newAuthority: { - __kind: 'Pubkey', - address: delegateAddress.publicKey, - }, - } + pluginType: PluginType.Freeze, + newAuthority: { + __kind: 'Pubkey', + address: delegateAddress.publicKey, + }, }).sendAndConfirm(umi); const asset = await fetchAssetWithPlugins(umi, assetAddress.publicKey); @@ -106,34 +102,28 @@ test('a delegate can freeze the token', async (t) => { await addPlugin(umi, { asset: assetAddress.publicKey, - addPluginArgs: { - plugin: { - __kind: 'Freeze', - fields: [{ frozen: false }], - }, - } + plugin: { + __kind: 'Freeze', + fields: [{ frozen: false }], + }, }).sendAndConfirm(umi); await addPluginAuthority(umi, { asset: assetAddress.publicKey, - addPluginAuthorityArgs: { - pluginType: PluginType.Freeze, - newAuthority: { - __kind: 'Pubkey', - address: delegateAddress.publicKey, - }, - } + pluginType: PluginType.Freeze, + newAuthority: { + __kind: 'Pubkey', + address: delegateAddress.publicKey, + }, }).sendAndConfirm(umi); await updatePlugin(umi, { asset: assetAddress.publicKey, authority: delegateAddress, - updatePluginArgs: { - plugin: { - __kind: 'Freeze', - fields: [{ frozen: true }], - }, - } + plugin: { + __kind: 'Freeze', + fields: [{ frozen: true }], + }, }).sendAndConfirm(umi); const asset = await fetchAssetWithPlugins(umi, assetAddress.publicKey); diff --git a/clients/js/test/plugins/asset/delegateTransfer.test.ts b/clients/js/test/plugins/asset/delegateTransfer.test.ts index 98bf2877..1ff3844d 100644 --- a/clients/js/test/plugins/asset/delegateTransfer.test.ts +++ b/clients/js/test/plugins/asset/delegateTransfer.test.ts @@ -31,23 +31,19 @@ test('a delegate can transfer the asset', async (t) => { await addPlugin(umi, { asset: assetAddress.publicKey, - addPluginArgs: { - plugin: { - __kind: 'Transfer', - fields: [{}], - }, - } + plugin: { + __kind: 'Transfer', + fields: [{}], + }, }).sendAndConfirm(umi); await addPluginAuthority(umi, { asset: assetAddress.publicKey, - addPluginAuthorityArgs: { - pluginType: PluginType.Transfer, - newAuthority: { - __kind: 'Pubkey', - address: delegateAddress.publicKey, - }, - } + pluginType: PluginType.Transfer, + newAuthority: { + __kind: 'Pubkey', + address: delegateAddress.publicKey, + }, }).sendAndConfirm(umi); await transfer(umi, { diff --git a/clients/js/test/plugins/asset/freeze.test.ts b/clients/js/test/plugins/asset/freeze.test.ts index b14f7475..0989157d 100644 --- a/clients/js/test/plugins/asset/freeze.test.ts +++ b/clients/js/test/plugins/asset/freeze.test.ts @@ -27,7 +27,7 @@ test('it can freeze and unfreeze an asset', async (t) => { await addPlugin(umi, { asset: assetAddress.publicKey, - addPluginArgs: { plugin: plugin('Freeze', [{ frozen: true }]), } + plugin: plugin('Freeze', [{ frozen: true }]), }).sendAndConfirm(umi); const asset = await fetchAssetWithPlugins(umi, assetAddress.publicKey); @@ -68,7 +68,7 @@ test('it can freeze and unfreeze an asset', async (t) => { await updatePlugin(umi, { asset: assetAddress.publicKey, - updatePluginArgs: { plugin: plugin('Freeze', [{ frozen: false }]), } + plugin: plugin('Freeze', [{ frozen: false }]), }).sendAndConfirm(umi); diff --git a/clients/js/test/plugins/collection/collectionUpdateDelegate.test.ts b/clients/js/test/plugins/collection/collectionUpdateDelegate.test.ts index a3df2d93..64157a5e 100644 --- a/clients/js/test/plugins/collection/collectionUpdateDelegate.test.ts +++ b/clients/js/test/plugins/collection/collectionUpdateDelegate.test.ts @@ -33,25 +33,21 @@ test('it can create a new asset with a collection if it is the collection update await addCollectionPlugin(umi, { collection: collectionAddress.publicKey, - addPluginArgs: { - plugin: { - __kind: 'UpdateDelegate', - fields: [{}], - }, - } + plugin: { + __kind: 'UpdateDelegate', + fields: [{}], + }, }).sendAndConfirm(umi); // console.log(JSON.stringify(await fetchCollectionWithPlugins(umi, collectionAddress.publicKey), (_, v) => typeof v === 'bigint' ? v.toString() : v, 2)); await addCollectionPluginAuthority(umi, { collection: collectionAddress.publicKey, - addPluginAuthorityArgs: { - pluginType: PluginType.UpdateDelegate, - newAuthority: { - __kind: 'Pubkey', - address: updateDelegate.publicKey, - }, - } + pluginType: PluginType.UpdateDelegate, + newAuthority: { + __kind: 'Pubkey', + address: updateDelegate.publicKey, + }, }).sendAndConfirm(umi); const collection = await fetchCollectionWithPlugins( diff --git a/clients/js/test/removeAuthority.test.ts b/clients/js/test/removeAuthority.test.ts index d88a7e0d..a108a7c9 100644 --- a/clients/js/test/removeAuthority.test.ts +++ b/clients/js/test/removeAuthority.test.ts @@ -46,23 +46,19 @@ test('it can remove an authority from a plugin', async (t) => { await addPlugin(umi, { asset: assetAddress.publicKey, - addPluginArgs: { - plugin: { - __kind: 'Freeze', - fields: [{ frozen: false }], - }, - } + plugin: { + __kind: 'Freeze', + fields: [{ frozen: false }], + }, }) .append( addPluginAuthority(umi, { asset: assetAddress.publicKey, - addPluginAuthorityArgs: { - pluginType: PluginType.Freeze, - newAuthority: { - __kind: 'Pubkey', - address: delegateAddress.publicKey, - }, - } + pluginType: PluginType.Freeze, + newAuthority: { + __kind: 'Pubkey', + address: delegateAddress.publicKey, + }, }) ) .sendAndConfirm(umi); @@ -108,13 +104,11 @@ test('it can remove an authority from a plugin', async (t) => { await removePluginAuthority(umi, { asset: assetAddress.publicKey, - removePluginAuthorityArgs: { - pluginType: PluginType.Freeze, - authorityToRemove: { - __kind: 'Pubkey', - address: delegateAddress.publicKey, - }, - } + pluginType: PluginType.Freeze, + authorityToRemove: { + __kind: 'Pubkey', + address: delegateAddress.publicKey, + }, }).sendAndConfirm(umi); const asset2 = await fetchAssetWithPlugins(umi, assetAddress.publicKey); @@ -178,22 +172,18 @@ test('it can remove the default authority from a plugin to make it immutable', a await addPlugin(umi, { asset: assetAddress.publicKey, - addPluginArgs: { - plugin: { - __kind: 'Freeze', - fields: [{ frozen: false }], - }, - } + plugin: { + __kind: 'Freeze', + fields: [{ frozen: false }], + }, }).sendAndConfirm(umi); await removePluginAuthority(umi, { asset: assetAddress.publicKey, - removePluginAuthorityArgs: { - pluginType: PluginType.Freeze, - authorityToRemove: { - __kind: 'Owner', - }, - } + pluginType: PluginType.Freeze, + authorityToRemove: { + __kind: 'Owner', + }, }).sendAndConfirm(umi); const asset1 = await fetchAssetWithPlugins(umi, assetAddress.publicKey); @@ -247,18 +237,16 @@ test('it can remove a pubkey authority from a plugin if that pubkey is the signe await addPlugin(umi, { asset: assetAddress.publicKey, - addPluginArgs: { plugin: plugin('Freeze', [{ frozen: false }]), } + plugin: plugin('Freeze', [{ frozen: false }]), }).sendAndConfirm(umi); await addPluginAuthority(umi, { asset: assetAddress.publicKey, - addPluginAuthorityArgs: { - pluginType: PluginType.Freeze, - newAuthority: { - __kind: 'Pubkey', - address: pubkeyAuth.publicKey, - }, - } + pluginType: PluginType.Freeze, + newAuthority: { + __kind: 'Pubkey', + address: pubkeyAuth.publicKey, + }, }).sendAndConfirm(umi); const asset1 = await fetchAssetWithPlugins(umi, assetAddress.publicKey); @@ -286,13 +274,11 @@ test('it can remove a pubkey authority from a plugin if that pubkey is the signe payer: umi2.identity, asset: assetAddress.publicKey, authority: pubkeyAuth, - removePluginAuthorityArgs: { - pluginType: PluginType.Freeze, - authorityToRemove: { - __kind: 'Pubkey', - address: pubkeyAuth.publicKey, - }, - } + pluginType: PluginType.Freeze, + authorityToRemove: { + __kind: 'Pubkey', + address: pubkeyAuth.publicKey, + }, }).sendAndConfirm(umi); const asset2 = await fetchAssetWithPlugins(umi, assetAddress.publicKey); diff --git a/clients/js/test/removePlugin.test.ts b/clients/js/test/removePlugin.test.ts index 85e74d05..0c1f9356 100644 --- a/clients/js/test/removePlugin.test.ts +++ b/clients/js/test/removePlugin.test.ts @@ -42,12 +42,10 @@ test('it can remove a plugin from an asset', async (t) => { await addPlugin(umi, { asset: assetAddress.publicKey, - addPluginArgs: { - plugin: { - __kind: 'Freeze', - fields: [{ frozen: false }], - }, - } + plugin: { + __kind: 'Freeze', + fields: [{ frozen: false }], + }, }).sendAndConfirm(umi); const asset1 = await fetchAssetWithPlugins(umi, assetAddress.publicKey); @@ -85,7 +83,7 @@ test('it can remove a plugin from an asset', async (t) => { await removePlugin(umi, { asset: assetAddress.publicKey, - removePluginArgs: { pluginType: PluginType.Freeze, } + pluginType: PluginType.Freeze, }).sendAndConfirm(umi); const asset2 = await fetchAssetWithPlugins(umi, assetAddress.publicKey); diff --git a/clients/js/test/update.test.ts b/clients/js/test/update.test.ts index 4540ab50..f92691df 100644 --- a/clients/js/test/update.test.ts +++ b/clients/js/test/update.test.ts @@ -29,10 +29,8 @@ test('it can update an asset to be larger', async (t) => { await update(umi, { asset: assetAddress.publicKey, - updateArgs: { - newName: 'Test Bread 2', - newUri: 'https://example.com/bread2', - } + newName: 'Test Bread 2', + newUri: 'https://example.com/bread2', }).sendAndConfirm(umi); // Then an account was created with the correct data. @@ -62,10 +60,8 @@ test('it can update an asset to be smaller', async (t) => { await update(umi, { asset: assetAddress.publicKey, - updateArgs: { - newName: '', - newUri: '', - } + newName: '', + newUri: '', }).sendAndConfirm(umi); // Then an account was created with the correct data. @@ -95,20 +91,16 @@ test('it can update an asset with plugins to be larger', async (t) => { await addPlugin(umi, { asset: assetAddress.publicKey, - addPluginArgs: { - plugin: { - __kind: 'Freeze', - fields: [{ frozen: false }], - }, - } + plugin: { + __kind: 'Freeze', + fields: [{ frozen: false }], + }, }).sendAndConfirm(umi); await update(umi, { asset: assetAddress.publicKey, - updateArgs: { - newName: 'Test Bread 2', - newUri: 'https://example.com/bread2', - } + newName: 'Test Bread 2', + newUri: 'https://example.com/bread2', }).sendAndConfirm(umi); // Then an account was created with the correct data. @@ -162,20 +154,16 @@ test('it can update an asset with plugins to be smaller', async (t) => { await addPlugin(umi, { asset: assetAddress.publicKey, - addPluginArgs: { - plugin: { - __kind: 'Freeze', - fields: [{ frozen: false }], - }, - } + plugin: { + __kind: 'Freeze', + fields: [{ frozen: false }], + }, }).sendAndConfirm(umi); await update(umi, { asset: assetAddress.publicKey, - updateArgs: { - newName: '', - newUri: '', - } + newName: '', + newUri: '', }).sendAndConfirm(umi); // Then an account was created with the correct data. diff --git a/clients/rust/src/generated/instructions/add_collection_plugin.rs b/clients/rust/src/generated/instructions/add_collection_plugin.rs index 2336c1d9..f96a7981 100644 --- a/clients/rust/src/generated/instructions/add_collection_plugin.rs +++ b/clients/rust/src/generated/instructions/add_collection_plugin.rs @@ -5,7 +5,7 @@ //! [https://github.com/metaplex-foundation/kinobi] //! -use crate::generated::types::AddPluginArgs; +use crate::generated::types::Plugin; use borsh::BorshDeserialize; use borsh::BorshSerialize; @@ -97,7 +97,7 @@ impl AddCollectionPluginInstructionData { #[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct AddCollectionPluginInstructionArgs { - pub add_plugin_args: AddPluginArgs, + pub plugin: Plugin, } /// Instruction builder. @@ -108,7 +108,7 @@ pub struct AddCollectionPluginBuilder { payer: Option, system_program: Option, log_wrapper: Option, - add_plugin_args: Option, + plugin: Option, __remaining_accounts: Vec, } @@ -153,8 +153,8 @@ impl AddCollectionPluginBuilder { self } #[inline(always)] - pub fn add_plugin_args(&mut self, add_plugin_args: AddPluginArgs) -> &mut Self { - self.add_plugin_args = Some(add_plugin_args); + pub fn plugin(&mut self, plugin: Plugin) -> &mut Self { + self.plugin = Some(plugin); self } /// Add an aditional account to the instruction. @@ -187,10 +187,7 @@ impl AddCollectionPluginBuilder { log_wrapper: self.log_wrapper, }; let args = AddCollectionPluginInstructionArgs { - add_plugin_args: self - .add_plugin_args - .clone() - .expect("add_plugin_args is not set"), + plugin: self.plugin.clone().expect("plugin is not set"), }; accounts.instruction_with_remaining_accounts(args, &self.__remaining_accounts) @@ -367,7 +364,7 @@ impl<'a, 'b> AddCollectionPluginCpiBuilder<'a, 'b> { payer: None, system_program: None, log_wrapper: None, - add_plugin_args: None, + plugin: None, __remaining_accounts: Vec::new(), }); Self { instruction } @@ -420,8 +417,8 @@ impl<'a, 'b> AddCollectionPluginCpiBuilder<'a, 'b> { self } #[inline(always)] - pub fn add_plugin_args(&mut self, add_plugin_args: AddPluginArgs) -> &mut Self { - self.instruction.add_plugin_args = Some(add_plugin_args); + pub fn plugin(&mut self, plugin: Plugin) -> &mut Self { + self.instruction.plugin = Some(plugin); self } /// Add an additional account to the instruction. @@ -466,11 +463,7 @@ impl<'a, 'b> AddCollectionPluginCpiBuilder<'a, 'b> { signers_seeds: &[&[&[u8]]], ) -> solana_program::entrypoint::ProgramResult { let args = AddCollectionPluginInstructionArgs { - add_plugin_args: self - .instruction - .add_plugin_args - .clone() - .expect("add_plugin_args is not set"), + plugin: self.instruction.plugin.clone().expect("plugin is not set"), }; let instruction = AddCollectionPluginCpi { __program: self.instruction.__program, @@ -503,7 +496,7 @@ struct AddCollectionPluginCpiBuilderInstruction<'a, 'b> { payer: Option<&'b solana_program::account_info::AccountInfo<'a>>, system_program: Option<&'b solana_program::account_info::AccountInfo<'a>>, log_wrapper: Option<&'b solana_program::account_info::AccountInfo<'a>>, - add_plugin_args: Option, + plugin: Option, /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`. __remaining_accounts: Vec<( &'b solana_program::account_info::AccountInfo<'a>, diff --git a/clients/rust/src/generated/instructions/add_collection_plugin_authority.rs b/clients/rust/src/generated/instructions/add_collection_plugin_authority.rs index 53d2b406..801e2171 100644 --- a/clients/rust/src/generated/instructions/add_collection_plugin_authority.rs +++ b/clients/rust/src/generated/instructions/add_collection_plugin_authority.rs @@ -5,7 +5,8 @@ //! [https://github.com/metaplex-foundation/kinobi] //! -use crate::generated::types::AddPluginAuthorityArgs; +use crate::generated::types::Authority; +use crate::generated::types::PluginType; use borsh::BorshDeserialize; use borsh::BorshSerialize; @@ -97,7 +98,8 @@ impl AddCollectionPluginAuthorityInstructionData { #[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct AddCollectionPluginAuthorityInstructionArgs { - pub add_plugin_authority_args: AddPluginAuthorityArgs, + pub plugin_type: PluginType, + pub new_authority: Authority, } /// Instruction builder. @@ -108,7 +110,8 @@ pub struct AddCollectionPluginAuthorityBuilder { payer: Option, system_program: Option, log_wrapper: Option, - add_plugin_authority_args: Option, + plugin_type: Option, + new_authority: Option, __remaining_accounts: Vec, } @@ -153,11 +156,13 @@ impl AddCollectionPluginAuthorityBuilder { self } #[inline(always)] - pub fn add_plugin_authority_args( - &mut self, - add_plugin_authority_args: AddPluginAuthorityArgs, - ) -> &mut Self { - self.add_plugin_authority_args = Some(add_plugin_authority_args); + pub fn plugin_type(&mut self, plugin_type: PluginType) -> &mut Self { + self.plugin_type = Some(plugin_type); + self + } + #[inline(always)] + pub fn new_authority(&mut self, new_authority: Authority) -> &mut Self { + self.new_authority = Some(new_authority); self } /// Add an aditional account to the instruction. @@ -190,10 +195,11 @@ impl AddCollectionPluginAuthorityBuilder { log_wrapper: self.log_wrapper, }; let args = AddCollectionPluginAuthorityInstructionArgs { - add_plugin_authority_args: self - .add_plugin_authority_args + plugin_type: self.plugin_type.clone().expect("plugin_type is not set"), + new_authority: self + .new_authority .clone() - .expect("add_plugin_authority_args is not set"), + .expect("new_authority is not set"), }; accounts.instruction_with_remaining_accounts(args, &self.__remaining_accounts) @@ -370,7 +376,8 @@ impl<'a, 'b> AddCollectionPluginAuthorityCpiBuilder<'a, 'b> { payer: None, system_program: None, log_wrapper: None, - add_plugin_authority_args: None, + plugin_type: None, + new_authority: None, __remaining_accounts: Vec::new(), }); Self { instruction } @@ -423,11 +430,13 @@ impl<'a, 'b> AddCollectionPluginAuthorityCpiBuilder<'a, 'b> { self } #[inline(always)] - pub fn add_plugin_authority_args( - &mut self, - add_plugin_authority_args: AddPluginAuthorityArgs, - ) -> &mut Self { - self.instruction.add_plugin_authority_args = Some(add_plugin_authority_args); + pub fn plugin_type(&mut self, plugin_type: PluginType) -> &mut Self { + self.instruction.plugin_type = Some(plugin_type); + self + } + #[inline(always)] + pub fn new_authority(&mut self, new_authority: Authority) -> &mut Self { + self.instruction.new_authority = Some(new_authority); self } /// Add an additional account to the instruction. @@ -472,11 +481,16 @@ impl<'a, 'b> AddCollectionPluginAuthorityCpiBuilder<'a, 'b> { signers_seeds: &[&[&[u8]]], ) -> solana_program::entrypoint::ProgramResult { let args = AddCollectionPluginAuthorityInstructionArgs { - add_plugin_authority_args: self + plugin_type: self + .instruction + .plugin_type + .clone() + .expect("plugin_type is not set"), + new_authority: self .instruction - .add_plugin_authority_args + .new_authority .clone() - .expect("add_plugin_authority_args is not set"), + .expect("new_authority is not set"), }; let instruction = AddCollectionPluginAuthorityCpi { __program: self.instruction.__program, @@ -509,7 +523,8 @@ struct AddCollectionPluginAuthorityCpiBuilderInstruction<'a, 'b> { payer: Option<&'b solana_program::account_info::AccountInfo<'a>>, system_program: Option<&'b solana_program::account_info::AccountInfo<'a>>, log_wrapper: Option<&'b solana_program::account_info::AccountInfo<'a>>, - add_plugin_authority_args: Option, + plugin_type: Option, + new_authority: Option, /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`. __remaining_accounts: Vec<( &'b solana_program::account_info::AccountInfo<'a>, diff --git a/clients/rust/src/generated/instructions/add_plugin.rs b/clients/rust/src/generated/instructions/add_plugin.rs index e5d12261..63e522a4 100644 --- a/clients/rust/src/generated/instructions/add_plugin.rs +++ b/clients/rust/src/generated/instructions/add_plugin.rs @@ -5,7 +5,7 @@ //! [https://github.com/metaplex-foundation/kinobi] //! -use crate::generated::types::AddPluginArgs; +use crate::generated::types::Plugin; use borsh::BorshDeserialize; use borsh::BorshSerialize; @@ -106,7 +106,7 @@ impl AddPluginInstructionData { #[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct AddPluginInstructionArgs { - pub add_plugin_args: AddPluginArgs, + pub plugin: Plugin, } /// Instruction builder. @@ -118,7 +118,7 @@ pub struct AddPluginBuilder { payer: Option, system_program: Option, log_wrapper: Option, - add_plugin_args: Option, + plugin: Option, __remaining_accounts: Vec, } @@ -170,8 +170,8 @@ impl AddPluginBuilder { self } #[inline(always)] - pub fn add_plugin_args(&mut self, add_plugin_args: AddPluginArgs) -> &mut Self { - self.add_plugin_args = Some(add_plugin_args); + pub fn plugin(&mut self, plugin: Plugin) -> &mut Self { + self.plugin = Some(plugin); self } /// Add an aditional account to the instruction. @@ -205,10 +205,7 @@ impl AddPluginBuilder { log_wrapper: self.log_wrapper, }; let args = AddPluginInstructionArgs { - add_plugin_args: self - .add_plugin_args - .clone() - .expect("add_plugin_args is not set"), + plugin: self.plugin.clone().expect("plugin is not set"), }; accounts.instruction_with_remaining_accounts(args, &self.__remaining_accounts) @@ -403,7 +400,7 @@ impl<'a, 'b> AddPluginCpiBuilder<'a, 'b> { payer: None, system_program: None, log_wrapper: None, - add_plugin_args: None, + plugin: None, __remaining_accounts: Vec::new(), }); Self { instruction } @@ -463,8 +460,8 @@ impl<'a, 'b> AddPluginCpiBuilder<'a, 'b> { self } #[inline(always)] - pub fn add_plugin_args(&mut self, add_plugin_args: AddPluginArgs) -> &mut Self { - self.instruction.add_plugin_args = Some(add_plugin_args); + pub fn plugin(&mut self, plugin: Plugin) -> &mut Self { + self.instruction.plugin = Some(plugin); self } /// Add an additional account to the instruction. @@ -509,11 +506,7 @@ impl<'a, 'b> AddPluginCpiBuilder<'a, 'b> { signers_seeds: &[&[&[u8]]], ) -> solana_program::entrypoint::ProgramResult { let args = AddPluginInstructionArgs { - add_plugin_args: self - .instruction - .add_plugin_args - .clone() - .expect("add_plugin_args is not set"), + plugin: self.instruction.plugin.clone().expect("plugin is not set"), }; let instruction = AddPluginCpi { __program: self.instruction.__program, @@ -549,7 +542,7 @@ struct AddPluginCpiBuilderInstruction<'a, 'b> { payer: Option<&'b solana_program::account_info::AccountInfo<'a>>, system_program: Option<&'b solana_program::account_info::AccountInfo<'a>>, log_wrapper: Option<&'b solana_program::account_info::AccountInfo<'a>>, - add_plugin_args: Option, + plugin: Option, /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`. __remaining_accounts: Vec<( &'b solana_program::account_info::AccountInfo<'a>, diff --git a/clients/rust/src/generated/instructions/add_plugin_authority.rs b/clients/rust/src/generated/instructions/add_plugin_authority.rs index 5b601b86..da64d908 100644 --- a/clients/rust/src/generated/instructions/add_plugin_authority.rs +++ b/clients/rust/src/generated/instructions/add_plugin_authority.rs @@ -5,7 +5,8 @@ //! [https://github.com/metaplex-foundation/kinobi] //! -use crate::generated::types::AddPluginAuthorityArgs; +use crate::generated::types::Authority; +use crate::generated::types::PluginType; use borsh::BorshDeserialize; use borsh::BorshSerialize; @@ -108,7 +109,8 @@ impl AddPluginAuthorityInstructionData { #[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct AddPluginAuthorityInstructionArgs { - pub add_plugin_authority_args: AddPluginAuthorityArgs, + pub plugin_type: PluginType, + pub new_authority: Authority, } /// Instruction builder. @@ -120,7 +122,8 @@ pub struct AddPluginAuthorityBuilder { payer: Option, system_program: Option, log_wrapper: Option, - add_plugin_authority_args: Option, + plugin_type: Option, + new_authority: Option, __remaining_accounts: Vec, } @@ -172,11 +175,13 @@ impl AddPluginAuthorityBuilder { self } #[inline(always)] - pub fn add_plugin_authority_args( - &mut self, - add_plugin_authority_args: AddPluginAuthorityArgs, - ) -> &mut Self { - self.add_plugin_authority_args = Some(add_plugin_authority_args); + pub fn plugin_type(&mut self, plugin_type: PluginType) -> &mut Self { + self.plugin_type = Some(plugin_type); + self + } + #[inline(always)] + pub fn new_authority(&mut self, new_authority: Authority) -> &mut Self { + self.new_authority = Some(new_authority); self } /// Add an aditional account to the instruction. @@ -210,10 +215,11 @@ impl AddPluginAuthorityBuilder { log_wrapper: self.log_wrapper, }; let args = AddPluginAuthorityInstructionArgs { - add_plugin_authority_args: self - .add_plugin_authority_args + plugin_type: self.plugin_type.clone().expect("plugin_type is not set"), + new_authority: self + .new_authority .clone() - .expect("add_plugin_authority_args is not set"), + .expect("new_authority is not set"), }; accounts.instruction_with_remaining_accounts(args, &self.__remaining_accounts) @@ -410,7 +416,8 @@ impl<'a, 'b> AddPluginAuthorityCpiBuilder<'a, 'b> { payer: None, system_program: None, log_wrapper: None, - add_plugin_authority_args: None, + plugin_type: None, + new_authority: None, __remaining_accounts: Vec::new(), }); Self { instruction } @@ -470,11 +477,13 @@ impl<'a, 'b> AddPluginAuthorityCpiBuilder<'a, 'b> { self } #[inline(always)] - pub fn add_plugin_authority_args( - &mut self, - add_plugin_authority_args: AddPluginAuthorityArgs, - ) -> &mut Self { - self.instruction.add_plugin_authority_args = Some(add_plugin_authority_args); + pub fn plugin_type(&mut self, plugin_type: PluginType) -> &mut Self { + self.instruction.plugin_type = Some(plugin_type); + self + } + #[inline(always)] + pub fn new_authority(&mut self, new_authority: Authority) -> &mut Self { + self.instruction.new_authority = Some(new_authority); self } /// Add an additional account to the instruction. @@ -519,11 +528,16 @@ impl<'a, 'b> AddPluginAuthorityCpiBuilder<'a, 'b> { signers_seeds: &[&[&[u8]]], ) -> solana_program::entrypoint::ProgramResult { let args = AddPluginAuthorityInstructionArgs { - add_plugin_authority_args: self + plugin_type: self + .instruction + .plugin_type + .clone() + .expect("plugin_type is not set"), + new_authority: self .instruction - .add_plugin_authority_args + .new_authority .clone() - .expect("add_plugin_authority_args is not set"), + .expect("new_authority is not set"), }; let instruction = AddPluginAuthorityCpi { __program: self.instruction.__program, @@ -559,7 +573,8 @@ struct AddPluginAuthorityCpiBuilderInstruction<'a, 'b> { payer: Option<&'b solana_program::account_info::AccountInfo<'a>>, system_program: Option<&'b solana_program::account_info::AccountInfo<'a>>, log_wrapper: Option<&'b solana_program::account_info::AccountInfo<'a>>, - add_plugin_authority_args: Option, + plugin_type: Option, + new_authority: Option, /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`. __remaining_accounts: Vec<( &'b solana_program::account_info::AccountInfo<'a>, diff --git a/clients/rust/src/generated/instructions/burn_collection.rs b/clients/rust/src/generated/instructions/burn_collection.rs index 6895ef15..8a51ee46 100644 --- a/clients/rust/src/generated/instructions/burn_collection.rs +++ b/clients/rust/src/generated/instructions/burn_collection.rs @@ -5,6 +5,7 @@ //! [https://github.com/metaplex-foundation/kinobi] //! +use crate::generated::types::CompressionProof; use borsh::BorshDeserialize; use borsh::BorshSerialize; @@ -21,12 +22,16 @@ pub struct BurnCollection { } impl BurnCollection { - pub fn instruction(&self) -> solana_program::instruction::Instruction { - self.instruction_with_remaining_accounts(&[]) + pub fn instruction( + &self, + args: BurnCollectionInstructionArgs, + ) -> solana_program::instruction::Instruction { + self.instruction_with_remaining_accounts(args, &[]) } #[allow(clippy::vec_init_then_push)] pub fn instruction_with_remaining_accounts( &self, + args: BurnCollectionInstructionArgs, remaining_accounts: &[solana_program::instruction::AccountMeta], ) -> solana_program::instruction::Instruction { let mut accounts = Vec::with_capacity(4 + remaining_accounts.len()); @@ -58,7 +63,9 @@ impl BurnCollection { )); } accounts.extend_from_slice(remaining_accounts); - let data = BurnCollectionInstructionData::new().try_to_vec().unwrap(); + let mut data = BurnCollectionInstructionData::new().try_to_vec().unwrap(); + let mut args = args.try_to_vec().unwrap(); + data.append(&mut args); solana_program::instruction::Instruction { program_id: crate::MPL_CORE_ID, @@ -79,6 +86,12 @@ impl BurnCollectionInstructionData { } } +#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)] +#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] +pub struct BurnCollectionInstructionArgs { + pub compression_proof: Option, +} + /// Instruction builder. #[derive(Default)] pub struct BurnCollectionBuilder { @@ -86,6 +99,7 @@ pub struct BurnCollectionBuilder { authority: Option, payer: Option, log_wrapper: Option, + compression_proof: Option, __remaining_accounts: Vec, } @@ -122,6 +136,12 @@ impl BurnCollectionBuilder { self.log_wrapper = log_wrapper; self } + /// `[optional argument]` + #[inline(always)] + pub fn compression_proof(&mut self, compression_proof: CompressionProof) -> &mut Self { + self.compression_proof = Some(compression_proof); + self + } /// Add an aditional account to the instruction. #[inline(always)] pub fn add_remaining_account( @@ -148,8 +168,11 @@ impl BurnCollectionBuilder { payer: self.payer, log_wrapper: self.log_wrapper, }; + let args = BurnCollectionInstructionArgs { + compression_proof: self.compression_proof.clone(), + }; - accounts.instruction_with_remaining_accounts(&self.__remaining_accounts) + accounts.instruction_with_remaining_accounts(args, &self.__remaining_accounts) } } @@ -177,12 +200,15 @@ pub struct BurnCollectionCpi<'a, 'b> { pub payer: Option<&'b solana_program::account_info::AccountInfo<'a>>, /// The SPL Noop Program pub log_wrapper: Option<&'b solana_program::account_info::AccountInfo<'a>>, + /// The arguments for the instruction. + pub __args: BurnCollectionInstructionArgs, } impl<'a, 'b> BurnCollectionCpi<'a, 'b> { pub fn new( program: &'b solana_program::account_info::AccountInfo<'a>, accounts: BurnCollectionCpiAccounts<'a, 'b>, + args: BurnCollectionInstructionArgs, ) -> Self { Self { __program: program, @@ -190,6 +216,7 @@ impl<'a, 'b> BurnCollectionCpi<'a, 'b> { authority: accounts.authority, payer: accounts.payer, log_wrapper: accounts.log_wrapper, + __args: args, } } #[inline(always)] @@ -262,7 +289,9 @@ impl<'a, 'b> BurnCollectionCpi<'a, 'b> { is_writable: remaining_account.2, }) }); - let data = BurnCollectionInstructionData::new().try_to_vec().unwrap(); + let mut data = BurnCollectionInstructionData::new().try_to_vec().unwrap(); + let mut args = self.__args.try_to_vec().unwrap(); + data.append(&mut args); let instruction = solana_program::instruction::Instruction { program_id: crate::MPL_CORE_ID, @@ -304,6 +333,7 @@ impl<'a, 'b> BurnCollectionCpiBuilder<'a, 'b> { authority: None, payer: None, log_wrapper: None, + compression_proof: None, __remaining_accounts: Vec::new(), }); Self { instruction } @@ -346,6 +376,12 @@ impl<'a, 'b> BurnCollectionCpiBuilder<'a, 'b> { self.instruction.log_wrapper = log_wrapper; self } + /// `[optional argument]` + #[inline(always)] + pub fn compression_proof(&mut self, compression_proof: CompressionProof) -> &mut Self { + self.instruction.compression_proof = Some(compression_proof); + self + } /// Add an additional account to the instruction. #[inline(always)] pub fn add_remaining_account( @@ -387,6 +423,9 @@ impl<'a, 'b> BurnCollectionCpiBuilder<'a, 'b> { &self, signers_seeds: &[&[&[u8]]], ) -> solana_program::entrypoint::ProgramResult { + let args = BurnCollectionInstructionArgs { + compression_proof: self.instruction.compression_proof.clone(), + }; let instruction = BurnCollectionCpi { __program: self.instruction.__program, @@ -397,6 +436,7 @@ impl<'a, 'b> BurnCollectionCpiBuilder<'a, 'b> { payer: self.instruction.payer, log_wrapper: self.instruction.log_wrapper, + __args: args, }; instruction.invoke_signed_with_remaining_accounts( signers_seeds, @@ -411,6 +451,7 @@ struct BurnCollectionCpiBuilderInstruction<'a, 'b> { authority: Option<&'b solana_program::account_info::AccountInfo<'a>>, payer: Option<&'b solana_program::account_info::AccountInfo<'a>>, log_wrapper: Option<&'b solana_program::account_info::AccountInfo<'a>>, + compression_proof: Option, /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`. __remaining_accounts: Vec<( &'b solana_program::account_info::AccountInfo<'a>, diff --git a/clients/rust/src/generated/instructions/remove_collection_plugin.rs b/clients/rust/src/generated/instructions/remove_collection_plugin.rs index 635378d9..35532353 100644 --- a/clients/rust/src/generated/instructions/remove_collection_plugin.rs +++ b/clients/rust/src/generated/instructions/remove_collection_plugin.rs @@ -5,7 +5,7 @@ //! [https://github.com/metaplex-foundation/kinobi] //! -use crate::generated::types::RemovePluginArgs; +use crate::generated::types::PluginType; use borsh::BorshDeserialize; use borsh::BorshSerialize; @@ -97,7 +97,7 @@ impl RemoveCollectionPluginInstructionData { #[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct RemoveCollectionPluginInstructionArgs { - pub remove_plugin_args: RemovePluginArgs, + pub plugin_type: PluginType, } /// Instruction builder. @@ -108,7 +108,7 @@ pub struct RemoveCollectionPluginBuilder { payer: Option, system_program: Option, log_wrapper: Option, - remove_plugin_args: Option, + plugin_type: Option, __remaining_accounts: Vec, } @@ -153,8 +153,8 @@ impl RemoveCollectionPluginBuilder { self } #[inline(always)] - pub fn remove_plugin_args(&mut self, remove_plugin_args: RemovePluginArgs) -> &mut Self { - self.remove_plugin_args = Some(remove_plugin_args); + pub fn plugin_type(&mut self, plugin_type: PluginType) -> &mut Self { + self.plugin_type = Some(plugin_type); self } /// Add an aditional account to the instruction. @@ -187,10 +187,7 @@ impl RemoveCollectionPluginBuilder { log_wrapper: self.log_wrapper, }; let args = RemoveCollectionPluginInstructionArgs { - remove_plugin_args: self - .remove_plugin_args - .clone() - .expect("remove_plugin_args is not set"), + plugin_type: self.plugin_type.clone().expect("plugin_type is not set"), }; accounts.instruction_with_remaining_accounts(args, &self.__remaining_accounts) @@ -367,7 +364,7 @@ impl<'a, 'b> RemoveCollectionPluginCpiBuilder<'a, 'b> { payer: None, system_program: None, log_wrapper: None, - remove_plugin_args: None, + plugin_type: None, __remaining_accounts: Vec::new(), }); Self { instruction } @@ -420,8 +417,8 @@ impl<'a, 'b> RemoveCollectionPluginCpiBuilder<'a, 'b> { self } #[inline(always)] - pub fn remove_plugin_args(&mut self, remove_plugin_args: RemovePluginArgs) -> &mut Self { - self.instruction.remove_plugin_args = Some(remove_plugin_args); + pub fn plugin_type(&mut self, plugin_type: PluginType) -> &mut Self { + self.instruction.plugin_type = Some(plugin_type); self } /// Add an additional account to the instruction. @@ -466,11 +463,11 @@ impl<'a, 'b> RemoveCollectionPluginCpiBuilder<'a, 'b> { signers_seeds: &[&[&[u8]]], ) -> solana_program::entrypoint::ProgramResult { let args = RemoveCollectionPluginInstructionArgs { - remove_plugin_args: self + plugin_type: self .instruction - .remove_plugin_args + .plugin_type .clone() - .expect("remove_plugin_args is not set"), + .expect("plugin_type is not set"), }; let instruction = RemoveCollectionPluginCpi { __program: self.instruction.__program, @@ -503,7 +500,7 @@ struct RemoveCollectionPluginCpiBuilderInstruction<'a, 'b> { payer: Option<&'b solana_program::account_info::AccountInfo<'a>>, system_program: Option<&'b solana_program::account_info::AccountInfo<'a>>, log_wrapper: Option<&'b solana_program::account_info::AccountInfo<'a>>, - remove_plugin_args: Option, + plugin_type: Option, /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`. __remaining_accounts: Vec<( &'b solana_program::account_info::AccountInfo<'a>, diff --git a/clients/rust/src/generated/instructions/remove_collection_plugin_authority.rs b/clients/rust/src/generated/instructions/remove_collection_plugin_authority.rs index 9f5ca145..a0835ad7 100644 --- a/clients/rust/src/generated/instructions/remove_collection_plugin_authority.rs +++ b/clients/rust/src/generated/instructions/remove_collection_plugin_authority.rs @@ -5,7 +5,8 @@ //! [https://github.com/metaplex-foundation/kinobi] //! -use crate::generated::types::RemovePluginAuthorityArgs; +use crate::generated::types::Authority; +use crate::generated::types::PluginType; use borsh::BorshDeserialize; use borsh::BorshSerialize; @@ -97,7 +98,8 @@ impl RemoveCollectionPluginAuthorityInstructionData { #[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct RemoveCollectionPluginAuthorityInstructionArgs { - pub remove_plugin_authority_args: RemovePluginAuthorityArgs, + pub plugin_type: PluginType, + pub authority_to_remove: Authority, } /// Instruction builder. @@ -108,7 +110,8 @@ pub struct RemoveCollectionPluginAuthorityBuilder { payer: Option, system_program: Option, log_wrapper: Option, - remove_plugin_authority_args: Option, + plugin_type: Option, + authority_to_remove: Option, __remaining_accounts: Vec, } @@ -153,11 +156,13 @@ impl RemoveCollectionPluginAuthorityBuilder { self } #[inline(always)] - pub fn remove_plugin_authority_args( - &mut self, - remove_plugin_authority_args: RemovePluginAuthorityArgs, - ) -> &mut Self { - self.remove_plugin_authority_args = Some(remove_plugin_authority_args); + pub fn plugin_type(&mut self, plugin_type: PluginType) -> &mut Self { + self.plugin_type = Some(plugin_type); + self + } + #[inline(always)] + pub fn authority_to_remove(&mut self, authority_to_remove: Authority) -> &mut Self { + self.authority_to_remove = Some(authority_to_remove); self } /// Add an aditional account to the instruction. @@ -190,10 +195,11 @@ impl RemoveCollectionPluginAuthorityBuilder { log_wrapper: self.log_wrapper, }; let args = RemoveCollectionPluginAuthorityInstructionArgs { - remove_plugin_authority_args: self - .remove_plugin_authority_args + plugin_type: self.plugin_type.clone().expect("plugin_type is not set"), + authority_to_remove: self + .authority_to_remove .clone() - .expect("remove_plugin_authority_args is not set"), + .expect("authority_to_remove is not set"), }; accounts.instruction_with_remaining_accounts(args, &self.__remaining_accounts) @@ -370,7 +376,8 @@ impl<'a, 'b> RemoveCollectionPluginAuthorityCpiBuilder<'a, 'b> { payer: None, system_program: None, log_wrapper: None, - remove_plugin_authority_args: None, + plugin_type: None, + authority_to_remove: None, __remaining_accounts: Vec::new(), }); Self { instruction } @@ -423,11 +430,13 @@ impl<'a, 'b> RemoveCollectionPluginAuthorityCpiBuilder<'a, 'b> { self } #[inline(always)] - pub fn remove_plugin_authority_args( - &mut self, - remove_plugin_authority_args: RemovePluginAuthorityArgs, - ) -> &mut Self { - self.instruction.remove_plugin_authority_args = Some(remove_plugin_authority_args); + pub fn plugin_type(&mut self, plugin_type: PluginType) -> &mut Self { + self.instruction.plugin_type = Some(plugin_type); + self + } + #[inline(always)] + pub fn authority_to_remove(&mut self, authority_to_remove: Authority) -> &mut Self { + self.instruction.authority_to_remove = Some(authority_to_remove); self } /// Add an additional account to the instruction. @@ -472,11 +481,16 @@ impl<'a, 'b> RemoveCollectionPluginAuthorityCpiBuilder<'a, 'b> { signers_seeds: &[&[&[u8]]], ) -> solana_program::entrypoint::ProgramResult { let args = RemoveCollectionPluginAuthorityInstructionArgs { - remove_plugin_authority_args: self + plugin_type: self + .instruction + .plugin_type + .clone() + .expect("plugin_type is not set"), + authority_to_remove: self .instruction - .remove_plugin_authority_args + .authority_to_remove .clone() - .expect("remove_plugin_authority_args is not set"), + .expect("authority_to_remove is not set"), }; let instruction = RemoveCollectionPluginAuthorityCpi { __program: self.instruction.__program, @@ -509,7 +523,8 @@ struct RemoveCollectionPluginAuthorityCpiBuilderInstruction<'a, 'b> { payer: Option<&'b solana_program::account_info::AccountInfo<'a>>, system_program: Option<&'b solana_program::account_info::AccountInfo<'a>>, log_wrapper: Option<&'b solana_program::account_info::AccountInfo<'a>>, - remove_plugin_authority_args: Option, + plugin_type: Option, + authority_to_remove: Option, /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`. __remaining_accounts: Vec<( &'b solana_program::account_info::AccountInfo<'a>, diff --git a/clients/rust/src/generated/instructions/remove_plugin.rs b/clients/rust/src/generated/instructions/remove_plugin.rs index 6bd8d942..62378810 100644 --- a/clients/rust/src/generated/instructions/remove_plugin.rs +++ b/clients/rust/src/generated/instructions/remove_plugin.rs @@ -5,7 +5,7 @@ //! [https://github.com/metaplex-foundation/kinobi] //! -use crate::generated::types::RemovePluginArgs; +use crate::generated::types::PluginType; use borsh::BorshDeserialize; use borsh::BorshSerialize; @@ -106,7 +106,7 @@ impl RemovePluginInstructionData { #[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct RemovePluginInstructionArgs { - pub remove_plugin_args: RemovePluginArgs, + pub plugin_type: PluginType, } /// Instruction builder. @@ -118,7 +118,7 @@ pub struct RemovePluginBuilder { payer: Option, system_program: Option, log_wrapper: Option, - remove_plugin_args: Option, + plugin_type: Option, __remaining_accounts: Vec, } @@ -170,8 +170,8 @@ impl RemovePluginBuilder { self } #[inline(always)] - pub fn remove_plugin_args(&mut self, remove_plugin_args: RemovePluginArgs) -> &mut Self { - self.remove_plugin_args = Some(remove_plugin_args); + pub fn plugin_type(&mut self, plugin_type: PluginType) -> &mut Self { + self.plugin_type = Some(plugin_type); self } /// Add an aditional account to the instruction. @@ -205,10 +205,7 @@ impl RemovePluginBuilder { log_wrapper: self.log_wrapper, }; let args = RemovePluginInstructionArgs { - remove_plugin_args: self - .remove_plugin_args - .clone() - .expect("remove_plugin_args is not set"), + plugin_type: self.plugin_type.clone().expect("plugin_type is not set"), }; accounts.instruction_with_remaining_accounts(args, &self.__remaining_accounts) @@ -403,7 +400,7 @@ impl<'a, 'b> RemovePluginCpiBuilder<'a, 'b> { payer: None, system_program: None, log_wrapper: None, - remove_plugin_args: None, + plugin_type: None, __remaining_accounts: Vec::new(), }); Self { instruction } @@ -463,8 +460,8 @@ impl<'a, 'b> RemovePluginCpiBuilder<'a, 'b> { self } #[inline(always)] - pub fn remove_plugin_args(&mut self, remove_plugin_args: RemovePluginArgs) -> &mut Self { - self.instruction.remove_plugin_args = Some(remove_plugin_args); + pub fn plugin_type(&mut self, plugin_type: PluginType) -> &mut Self { + self.instruction.plugin_type = Some(plugin_type); self } /// Add an additional account to the instruction. @@ -509,11 +506,11 @@ impl<'a, 'b> RemovePluginCpiBuilder<'a, 'b> { signers_seeds: &[&[&[u8]]], ) -> solana_program::entrypoint::ProgramResult { let args = RemovePluginInstructionArgs { - remove_plugin_args: self + plugin_type: self .instruction - .remove_plugin_args + .plugin_type .clone() - .expect("remove_plugin_args is not set"), + .expect("plugin_type is not set"), }; let instruction = RemovePluginCpi { __program: self.instruction.__program, @@ -549,7 +546,7 @@ struct RemovePluginCpiBuilderInstruction<'a, 'b> { payer: Option<&'b solana_program::account_info::AccountInfo<'a>>, system_program: Option<&'b solana_program::account_info::AccountInfo<'a>>, log_wrapper: Option<&'b solana_program::account_info::AccountInfo<'a>>, - remove_plugin_args: Option, + plugin_type: Option, /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`. __remaining_accounts: Vec<( &'b solana_program::account_info::AccountInfo<'a>, diff --git a/clients/rust/src/generated/instructions/remove_plugin_authority.rs b/clients/rust/src/generated/instructions/remove_plugin_authority.rs index 5d3ecd4a..da2aba1b 100644 --- a/clients/rust/src/generated/instructions/remove_plugin_authority.rs +++ b/clients/rust/src/generated/instructions/remove_plugin_authority.rs @@ -5,7 +5,8 @@ //! [https://github.com/metaplex-foundation/kinobi] //! -use crate::generated::types::RemovePluginAuthorityArgs; +use crate::generated::types::Authority; +use crate::generated::types::PluginType; use borsh::BorshDeserialize; use borsh::BorshSerialize; @@ -108,7 +109,8 @@ impl RemovePluginAuthorityInstructionData { #[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct RemovePluginAuthorityInstructionArgs { - pub remove_plugin_authority_args: RemovePluginAuthorityArgs, + pub plugin_type: PluginType, + pub authority_to_remove: Authority, } /// Instruction builder. @@ -120,7 +122,8 @@ pub struct RemovePluginAuthorityBuilder { payer: Option, system_program: Option, log_wrapper: Option, - remove_plugin_authority_args: Option, + plugin_type: Option, + authority_to_remove: Option, __remaining_accounts: Vec, } @@ -172,11 +175,13 @@ impl RemovePluginAuthorityBuilder { self } #[inline(always)] - pub fn remove_plugin_authority_args( - &mut self, - remove_plugin_authority_args: RemovePluginAuthorityArgs, - ) -> &mut Self { - self.remove_plugin_authority_args = Some(remove_plugin_authority_args); + pub fn plugin_type(&mut self, plugin_type: PluginType) -> &mut Self { + self.plugin_type = Some(plugin_type); + self + } + #[inline(always)] + pub fn authority_to_remove(&mut self, authority_to_remove: Authority) -> &mut Self { + self.authority_to_remove = Some(authority_to_remove); self } /// Add an aditional account to the instruction. @@ -210,10 +215,11 @@ impl RemovePluginAuthorityBuilder { log_wrapper: self.log_wrapper, }; let args = RemovePluginAuthorityInstructionArgs { - remove_plugin_authority_args: self - .remove_plugin_authority_args + plugin_type: self.plugin_type.clone().expect("plugin_type is not set"), + authority_to_remove: self + .authority_to_remove .clone() - .expect("remove_plugin_authority_args is not set"), + .expect("authority_to_remove is not set"), }; accounts.instruction_with_remaining_accounts(args, &self.__remaining_accounts) @@ -410,7 +416,8 @@ impl<'a, 'b> RemovePluginAuthorityCpiBuilder<'a, 'b> { payer: None, system_program: None, log_wrapper: None, - remove_plugin_authority_args: None, + plugin_type: None, + authority_to_remove: None, __remaining_accounts: Vec::new(), }); Self { instruction } @@ -470,11 +477,13 @@ impl<'a, 'b> RemovePluginAuthorityCpiBuilder<'a, 'b> { self } #[inline(always)] - pub fn remove_plugin_authority_args( - &mut self, - remove_plugin_authority_args: RemovePluginAuthorityArgs, - ) -> &mut Self { - self.instruction.remove_plugin_authority_args = Some(remove_plugin_authority_args); + pub fn plugin_type(&mut self, plugin_type: PluginType) -> &mut Self { + self.instruction.plugin_type = Some(plugin_type); + self + } + #[inline(always)] + pub fn authority_to_remove(&mut self, authority_to_remove: Authority) -> &mut Self { + self.instruction.authority_to_remove = Some(authority_to_remove); self } /// Add an additional account to the instruction. @@ -519,11 +528,16 @@ impl<'a, 'b> RemovePluginAuthorityCpiBuilder<'a, 'b> { signers_seeds: &[&[&[u8]]], ) -> solana_program::entrypoint::ProgramResult { let args = RemovePluginAuthorityInstructionArgs { - remove_plugin_authority_args: self + plugin_type: self + .instruction + .plugin_type + .clone() + .expect("plugin_type is not set"), + authority_to_remove: self .instruction - .remove_plugin_authority_args + .authority_to_remove .clone() - .expect("remove_plugin_authority_args is not set"), + .expect("authority_to_remove is not set"), }; let instruction = RemovePluginAuthorityCpi { __program: self.instruction.__program, @@ -559,7 +573,8 @@ struct RemovePluginAuthorityCpiBuilderInstruction<'a, 'b> { payer: Option<&'b solana_program::account_info::AccountInfo<'a>>, system_program: Option<&'b solana_program::account_info::AccountInfo<'a>>, log_wrapper: Option<&'b solana_program::account_info::AccountInfo<'a>>, - remove_plugin_authority_args: Option, + plugin_type: Option, + authority_to_remove: Option, /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`. __remaining_accounts: Vec<( &'b solana_program::account_info::AccountInfo<'a>, diff --git a/clients/rust/src/generated/instructions/update.rs b/clients/rust/src/generated/instructions/update.rs index 2b06e775..c8a0e01e 100644 --- a/clients/rust/src/generated/instructions/update.rs +++ b/clients/rust/src/generated/instructions/update.rs @@ -5,7 +5,6 @@ //! [https://github.com/metaplex-foundation/kinobi] //! -use crate::generated::types::UpdateArgs; use borsh::BorshDeserialize; use borsh::BorshSerialize; @@ -107,7 +106,8 @@ impl UpdateInstructionData { #[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct UpdateInstructionArgs { - pub update_args: UpdateArgs, + pub new_name: Option, + pub new_uri: Option, } /// Instruction builder. @@ -119,7 +119,8 @@ pub struct UpdateBuilder { new_update_authority: Option, system_program: Option, log_wrapper: Option, - update_args: Option, + new_name: Option, + new_uri: Option, __remaining_accounts: Vec, } @@ -173,9 +174,16 @@ impl UpdateBuilder { self.log_wrapper = log_wrapper; self } + /// `[optional argument]` #[inline(always)] - pub fn update_args(&mut self, update_args: UpdateArgs) -> &mut Self { - self.update_args = Some(update_args); + pub fn new_name(&mut self, new_name: String) -> &mut Self { + self.new_name = Some(new_name); + self + } + /// `[optional argument]` + #[inline(always)] + pub fn new_uri(&mut self, new_uri: String) -> &mut Self { + self.new_uri = Some(new_uri); self } /// Add an aditional account to the instruction. @@ -209,7 +217,8 @@ impl UpdateBuilder { log_wrapper: self.log_wrapper, }; let args = UpdateInstructionArgs { - update_args: self.update_args.clone().expect("update_args is not set"), + new_name: self.new_name.clone(), + new_uri: self.new_uri.clone(), }; accounts.instruction_with_remaining_accounts(args, &self.__remaining_accounts) @@ -404,7 +413,8 @@ impl<'a, 'b> UpdateCpiBuilder<'a, 'b> { new_update_authority: None, system_program: None, log_wrapper: None, - update_args: None, + new_name: None, + new_uri: None, __remaining_accounts: Vec::new(), }); Self { instruction } @@ -463,9 +473,16 @@ impl<'a, 'b> UpdateCpiBuilder<'a, 'b> { self.instruction.log_wrapper = log_wrapper; self } + /// `[optional argument]` #[inline(always)] - pub fn update_args(&mut self, update_args: UpdateArgs) -> &mut Self { - self.instruction.update_args = Some(update_args); + pub fn new_name(&mut self, new_name: String) -> &mut Self { + self.instruction.new_name = Some(new_name); + self + } + /// `[optional argument]` + #[inline(always)] + pub fn new_uri(&mut self, new_uri: String) -> &mut Self { + self.instruction.new_uri = Some(new_uri); self } /// Add an additional account to the instruction. @@ -510,11 +527,8 @@ impl<'a, 'b> UpdateCpiBuilder<'a, 'b> { signers_seeds: &[&[&[u8]]], ) -> solana_program::entrypoint::ProgramResult { let args = UpdateInstructionArgs { - update_args: self - .instruction - .update_args - .clone() - .expect("update_args is not set"), + new_name: self.instruction.new_name.clone(), + new_uri: self.instruction.new_uri.clone(), }; let instruction = UpdateCpi { __program: self.instruction.__program, @@ -550,7 +564,8 @@ struct UpdateCpiBuilderInstruction<'a, 'b> { new_update_authority: Option<&'b solana_program::account_info::AccountInfo<'a>>, system_program: Option<&'b solana_program::account_info::AccountInfo<'a>>, log_wrapper: Option<&'b solana_program::account_info::AccountInfo<'a>>, - update_args: Option, + new_name: Option, + new_uri: Option, /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`. __remaining_accounts: Vec<( &'b solana_program::account_info::AccountInfo<'a>, diff --git a/clients/rust/src/generated/instructions/update_collection.rs b/clients/rust/src/generated/instructions/update_collection.rs index 6ec1b8fa..d01a2667 100644 --- a/clients/rust/src/generated/instructions/update_collection.rs +++ b/clients/rust/src/generated/instructions/update_collection.rs @@ -5,7 +5,6 @@ //! [https://github.com/metaplex-foundation/kinobi] //! -use crate::generated::types::UpdateArgs; use borsh::BorshDeserialize; use borsh::BorshSerialize; @@ -108,7 +107,8 @@ impl UpdateCollectionInstructionData { #[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct UpdateCollectionInstructionArgs { - pub update_args: UpdateArgs, + pub new_name: Option, + pub new_uri: Option, } /// Instruction builder. @@ -120,7 +120,8 @@ pub struct UpdateCollectionBuilder { new_update_authority: Option, system_program: Option, log_wrapper: Option, - update_args: Option, + new_name: Option, + new_uri: Option, __remaining_accounts: Vec, } @@ -174,9 +175,16 @@ impl UpdateCollectionBuilder { self.log_wrapper = log_wrapper; self } + /// `[optional argument]` #[inline(always)] - pub fn update_args(&mut self, update_args: UpdateArgs) -> &mut Self { - self.update_args = Some(update_args); + pub fn new_name(&mut self, new_name: String) -> &mut Self { + self.new_name = Some(new_name); + self + } + /// `[optional argument]` + #[inline(always)] + pub fn new_uri(&mut self, new_uri: String) -> &mut Self { + self.new_uri = Some(new_uri); self } /// Add an aditional account to the instruction. @@ -210,7 +218,8 @@ impl UpdateCollectionBuilder { log_wrapper: self.log_wrapper, }; let args = UpdateCollectionInstructionArgs { - update_args: self.update_args.clone().expect("update_args is not set"), + new_name: self.new_name.clone(), + new_uri: self.new_uri.clone(), }; accounts.instruction_with_remaining_accounts(args, &self.__remaining_accounts) @@ -405,7 +414,8 @@ impl<'a, 'b> UpdateCollectionCpiBuilder<'a, 'b> { new_update_authority: None, system_program: None, log_wrapper: None, - update_args: None, + new_name: None, + new_uri: None, __remaining_accounts: Vec::new(), }); Self { instruction } @@ -467,9 +477,16 @@ impl<'a, 'b> UpdateCollectionCpiBuilder<'a, 'b> { self.instruction.log_wrapper = log_wrapper; self } + /// `[optional argument]` #[inline(always)] - pub fn update_args(&mut self, update_args: UpdateArgs) -> &mut Self { - self.instruction.update_args = Some(update_args); + pub fn new_name(&mut self, new_name: String) -> &mut Self { + self.instruction.new_name = Some(new_name); + self + } + /// `[optional argument]` + #[inline(always)] + pub fn new_uri(&mut self, new_uri: String) -> &mut Self { + self.instruction.new_uri = Some(new_uri); self } /// Add an additional account to the instruction. @@ -514,11 +531,8 @@ impl<'a, 'b> UpdateCollectionCpiBuilder<'a, 'b> { signers_seeds: &[&[&[u8]]], ) -> solana_program::entrypoint::ProgramResult { let args = UpdateCollectionInstructionArgs { - update_args: self - .instruction - .update_args - .clone() - .expect("update_args is not set"), + new_name: self.instruction.new_name.clone(), + new_uri: self.instruction.new_uri.clone(), }; let instruction = UpdateCollectionCpi { __program: self.instruction.__program, @@ -554,7 +568,8 @@ struct UpdateCollectionCpiBuilderInstruction<'a, 'b> { new_update_authority: Option<&'b solana_program::account_info::AccountInfo<'a>>, system_program: Option<&'b solana_program::account_info::AccountInfo<'a>>, log_wrapper: Option<&'b solana_program::account_info::AccountInfo<'a>>, - update_args: Option, + new_name: Option, + new_uri: Option, /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`. __remaining_accounts: Vec<( &'b solana_program::account_info::AccountInfo<'a>, diff --git a/clients/rust/src/generated/instructions/update_collection_plugin.rs b/clients/rust/src/generated/instructions/update_collection_plugin.rs index b0697efa..4201f7b3 100644 --- a/clients/rust/src/generated/instructions/update_collection_plugin.rs +++ b/clients/rust/src/generated/instructions/update_collection_plugin.rs @@ -5,7 +5,7 @@ //! [https://github.com/metaplex-foundation/kinobi] //! -use crate::generated::types::UpdatePluginArgs; +use crate::generated::types::Plugin; use borsh::BorshDeserialize; use borsh::BorshSerialize; @@ -97,7 +97,7 @@ impl UpdateCollectionPluginInstructionData { #[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct UpdateCollectionPluginInstructionArgs { - pub update_plugin_args: UpdatePluginArgs, + pub plugin: Plugin, } /// Instruction builder. @@ -108,7 +108,7 @@ pub struct UpdateCollectionPluginBuilder { payer: Option, system_program: Option, log_wrapper: Option, - update_plugin_args: Option, + plugin: Option, __remaining_accounts: Vec, } @@ -153,8 +153,8 @@ impl UpdateCollectionPluginBuilder { self } #[inline(always)] - pub fn update_plugin_args(&mut self, update_plugin_args: UpdatePluginArgs) -> &mut Self { - self.update_plugin_args = Some(update_plugin_args); + pub fn plugin(&mut self, plugin: Plugin) -> &mut Self { + self.plugin = Some(plugin); self } /// Add an aditional account to the instruction. @@ -187,10 +187,7 @@ impl UpdateCollectionPluginBuilder { log_wrapper: self.log_wrapper, }; let args = UpdateCollectionPluginInstructionArgs { - update_plugin_args: self - .update_plugin_args - .clone() - .expect("update_plugin_args is not set"), + plugin: self.plugin.clone().expect("plugin is not set"), }; accounts.instruction_with_remaining_accounts(args, &self.__remaining_accounts) @@ -367,7 +364,7 @@ impl<'a, 'b> UpdateCollectionPluginCpiBuilder<'a, 'b> { payer: None, system_program: None, log_wrapper: None, - update_plugin_args: None, + plugin: None, __remaining_accounts: Vec::new(), }); Self { instruction } @@ -420,8 +417,8 @@ impl<'a, 'b> UpdateCollectionPluginCpiBuilder<'a, 'b> { self } #[inline(always)] - pub fn update_plugin_args(&mut self, update_plugin_args: UpdatePluginArgs) -> &mut Self { - self.instruction.update_plugin_args = Some(update_plugin_args); + pub fn plugin(&mut self, plugin: Plugin) -> &mut Self { + self.instruction.plugin = Some(plugin); self } /// Add an additional account to the instruction. @@ -466,11 +463,7 @@ impl<'a, 'b> UpdateCollectionPluginCpiBuilder<'a, 'b> { signers_seeds: &[&[&[u8]]], ) -> solana_program::entrypoint::ProgramResult { let args = UpdateCollectionPluginInstructionArgs { - update_plugin_args: self - .instruction - .update_plugin_args - .clone() - .expect("update_plugin_args is not set"), + plugin: self.instruction.plugin.clone().expect("plugin is not set"), }; let instruction = UpdateCollectionPluginCpi { __program: self.instruction.__program, @@ -503,7 +496,7 @@ struct UpdateCollectionPluginCpiBuilderInstruction<'a, 'b> { payer: Option<&'b solana_program::account_info::AccountInfo<'a>>, system_program: Option<&'b solana_program::account_info::AccountInfo<'a>>, log_wrapper: Option<&'b solana_program::account_info::AccountInfo<'a>>, - update_plugin_args: Option, + plugin: Option, /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`. __remaining_accounts: Vec<( &'b solana_program::account_info::AccountInfo<'a>, diff --git a/clients/rust/src/generated/instructions/update_plugin.rs b/clients/rust/src/generated/instructions/update_plugin.rs index ab7c591c..b58d5470 100644 --- a/clients/rust/src/generated/instructions/update_plugin.rs +++ b/clients/rust/src/generated/instructions/update_plugin.rs @@ -5,7 +5,7 @@ //! [https://github.com/metaplex-foundation/kinobi] //! -use crate::generated::types::UpdatePluginArgs; +use crate::generated::types::Plugin; use borsh::BorshDeserialize; use borsh::BorshSerialize; @@ -106,7 +106,7 @@ impl UpdatePluginInstructionData { #[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct UpdatePluginInstructionArgs { - pub update_plugin_args: UpdatePluginArgs, + pub plugin: Plugin, } /// Instruction builder. @@ -118,7 +118,7 @@ pub struct UpdatePluginBuilder { payer: Option, system_program: Option, log_wrapper: Option, - update_plugin_args: Option, + plugin: Option, __remaining_accounts: Vec, } @@ -170,8 +170,8 @@ impl UpdatePluginBuilder { self } #[inline(always)] - pub fn update_plugin_args(&mut self, update_plugin_args: UpdatePluginArgs) -> &mut Self { - self.update_plugin_args = Some(update_plugin_args); + pub fn plugin(&mut self, plugin: Plugin) -> &mut Self { + self.plugin = Some(plugin); self } /// Add an aditional account to the instruction. @@ -205,10 +205,7 @@ impl UpdatePluginBuilder { log_wrapper: self.log_wrapper, }; let args = UpdatePluginInstructionArgs { - update_plugin_args: self - .update_plugin_args - .clone() - .expect("update_plugin_args is not set"), + plugin: self.plugin.clone().expect("plugin is not set"), }; accounts.instruction_with_remaining_accounts(args, &self.__remaining_accounts) @@ -403,7 +400,7 @@ impl<'a, 'b> UpdatePluginCpiBuilder<'a, 'b> { payer: None, system_program: None, log_wrapper: None, - update_plugin_args: None, + plugin: None, __remaining_accounts: Vec::new(), }); Self { instruction } @@ -463,8 +460,8 @@ impl<'a, 'b> UpdatePluginCpiBuilder<'a, 'b> { self } #[inline(always)] - pub fn update_plugin_args(&mut self, update_plugin_args: UpdatePluginArgs) -> &mut Self { - self.instruction.update_plugin_args = Some(update_plugin_args); + pub fn plugin(&mut self, plugin: Plugin) -> &mut Self { + self.instruction.plugin = Some(plugin); self } /// Add an additional account to the instruction. @@ -509,11 +506,7 @@ impl<'a, 'b> UpdatePluginCpiBuilder<'a, 'b> { signers_seeds: &[&[&[u8]]], ) -> solana_program::entrypoint::ProgramResult { let args = UpdatePluginInstructionArgs { - update_plugin_args: self - .instruction - .update_plugin_args - .clone() - .expect("update_plugin_args is not set"), + plugin: self.instruction.plugin.clone().expect("plugin is not set"), }; let instruction = UpdatePluginCpi { __program: self.instruction.__program, @@ -549,7 +542,7 @@ struct UpdatePluginCpiBuilderInstruction<'a, 'b> { payer: Option<&'b solana_program::account_info::AccountInfo<'a>>, system_program: Option<&'b solana_program::account_info::AccountInfo<'a>>, log_wrapper: Option<&'b solana_program::account_info::AccountInfo<'a>>, - update_plugin_args: Option, + plugin: Option, /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`. __remaining_accounts: Vec<( &'b solana_program::account_info::AccountInfo<'a>, diff --git a/clients/rust/src/generated/types/add_plugin_args.rs b/clients/rust/src/generated/types/add_plugin_args.rs deleted file mode 100644 index 67b2d484..00000000 --- a/clients/rust/src/generated/types/add_plugin_args.rs +++ /dev/null @@ -1,16 +0,0 @@ -//! This code was AUTOGENERATED using the kinobi library. -//! Please DO NOT EDIT THIS FILE, instead use visitors -//! to add features, then rerun kinobi to update it. -//! -//! [https://github.com/metaplex-foundation/kinobi] -//! - -use crate::generated::types::Plugin; -use borsh::BorshDeserialize; -use borsh::BorshSerialize; - -#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)] -#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] -pub struct AddPluginArgs { - pub plugin: Plugin, -} diff --git a/clients/rust/src/generated/types/add_plugin_authority_args.rs b/clients/rust/src/generated/types/add_plugin_authority_args.rs deleted file mode 100644 index c6083fa1..00000000 --- a/clients/rust/src/generated/types/add_plugin_authority_args.rs +++ /dev/null @@ -1,18 +0,0 @@ -//! This code was AUTOGENERATED using the kinobi library. -//! Please DO NOT EDIT THIS FILE, instead use visitors -//! to add features, then rerun kinobi to update it. -//! -//! [https://github.com/metaplex-foundation/kinobi] -//! - -use crate::generated::types::Authority; -use crate::generated::types::PluginType; -use borsh::BorshDeserialize; -use borsh::BorshSerialize; - -#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)] -#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] -pub struct AddPluginAuthorityArgs { - pub plugin_type: PluginType, - pub new_authority: Authority, -} diff --git a/clients/rust/src/generated/types/mod.rs b/clients/rust/src/generated/types/mod.rs index 01a50836..b76d7f39 100644 --- a/clients/rust/src/generated/types/mod.rs +++ b/clients/rust/src/generated/types/mod.rs @@ -5,8 +5,6 @@ //! [https://github.com/metaplex-foundation/kinobi] //! -pub(crate) mod add_plugin_args; -pub(crate) mod add_plugin_authority_args; pub(crate) mod authority; pub(crate) mod burn; pub(crate) mod compression_proof; @@ -21,18 +19,12 @@ pub(crate) mod key; pub(crate) mod plugin; pub(crate) mod plugin_type; pub(crate) mod registry_record; -pub(crate) mod remove_plugin_args; -pub(crate) mod remove_plugin_authority_args; pub(crate) mod royalties; pub(crate) mod rule_set; pub(crate) mod transfer; -pub(crate) mod update_args; pub(crate) mod update_authority; pub(crate) mod update_delegate; -pub(crate) mod update_plugin_args; -pub use self::add_plugin_args::*; -pub use self::add_plugin_authority_args::*; pub use self::authority::*; pub use self::burn::*; pub use self::compression_proof::*; @@ -47,12 +39,8 @@ pub use self::key::*; pub use self::plugin::*; pub use self::plugin_type::*; pub use self::registry_record::*; -pub use self::remove_plugin_args::*; -pub use self::remove_plugin_authority_args::*; pub use self::royalties::*; pub use self::rule_set::*; pub use self::transfer::*; -pub use self::update_args::*; pub use self::update_authority::*; pub use self::update_delegate::*; -pub use self::update_plugin_args::*; diff --git a/clients/rust/src/generated/types/remove_plugin_args.rs b/clients/rust/src/generated/types/remove_plugin_args.rs deleted file mode 100644 index 96841855..00000000 --- a/clients/rust/src/generated/types/remove_plugin_args.rs +++ /dev/null @@ -1,16 +0,0 @@ -//! This code was AUTOGENERATED using the kinobi library. -//! Please DO NOT EDIT THIS FILE, instead use visitors -//! to add features, then rerun kinobi to update it. -//! -//! [https://github.com/metaplex-foundation/kinobi] -//! - -use crate::generated::types::PluginType; -use borsh::BorshDeserialize; -use borsh::BorshSerialize; - -#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)] -#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] -pub struct RemovePluginArgs { - pub plugin_type: PluginType, -} diff --git a/clients/rust/src/generated/types/remove_plugin_authority_args.rs b/clients/rust/src/generated/types/remove_plugin_authority_args.rs deleted file mode 100644 index 4405b013..00000000 --- a/clients/rust/src/generated/types/remove_plugin_authority_args.rs +++ /dev/null @@ -1,18 +0,0 @@ -//! This code was AUTOGENERATED using the kinobi library. -//! Please DO NOT EDIT THIS FILE, instead use visitors -//! to add features, then rerun kinobi to update it. -//! -//! [https://github.com/metaplex-foundation/kinobi] -//! - -use crate::generated::types::Authority; -use crate::generated::types::PluginType; -use borsh::BorshDeserialize; -use borsh::BorshSerialize; - -#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)] -#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] -pub struct RemovePluginAuthorityArgs { - pub plugin_type: PluginType, - pub authority_to_remove: Authority, -} diff --git a/clients/rust/src/generated/types/update_args.rs b/clients/rust/src/generated/types/update_args.rs deleted file mode 100644 index ddee26c3..00000000 --- a/clients/rust/src/generated/types/update_args.rs +++ /dev/null @@ -1,16 +0,0 @@ -//! This code was AUTOGENERATED using the kinobi library. -//! Please DO NOT EDIT THIS FILE, instead use visitors -//! to add features, then rerun kinobi to update it. -//! -//! [https://github.com/metaplex-foundation/kinobi] -//! - -use borsh::BorshDeserialize; -use borsh::BorshSerialize; - -#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)] -#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] -pub struct UpdateArgs { - pub new_name: Option, - pub new_uri: Option, -} diff --git a/clients/rust/src/generated/types/update_plugin_args.rs b/clients/rust/src/generated/types/update_plugin_args.rs deleted file mode 100644 index 3094ab26..00000000 --- a/clients/rust/src/generated/types/update_plugin_args.rs +++ /dev/null @@ -1,16 +0,0 @@ -//! This code was AUTOGENERATED using the kinobi library. -//! Please DO NOT EDIT THIS FILE, instead use visitors -//! to add features, then rerun kinobi to update it. -//! -//! [https://github.com/metaplex-foundation/kinobi] -//! - -use crate::generated::types::Plugin; -use borsh::BorshDeserialize; -use borsh::BorshSerialize; - -#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)] -#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] -pub struct UpdatePluginArgs { - pub plugin: Plugin, -} diff --git a/configs/kinobi.cjs b/configs/kinobi.cjs index 23897103..255129de 100755 --- a/configs/kinobi.cjs +++ b/configs/kinobi.cjs @@ -59,6 +59,7 @@ const key = (name) => ({ field: "key", value: k.vEnum("Key", name) }); kinobi.update( new k.SetAccountDiscriminatorFromFieldVisitor({ asset: key("Asset"), + collection: key("Collection"), // myPdaAccount: key("MyPdaAccount"), }) ); diff --git a/idls/mpl_core.json b/idls/mpl_core.json index aff2ff87..369952b9 100644 --- a/idls/mpl_core.json +++ b/idls/mpl_core.json @@ -263,9 +263,9 @@ ], "args": [ { - "name": "addPluginArgs", + "name": "addCollectionPluginArgs", "type": { - "defined": "AddPluginArgs" + "defined": "AddCollectionPluginArgs" } } ], @@ -390,9 +390,9 @@ ], "args": [ { - "name": "removePluginArgs", + "name": "removeCollectionPluginArgs", "type": { - "defined": "RemovePluginArgs" + "defined": "RemoveCollectionPluginArgs" } } ], @@ -517,9 +517,9 @@ ], "args": [ { - "name": "updatePluginArgs", + "name": "updateCollectionPluginArgs", "type": { - "defined": "UpdatePluginArgs" + "defined": "UpdateCollectionPluginArgs" } } ], @@ -644,9 +644,9 @@ ], "args": [ { - "name": "addPluginAuthorityArgs", + "name": "addCollectionPluginAuthorityArgs", "type": { - "defined": "AddPluginAuthorityArgs" + "defined": "AddCollectionPluginAuthorityArgs" } } ], @@ -771,9 +771,9 @@ ], "args": [ { - "name": "removePluginAuthorityArgs", + "name": "removeCollectionPluginAuthorityArgs", "type": { - "defined": "RemovePluginAuthorityArgs" + "defined": "RemoveCollectionPluginAuthorityArgs" } } ], @@ -880,7 +880,14 @@ ] } ], - "args": [], + "args": [ + { + "name": "burnCollectionArgs", + "type": { + "defined": "BurnCollectionArgs" + } + } + ], "discriminant": { "type": "u8", "value": 13 @@ -1079,9 +1086,9 @@ ], "args": [ { - "name": "updateArgs", + "name": "updateCollectionArgs", "type": { - "defined": "UpdateArgs" + "defined": "UpdateCollectionArgs" } } ], @@ -1518,6 +1525,20 @@ ] } }, + { + "name": "AddCollectionPluginArgs", + "type": { + "kind": "struct", + "fields": [ + { + "name": "plugin", + "type": { + "defined": "Plugin" + } + } + ] + } + }, { "name": "AddPluginAuthorityArgs", "type": { @@ -1538,6 +1559,26 @@ ] } }, + { + "name": "AddCollectionPluginAuthorityArgs", + "type": { + "kind": "struct", + "fields": [ + { + "name": "pluginType", + "type": { + "defined": "PluginType" + } + }, + { + "name": "newAuthority", + "type": { + "defined": "Authority" + } + } + ] + } + }, { "name": "BurnArgs", "type": { @@ -1554,6 +1595,22 @@ ] } }, + { + "name": "BurnCollectionArgs", + "type": { + "kind": "struct", + "fields": [ + { + "name": "compressionProof", + "type": { + "option": { + "defined": "CompressionProof" + } + } + } + ] + } + }, { "name": "CompressArgs", "type": { @@ -1643,6 +1700,20 @@ ] } }, + { + "name": "RemoveCollectionPluginArgs", + "type": { + "kind": "struct", + "fields": [ + { + "name": "pluginType", + "type": { + "defined": "PluginType" + } + } + ] + } + }, { "name": "RemovePluginAuthorityArgs", "type": { @@ -1663,6 +1734,26 @@ ] } }, + { + "name": "RemoveCollectionPluginAuthorityArgs", + "type": { + "kind": "struct", + "fields": [ + { + "name": "pluginType", + "type": { + "defined": "PluginType" + } + }, + { + "name": "authorityToRemove", + "type": { + "defined": "Authority" + } + } + ] + } + }, { "name": "TransferArgs", "type": { @@ -1699,6 +1790,26 @@ ] } }, + { + "name": "UpdateCollectionArgs", + "type": { + "kind": "struct", + "fields": [ + { + "name": "newName", + "type": { + "option": "string" + } + }, + { + "name": "newUri", + "type": { + "option": "string" + } + } + ] + } + }, { "name": "UpdatePluginArgs", "type": { @@ -1713,6 +1824,20 @@ ] } }, + { + "name": "UpdateCollectionPluginArgs", + "type": { + "kind": "struct", + "fields": [ + { + "name": "plugin", + "type": { + "defined": "Plugin" + } + } + ] + } + }, { "name": "CompressionProof", "type": { diff --git a/programs/mpl-core/src/instruction.rs b/programs/mpl-core/src/instruction.rs index 7a02b60b..970fc335 100644 --- a/programs/mpl-core/src/instruction.rs +++ b/programs/mpl-core/src/instruction.rs @@ -3,15 +3,17 @@ use borsh::{BorshDeserialize, BorshSerialize}; use shank::{ShankContext, ShankInstruction}; use crate::processor::{ - AddPluginArgs, AddPluginAuthorityArgs, BurnArgs, CompressArgs, CreateArgs, - CreateCollectionArgs, DecompressArgs, RemovePluginArgs, RemovePluginAuthorityArgs, - TransferArgs, UpdateArgs, UpdatePluginArgs, + AddCollectionPluginArgs, AddCollectionPluginAuthorityArgs, AddPluginArgs, + AddPluginAuthorityArgs, BurnArgs, BurnCollectionArgs, CompressArgs, CreateArgs, + CreateCollectionArgs, DecompressArgs, RemoveCollectionPluginArgs, + RemoveCollectionPluginAuthorityArgs, RemovePluginArgs, RemovePluginAuthorityArgs, TransferArgs, + UpdateArgs, UpdateCollectionArgs, UpdateCollectionPluginArgs, UpdatePluginArgs, }; /// Instructions supported by the mpl-core program. #[derive(BorshDeserialize, BorshSerialize, Clone, Debug, ShankContext, ShankInstruction)] #[rustfmt::skip] -pub enum MplAssetInstruction { +pub(crate) enum MplAssetInstruction { /// Create a new mpl-core Asset. /// This function creates the initial Asset, with or without plugins. #[account(0, writable, signer, name="asset", desc = "The address of the new asset")] @@ -48,7 +50,7 @@ pub enum MplAssetInstruction { #[account(2, optional, writable, signer, name="payer", desc = "The account paying for the storage fees")] #[account(3, name="system_program", desc = "The system program")] #[account(4, optional, name="log_wrapper", desc = "The SPL Noop Program")] - AddCollectionPlugin(AddPluginArgs), + AddCollectionPlugin(AddCollectionPluginArgs), /// Remove a plugin from an mpl-core. #[account(0, writable, name="asset", desc = "The address of the asset")] @@ -65,7 +67,7 @@ pub enum MplAssetInstruction { #[account(2, optional, writable, signer, name="payer", desc = "The account paying for the storage fees")] #[account(3, name="system_program", desc = "The system program")] #[account(4, optional, name="log_wrapper", desc = "The SPL Noop Program")] - RemoveCollectionPlugin(RemovePluginArgs), + RemoveCollectionPlugin(RemoveCollectionPluginArgs), /// Update a plugin of an mpl-core. #[account(0, writable, name="asset", desc = "The address of the asset")] @@ -82,7 +84,7 @@ pub enum MplAssetInstruction { #[account(2, optional, writable, signer, name="payer", desc = "The account paying for the storage fees")] #[account(3, name="system_program", desc = "The system program")] #[account(4, optional, name="log_wrapper", desc = "The SPL Noop Program")] - UpdateCollectionPlugin(UpdatePluginArgs), + UpdateCollectionPlugin(UpdateCollectionPluginArgs), /// Add an authority to an mpl-core plugin. #[account(0, writable, name="asset", desc = "The address of the asset")] @@ -99,7 +101,7 @@ pub enum MplAssetInstruction { #[account(2, optional, writable, signer, name="payer", desc = "The account paying for the storage fees")] #[account(3, name="system_program", desc = "The system program")] #[account(4, optional, name="log_wrapper", desc = "The SPL Noop Program")] - AddCollectionPluginAuthority(AddPluginAuthorityArgs), + AddCollectionPluginAuthority(AddCollectionPluginAuthorityArgs), /// Remove an authority from an mpl-core plugin. #[account(0, writable, name="asset", desc = "The address of the asset")] @@ -116,7 +118,7 @@ pub enum MplAssetInstruction { #[account(2, optional, writable, signer, name="payer", desc = "The account paying for the storage fees")] #[account(3, name="system_program", desc = "The system program")] #[account(4, optional, name="log_wrapper", desc = "The SPL Noop Program")] - RemoveCollectionPluginAuthority(RemovePluginAuthorityArgs), + RemoveCollectionPluginAuthority(RemoveCollectionPluginAuthorityArgs), /// Burn an mpl-core. #[account(0, writable, name="asset", desc = "The address of the asset")] @@ -131,7 +133,7 @@ pub enum MplAssetInstruction { #[account(1, signer, name="authority", desc = "The owner or delegate of the asset")] #[account(2, optional, writable, signer, name="payer", desc = "The account paying for the storage fees")] #[account(3, optional, name="log_wrapper", desc = "The SPL Noop Program")] - BurnCollection, + BurnCollection(BurnCollectionArgs), // Transfer an asset. /// Transfer an asset by changing its owner. @@ -159,7 +161,7 @@ pub enum MplAssetInstruction { #[account(3, optional, name="new_update_authority", desc = "The new update authority of the asset")] #[account(4, name="system_program", desc = "The system program")] #[account(5, optional, name="log_wrapper", desc = "The SPL Noop Program")] - UpdateCollection(UpdateArgs), + UpdateCollection(UpdateCollectionArgs), /// Create a new mpl-core. /// This function creates the initial mpl-core diff --git a/programs/mpl-core/src/plugins/burn.rs b/programs/mpl-core/src/plugins/burn.rs index 4389b81e..24b9ed7f 100644 --- a/programs/mpl-core/src/plugins/burn.rs +++ b/programs/mpl-core/src/plugins/burn.rs @@ -2,7 +2,7 @@ use borsh::{BorshDeserialize, BorshSerialize}; use solana_program::{account_info::AccountInfo, program_error::ProgramError}; use crate::{ - processor::{CompressArgs, CreateArgs, DecompressArgs, TransferArgs, UpdateArgs}, + processor::{CompressArgs, CreateArgs, DecompressArgs, TransferArgs}, state::{Authority, DataBlob}, }; @@ -50,7 +50,6 @@ impl PluginValidation for Burn { fn validate_update( &self, _authority: &AccountInfo, - _args: &UpdateArgs, _authorities: &[Authority], ) -> Result { Ok(ValidationResult::Pass) diff --git a/programs/mpl-core/src/plugins/freeze.rs b/programs/mpl-core/src/plugins/freeze.rs index 05b0c0cf..779a85e7 100644 --- a/programs/mpl-core/src/plugins/freeze.rs +++ b/programs/mpl-core/src/plugins/freeze.rs @@ -1,10 +1,8 @@ use borsh::{BorshDeserialize, BorshSerialize}; -use solana_program::account_info::AccountInfo; +use solana_program::{account_info::AccountInfo, program_error::ProgramError}; use crate::{ - processor::{ - CompressArgs, CreateArgs, DecompressArgs, TransferArgs, UpdateArgs, UpdatePluginArgs, - }, + processor::{CompressArgs, CreateArgs, DecompressArgs, TransferArgs}, state::{Asset, Authority, DataBlob}, }; @@ -48,16 +46,15 @@ impl PluginValidation for Freeze { _authority: &AccountInfo, _args: &CreateArgs, _authorities: &[Authority], - ) -> Result { + ) -> Result { Ok(ValidationResult::Pass) } fn validate_update( &self, _authority: &AccountInfo, - _args: &UpdateArgs, _authorities: &[Authority], - ) -> Result { + ) -> Result { Ok(ValidationResult::Pass) } @@ -65,9 +62,8 @@ impl PluginValidation for Freeze { &self, asset: &Asset, authority: &AccountInfo, - _args: &UpdatePluginArgs, authorities: &[Authority], - ) -> Result { + ) -> Result { // The owner can't update the freeze status. if (authority.key != &asset.owner && (authority.key == &asset.update_authority.key() @@ -90,7 +86,7 @@ impl PluginValidation for Freeze { &self, _authority: &AccountInfo, _authorities: &[Authority], - ) -> Result { + ) -> Result { if self.frozen { Ok(ValidationResult::Rejected) } else { @@ -104,7 +100,7 @@ impl PluginValidation for Freeze { _new_owner: &AccountInfo, _args: &TransferArgs, _authorities: &[Authority], - ) -> Result { + ) -> Result { if self.frozen { Ok(ValidationResult::Rejected) } else { @@ -117,7 +113,7 @@ impl PluginValidation for Freeze { _authority: &AccountInfo, _args: &CompressArgs, _authorities: &[Authority], - ) -> Result { + ) -> Result { Ok(ValidationResult::Pass) } @@ -126,7 +122,7 @@ impl PluginValidation for Freeze { _authority: &AccountInfo, _args: &DecompressArgs, _authorities: &[Authority], - ) -> Result { + ) -> Result { Ok(ValidationResult::Pass) } @@ -135,7 +131,7 @@ impl PluginValidation for Freeze { _authority: &AccountInfo, _args: &crate::processor::AddPluginAuthorityArgs, _authorities: &[Authority], - ) -> Result { + ) -> Result { Ok(ValidationResult::Pass) } } diff --git a/programs/mpl-core/src/plugins/lifecycle.rs b/programs/mpl-core/src/plugins/lifecycle.rs index 8adeb7b2..a170c34b 100644 --- a/programs/mpl-core/src/plugins/lifecycle.rs +++ b/programs/mpl-core/src/plugins/lifecycle.rs @@ -4,7 +4,7 @@ use crate::{ error::MplCoreError, processor::{ AddPluginAuthorityArgs, CompressArgs, CreateArgs, DecompressArgs, - RemovePluginAuthorityArgs, TransferArgs, UpdateArgs, UpdatePluginArgs, + RemovePluginAuthorityArgs, TransferArgs, }, state::{Asset, Authority}, }; @@ -79,7 +79,7 @@ impl PluginType { impl Plugin { /// Route the validation of the create action to the appropriate plugin. - pub fn validate_create( + pub(crate) fn validate_create( &self, authority: &AccountInfo, args: &CreateArgs, @@ -98,53 +98,49 @@ impl Plugin { } /// Route the validation of the update action to the appropriate plugin. - pub fn validate_update( + pub(crate) fn validate_update( &self, authority: &AccountInfo, - args: &UpdateArgs, authorities: &[Authority], ) -> Result { match self { Plugin::Reserved => Err(MplCoreError::InvalidPlugin.into()), - Plugin::Royalties(royalties) => royalties.validate_update(authority, args, authorities), - Plugin::Freeze(freeze) => freeze.validate_update(authority, args, authorities), - Plugin::Burn(burn) => burn.validate_update(authority, args, authorities), - Plugin::Transfer(transfer) => transfer.validate_update(authority, args, authorities), + Plugin::Royalties(royalties) => royalties.validate_update(authority, authorities), + Plugin::Freeze(freeze) => freeze.validate_update(authority, authorities), + Plugin::Burn(burn) => burn.validate_update(authority, authorities), + Plugin::Transfer(transfer) => transfer.validate_update(authority, authorities), Plugin::UpdateDelegate(update_delegate) => { - update_delegate.validate_update(authority, args, authorities) + update_delegate.validate_update(authority, authorities) } } } /// Route the validation of the update_plugin action to the appropriate plugin. /// There is no check for updating a plugin because the plugin itself MUST validate the change. - pub fn validate_update_plugin( + pub(crate) fn validate_update_plugin( &self, asset: &Asset, authority: &AccountInfo, - args: &UpdatePluginArgs, authorities: &[Authority], ) -> Result { match self { Plugin::Reserved => Err(MplCoreError::InvalidPlugin.into()), Plugin::Royalties(royalties) => { - royalties.validate_update_plugin(asset, authority, args, authorities) + royalties.validate_update_plugin(asset, authority, authorities) } - Plugin::Freeze(freeze) => { - freeze.validate_update_plugin(asset, authority, args, authorities) - } - Plugin::Burn(burn) => burn.validate_update_plugin(asset, authority, args, authorities), + Plugin::Freeze(freeze) => freeze.validate_update_plugin(asset, authority, authorities), + Plugin::Burn(burn) => burn.validate_update_plugin(asset, authority, authorities), Plugin::Transfer(transfer) => { - transfer.validate_update_plugin(asset, authority, args, authorities) + transfer.validate_update_plugin(asset, authority, authorities) } Plugin::UpdateDelegate(update_delegate) => { - update_delegate.validate_update_plugin(asset, authority, args, authorities) + update_delegate.validate_update_plugin(asset, authority, authorities) } } } /// Route the validation of the burn action to the appropriate plugin. - pub fn validate_burn( + pub(crate) fn validate_burn( &self, authority: &AccountInfo, authorities: &[Authority], @@ -162,7 +158,7 @@ impl Plugin { } /// Route the validation of the transfer action to the appropriate plugin. - pub fn validate_transfer( + pub(crate) fn validate_transfer( &self, authority: &AccountInfo, new_owner: &AccountInfo, @@ -188,7 +184,7 @@ impl Plugin { } /// Route the validation of the compress action to the appropriate plugin. - pub fn validate_compress( + pub(crate) fn validate_compress( &self, authority: &AccountInfo, args: &CompressArgs, @@ -209,7 +205,7 @@ impl Plugin { } /// Route the validation of the decompress action to the appropriate plugin. - pub fn validate_decompress( + pub(crate) fn validate_decompress( &self, authority: &AccountInfo, args: &DecompressArgs, @@ -233,7 +229,7 @@ impl Plugin { /// Route the validation of the add_authority action to the appropriate plugin. /// There is no check for adding to a plugin because the plugin itself MUST validate the change. - pub fn validate_add_authority( + pub(crate) fn validate_add_authority( &self, authority: &AccountInfo, args: &AddPluginAuthorityArgs, @@ -257,7 +253,7 @@ impl Plugin { /// Route the validation of the add_authority action to the appropriate plugin. /// There is no check for adding to a plugin because the plugin itself MUST validate the change. - pub fn validate_remove_authority( + pub(crate) fn validate_remove_authority( &self, authority: &AccountInfo, args: &RemovePluginAuthorityArgs, @@ -295,7 +291,7 @@ pub enum ValidationResult { } /// Plugin validation trait which is implemented by each plugin. -pub trait PluginValidation { +pub(crate) trait PluginValidation { /// Validate the create lifecycle action. fn validate_create( &self, @@ -308,7 +304,6 @@ pub trait PluginValidation { fn validate_update( &self, authority: &AccountInfo, - args: &UpdateArgs, authorities: &[Authority], ) -> Result; @@ -317,7 +312,6 @@ pub trait PluginValidation { &self, asset: &Asset, authority: &AccountInfo, - _args: &UpdatePluginArgs, authorities: &[Authority], ) -> Result { if (authority.key == &asset.owner && authorities.contains(&Authority::Owner)) @@ -371,7 +365,7 @@ pub trait PluginValidation { _authority: &AccountInfo, _args: &crate::processor::AddPluginAuthorityArgs, _authorities: &[Authority], - ) -> Result { + ) -> Result { Ok(ValidationResult::Pass) } @@ -381,7 +375,7 @@ pub trait PluginValidation { _authority: &AccountInfo, _args: &crate::processor::RemovePluginAuthorityArgs, _authorities: &[Authority], - ) -> Result { + ) -> Result { Ok(ValidationResult::Pass) } } diff --git a/programs/mpl-core/src/plugins/royalties.rs b/programs/mpl-core/src/plugins/royalties.rs index 3855dfbe..4de49c43 100644 --- a/programs/mpl-core/src/plugins/royalties.rs +++ b/programs/mpl-core/src/plugins/royalties.rs @@ -1,8 +1,8 @@ use borsh::{BorshDeserialize, BorshSerialize}; -use solana_program::{account_info::AccountInfo, pubkey::Pubkey}; +use solana_program::{account_info::AccountInfo, program_error::ProgramError, pubkey::Pubkey}; use crate::{ - processor::{CompressArgs, CreateArgs, DecompressArgs, TransferArgs, UpdateArgs}, + processor::{CompressArgs, CreateArgs, DecompressArgs, TransferArgs}, state::Authority, }; @@ -43,16 +43,15 @@ impl PluginValidation for Royalties { _authority: &AccountInfo, _args: &CreateArgs, _authorities: &[Authority], - ) -> Result { + ) -> Result { Ok(ValidationResult::Pass) } fn validate_update( &self, _authority: &AccountInfo, - _args: &UpdateArgs, _authorities: &[Authority], - ) -> Result { + ) -> Result { Ok(ValidationResult::Pass) } @@ -60,7 +59,7 @@ impl PluginValidation for Royalties { &self, _authority: &AccountInfo, _authorities: &[Authority], - ) -> Result { + ) -> Result { Ok(ValidationResult::Pass) } @@ -70,7 +69,7 @@ impl PluginValidation for Royalties { new_owner: &AccountInfo, _args: &TransferArgs, _authorities: &[Authority], - ) -> Result { + ) -> Result { match &self.rule_set { RuleSet::None => Ok(ValidationResult::Pass), RuleSet::ProgramAllowList(allow_list) => { @@ -95,7 +94,7 @@ impl PluginValidation for Royalties { _authority: &AccountInfo, _args: &CompressArgs, _authorities: &[Authority], - ) -> Result { + ) -> Result { Ok(ValidationResult::Pass) } @@ -104,7 +103,7 @@ impl PluginValidation for Royalties { _authority: &AccountInfo, _args: &DecompressArgs, _authorities: &[Authority], - ) -> Result { + ) -> Result { Ok(ValidationResult::Pass) } } diff --git a/programs/mpl-core/src/plugins/transfer.rs b/programs/mpl-core/src/plugins/transfer.rs index 7cdf40ac..63d415f8 100644 --- a/programs/mpl-core/src/plugins/transfer.rs +++ b/programs/mpl-core/src/plugins/transfer.rs @@ -1,8 +1,8 @@ use borsh::{BorshDeserialize, BorshSerialize}; -use solana_program::account_info::AccountInfo; +use solana_program::{account_info::AccountInfo, program_error::ProgramError}; use crate::{ - processor::{CompressArgs, CreateArgs, DecompressArgs, TransferArgs, UpdateArgs}, + processor::{CompressArgs, CreateArgs, DecompressArgs, TransferArgs}, state::{Authority, DataBlob}, }; @@ -43,16 +43,15 @@ impl PluginValidation for Transfer { _authority: &AccountInfo, _args: &CreateArgs, _authorities: &[Authority], - ) -> Result { + ) -> Result { Ok(ValidationResult::Pass) } fn validate_update( &self, _authority: &AccountInfo, - _args: &UpdateArgs, _authorities: &[Authority], - ) -> Result { + ) -> Result { Ok(ValidationResult::Pass) } @@ -60,7 +59,7 @@ impl PluginValidation for Transfer { &self, authority: &AccountInfo, authorities: &[Authority], - ) -> Result { + ) -> Result { if authorities.contains(&Authority::Pubkey { address: *authority.key, }) { @@ -76,7 +75,7 @@ impl PluginValidation for Transfer { _new_owner: &AccountInfo, _args: &TransferArgs, authorities: &[Authority], - ) -> Result { + ) -> Result { if authorities.contains(&Authority::Pubkey { address: *authority.key, }) { @@ -91,7 +90,7 @@ impl PluginValidation for Transfer { _authority: &AccountInfo, _args: &CompressArgs, _authorities: &[Authority], - ) -> Result { + ) -> Result { Ok(ValidationResult::Pass) } @@ -100,7 +99,7 @@ impl PluginValidation for Transfer { _authority: &AccountInfo, _args: &DecompressArgs, _authorities: &[Authority], - ) -> Result { + ) -> Result { Ok(ValidationResult::Pass) } } diff --git a/programs/mpl-core/src/plugins/update_delegate.rs b/programs/mpl-core/src/plugins/update_delegate.rs index 4a7c8371..23b34bd3 100644 --- a/programs/mpl-core/src/plugins/update_delegate.rs +++ b/programs/mpl-core/src/plugins/update_delegate.rs @@ -2,7 +2,7 @@ use borsh::{BorshDeserialize, BorshSerialize}; use solana_program::{account_info::AccountInfo, program_error::ProgramError}; use crate::{ - processor::{CompressArgs, CreateArgs, DecompressArgs, TransferArgs, UpdateArgs}, + processor::{CompressArgs, CreateArgs, DecompressArgs, TransferArgs}, state::{Authority, DataBlob}, }; @@ -50,7 +50,6 @@ impl PluginValidation for UpdateDelegate { fn validate_update( &self, _authority: &AccountInfo, - _args: &UpdateArgs, _authorities: &[Authority], ) -> Result { Ok(ValidationResult::Pass) diff --git a/programs/mpl-core/src/processor/add_plugin.rs b/programs/mpl-core/src/processor/add_plugin.rs index 5d35df80..b5d711cb 100644 --- a/programs/mpl-core/src/processor/add_plugin.rs +++ b/programs/mpl-core/src/processor/add_plugin.rs @@ -9,7 +9,7 @@ use crate::{ #[repr(C)] #[derive(BorshSerialize, BorshDeserialize, PartialEq, Eq, Debug, Clone)] -pub struct AddPluginArgs { +pub(crate) struct AddPluginArgs { plugin: Plugin, } @@ -44,9 +44,15 @@ pub(crate) fn add_plugin<'a>( process_add_plugin() } +#[repr(C)] +#[derive(BorshSerialize, BorshDeserialize, PartialEq, Eq, Debug, Clone)] +pub(crate) struct AddCollectionPluginArgs { + plugin: Plugin, +} + pub(crate) fn add_collection_plugin<'a>( accounts: &'a [AccountInfo<'a>], - args: AddPluginArgs, + args: AddCollectionPluginArgs, ) -> ProgramResult { let ctx = AddCollectionPluginAccounts::context(accounts)?; diff --git a/programs/mpl-core/src/processor/add_plugin_authority.rs b/programs/mpl-core/src/processor/add_plugin_authority.rs index 53696c53..dafe2c69 100644 --- a/programs/mpl-core/src/processor/add_plugin_authority.rs +++ b/programs/mpl-core/src/processor/add_plugin_authority.rs @@ -12,7 +12,7 @@ use crate::{ #[repr(C)] #[derive(BorshSerialize, BorshDeserialize, PartialEq, Eq, Debug, Clone)] -pub struct AddPluginAuthorityArgs { +pub(crate) struct AddPluginAuthorityArgs { pub plugin_type: PluginType, pub new_authority: Authority, } @@ -43,9 +43,16 @@ pub(crate) fn add_plugin_authority<'a>( ) } +#[repr(C)] +#[derive(BorshSerialize, BorshDeserialize, PartialEq, Eq, Debug, Clone)] +pub(crate) struct AddCollectionPluginAuthorityArgs { + pub plugin_type: PluginType, + pub new_authority: Authority, +} + pub(crate) fn add_collection_plugin_authority<'a>( accounts: &'a [AccountInfo<'a>], - args: AddPluginAuthorityArgs, + args: AddCollectionPluginAuthorityArgs, ) -> ProgramResult { let ctx = AddCollectionPluginAuthorityAccounts::context(accounts)?; diff --git a/programs/mpl-core/src/processor/burn.rs b/programs/mpl-core/src/processor/burn.rs index fddf45dd..f61e0157 100644 --- a/programs/mpl-core/src/processor/burn.rs +++ b/programs/mpl-core/src/processor/burn.rs @@ -11,7 +11,7 @@ use crate::{ }; #[derive(BorshSerialize, BorshDeserialize, PartialEq, Eq, Debug, Clone)] -pub struct BurnArgs { +pub(crate) struct BurnArgs { compression_proof: Option, } @@ -86,7 +86,15 @@ pub(crate) fn burn<'a>(accounts: &'a [AccountInfo<'a>], args: BurnArgs) -> Progr process_burn(ctx.accounts.asset, ctx.accounts.authority) } -pub(crate) fn burn_collection<'a>(accounts: &'a [AccountInfo<'a>]) -> ProgramResult { +#[derive(BorshSerialize, BorshDeserialize, PartialEq, Eq, Debug, Clone)] +pub(crate) struct BurnCollectionArgs { + compression_proof: Option, +} + +pub(crate) fn burn_collection<'a>( + accounts: &'a [AccountInfo<'a>], + _args: BurnCollectionArgs, +) -> ProgramResult { // Accounts. let ctx = BurnCollectionAccounts::context(accounts)?; diff --git a/programs/mpl-core/src/processor/mod.rs b/programs/mpl-core/src/processor/mod.rs index 20f37f3d..5f6e6ca0 100644 --- a/programs/mpl-core/src/processor/mod.rs +++ b/programs/mpl-core/src/processor/mod.rs @@ -101,9 +101,9 @@ pub fn process_instruction<'a>( msg!("Instruction: Burn"); burn(accounts, args) } - MplAssetInstruction::BurnCollection => { + MplAssetInstruction::BurnCollection(args) => { msg!("Instruction: BurnCollection"); - burn_collection(accounts) + burn_collection(accounts, args) } MplAssetInstruction::Transfer(args) => { msg!("Instruction: Transfer"); @@ -126,8 +126,6 @@ pub fn process_instruction<'a>( decompress(accounts, args) } - MplAssetInstruction::Collect => { - collect(accounts) - } + MplAssetInstruction::Collect => collect(accounts), } } diff --git a/programs/mpl-core/src/processor/remove_plugin.rs b/programs/mpl-core/src/processor/remove_plugin.rs index ca7e4cb7..008726ec 100644 --- a/programs/mpl-core/src/processor/remove_plugin.rs +++ b/programs/mpl-core/src/processor/remove_plugin.rs @@ -12,7 +12,7 @@ use crate::{ #[repr(C)] #[derive(BorshSerialize, BorshDeserialize, PartialEq, Eq, Debug, Clone)] -pub struct RemovePluginArgs { +pub(crate) struct RemovePluginArgs { plugin_type: PluginType, } @@ -79,9 +79,15 @@ pub(crate) fn remove_plugin<'a>( process_remove_plugin() } +#[repr(C)] +#[derive(BorshSerialize, BorshDeserialize, PartialEq, Eq, Debug, Clone)] +pub(crate) struct RemoveCollectionPluginArgs { + plugin_type: PluginType, +} + pub(crate) fn remove_collection_plugin<'a>( accounts: &'a [AccountInfo<'a>], - args: RemovePluginArgs, + args: RemoveCollectionPluginArgs, ) -> ProgramResult { let ctx = RemoveCollectionPluginAccounts::context(accounts)?; diff --git a/programs/mpl-core/src/processor/remove_plugin_authority.rs b/programs/mpl-core/src/processor/remove_plugin_authority.rs index 1d59550b..a251f05d 100644 --- a/programs/mpl-core/src/processor/remove_plugin_authority.rs +++ b/programs/mpl-core/src/processor/remove_plugin_authority.rs @@ -14,7 +14,7 @@ use crate::{ #[repr(C)] #[derive(BorshSerialize, BorshDeserialize, PartialEq, Eq, Debug, Clone)] -pub struct RemovePluginAuthorityArgs { +pub(crate) struct RemovePluginAuthorityArgs { pub plugin_type: PluginType, pub authority_to_remove: Authority, } @@ -75,9 +75,16 @@ pub(crate) fn remove_plugin_authority<'a>( ) } +#[repr(C)] +#[derive(BorshSerialize, BorshDeserialize, PartialEq, Eq, Debug, Clone)] +pub(crate) struct RemoveCollectionPluginAuthorityArgs { + pub plugin_type: PluginType, + pub authority_to_remove: Authority, +} + pub(crate) fn remove_collection_plugin_authority<'a>( accounts: &'a [AccountInfo<'a>], - args: RemovePluginAuthorityArgs, + args: RemoveCollectionPluginAuthorityArgs, ) -> ProgramResult { let ctx = RemoveCollectionPluginAuthorityAccounts::context(accounts)?; diff --git a/programs/mpl-core/src/processor/update.rs b/programs/mpl-core/src/processor/update.rs index e3e8d10d..86e35f51 100644 --- a/programs/mpl-core/src/processor/update.rs +++ b/programs/mpl-core/src/processor/update.rs @@ -14,7 +14,7 @@ use crate::{ #[repr(C)] #[derive(BorshSerialize, BorshDeserialize, PartialEq, Eq, Debug, Clone)] -pub struct UpdateArgs { +pub(crate) struct UpdateArgs { pub new_name: Option, pub new_uri: Option, } @@ -53,11 +53,8 @@ pub(crate) fn update<'a>(accounts: &'a [AccountInfo<'a>], args: UpdateArgs) -> P record.plugin_type.check_transfer(), CheckResult::CanApprove | CheckResult::CanReject ) { - let result = Plugin::load(ctx.accounts.asset, record.offset)?.validate_update( - ctx.accounts.authority, - &args, - &record.authorities, - )?; + let result = Plugin::load(ctx.accounts.asset, record.offset)? + .validate_update(ctx.accounts.authority, &record.authorities)?; if result == ValidationResult::Rejected { return Err(MplCoreError::InvalidAuthority.into()); } else if result == ValidationResult::Approved { @@ -156,9 +153,16 @@ pub(crate) fn update<'a>(accounts: &'a [AccountInfo<'a>], args: UpdateArgs) -> P Ok(()) } +#[repr(C)] +#[derive(BorshSerialize, BorshDeserialize, PartialEq, Eq, Debug, Clone)] +pub(crate) struct UpdateCollectionArgs { + pub new_name: Option, + pub new_uri: Option, +} + pub(crate) fn update_collection<'a>( accounts: &'a [AccountInfo<'a>], - args: UpdateArgs, + args: UpdateCollectionArgs, ) -> ProgramResult { // Accounts. let ctx = UpdateCollectionAccounts::context(accounts)?; @@ -195,7 +199,7 @@ pub(crate) fn update_collection<'a>( CheckResult::CanApprove | CheckResult::CanReject ) { let result = Plugin::load(ctx.accounts.collection, record.offset)? - .validate_update(ctx.accounts.authority, &args, &record.authorities)?; + .validate_update(ctx.accounts.authority, &record.authorities)?; if result == ValidationResult::Rejected { return Err(MplCoreError::InvalidAuthority.into()); } else if result == ValidationResult::Approved { diff --git a/programs/mpl-core/src/processor/update_plugin.rs b/programs/mpl-core/src/processor/update_plugin.rs index 0420f862..877765e4 100644 --- a/programs/mpl-core/src/processor/update_plugin.rs +++ b/programs/mpl-core/src/processor/update_plugin.rs @@ -11,7 +11,7 @@ use crate::{ #[repr(C)] #[derive(BorshSerialize, BorshDeserialize, PartialEq, Eq, Debug, Clone)] -pub struct UpdatePluginArgs { +pub(crate) struct UpdatePluginArgs { pub plugin: Plugin, } @@ -41,7 +41,6 @@ pub(crate) fn update_plugin<'a>( let result = Plugin::load(ctx.accounts.asset, registry_record.offset)?.validate_update_plugin( &asset, ctx.accounts.authority, - &args, ®istry_record.authorities, )?; if result == ValidationResult::Rejected { @@ -57,9 +56,15 @@ pub(crate) fn update_plugin<'a>( process_update_plugin() } +#[repr(C)] +#[derive(BorshSerialize, BorshDeserialize, PartialEq, Eq, Debug, Clone)] +pub(crate) struct UpdateCollectionPluginArgs { + pub plugin: Plugin, +} + pub(crate) fn update_collection_plugin<'a>( accounts: &'a [AccountInfo<'a>], - args: UpdatePluginArgs, + args: UpdateCollectionPluginArgs, ) -> ProgramResult { // Accounts. let ctx = UpdateCollectionPluginAccounts::context(accounts)?; @@ -81,12 +86,7 @@ pub(crate) fn update_collection_plugin<'a>( .ok_or(MplCoreError::PluginNotFound)?; let result = Plugin::load(ctx.accounts.collection, registry_record.offset)? - .validate_update_plugin( - &asset, - ctx.accounts.authority, - &args, - ®istry_record.authorities, - )?; + .validate_update_plugin(&asset, ctx.accounts.authority, ®istry_record.authorities)?; if result == ValidationResult::Rejected { return Err(MplCoreError::InvalidAuthority.into()); } else if result == ValidationResult::Approved {