From 406c32331933f1e1ce19c93d9f195f10ecaa248c Mon Sep 17 00:00:00 2001 From: Nhan Phan Date: Mon, 25 Mar 2024 08:28:52 -0700 Subject: [PATCH] update kinobi generated program names --- README.md | 4 +-- clients/js/src/createCandyGuard.ts | 2 +- clients/js/src/createCandyMachineV2.ts | 2 +- clients/js/src/createLutForCandyMachine.ts | 4 +-- .../generated/accounts/allocationTracker.ts | 4 +-- .../src/generated/accounts/allowListProof.ts | 4 +-- .../js/src/generated/accounts/candyGuard.ts | 4 +-- .../js/src/generated/accounts/candyMachine.ts | 2 +- .../js/src/generated/accounts/freezeEscrow.ts | 4 +-- .../js/src/generated/accounts/mintCounter.ts | 4 +-- .../src/generated/accounts/nftMintCounter.ts | 4 +-- clients/js/src/generated/errors/index.ts | 4 +-- ...andyGuardAsset.ts => mplCoreCandyGuard.ts} | 4 +-- ...oreAsset.ts => mplCoreCandyMachineCore.ts} | 4 +-- .../generated/instructions/addConfigLines.ts | 2 +- .../instructions/createCandyGuard.ts | 2 +- .../instructions/deleteCandyGuard.ts | 2 +- .../instructions/deleteCandyMachine.ts | 2 +- .../instructions/initializeCandyMachineV2.ts | 2 +- .../instructions/mintAssetFromCandyMachine.ts | 2 +- .../js/src/generated/instructions/mintV2.ts | 2 +- .../js/src/generated/instructions/route.ts | 2 +- .../instructions/setCandyGuardAuthority.ts | 2 +- .../instructions/setCandyMachineAuthority.ts | 2 +- .../generated/instructions/setCollectionV2.ts | 2 +- .../instructions/setMintAuthority.ts | 2 +- .../js/src/generated/instructions/unwrap.ts | 2 +- .../instructions/updateCandyGuard.ts | 2 +- .../instructions/updateCandyMachine.ts | 2 +- clients/js/src/generated/instructions/wrap.ts | 2 +- clients/js/src/generated/programs/index.ts | 4 +-- ...andyGuardAsset.ts => mplCoreCandyGuard.ts} | 26 +++++++-------- ...oreAsset.ts => mplCoreCandyMachineCore.ts} | 26 +++++++-------- clients/js/src/hooked/candyGuard.ts | 4 +-- .../js/src/hooked/candyMachineAuthority.ts | 2 +- clients/js/src/mintV2.ts | 2 +- clients/js/src/plugin.ts | 8 ++--- clients/js/src/route.ts | 2 +- clients/js/src/updateCandyGuard.ts | 2 +- .../js/test/createLutForCandyMachine.test.ts | 4 +-- .../js/test/initializeCandyMachineV2.test.ts | 2 +- configs/kinobi.cjs | 32 +++++++++---------- 42 files changed, 98 insertions(+), 98 deletions(-) rename clients/js/src/generated/errors/{mplCandyGuardAsset.ts => mplCoreCandyGuard.ts} (99%) rename clients/js/src/generated/errors/{mplCandyMachineCoreAsset.ts => mplCoreCandyMachineCore.ts} (99%) rename clients/js/src/generated/programs/{mplCandyGuardAsset.ts => mplCoreCandyGuard.ts} (57%) rename clients/js/src/generated/programs/{mplCandyMachineCoreAsset.ts => mplCoreCandyMachineCore.ts} (54%) diff --git a/README.md b/README.md index b3621b1..42618f8 100644 --- a/README.md +++ b/README.md @@ -10,8 +10,8 @@ You can [**read more about Candy Machines in the official Metaplex documentation This project contains the following programs: -- [Candy Machine Core Asset](./programs/candy-machine-core/README.md) `CMACYFENjoBMHzapRXyo1JZkVS6EtaDDzkjMrmQLvr4J` -- [Candy Guard Asset](./programs/candy-guard/README.md) `CMAGAKJ67e9hRZgfC5SFTbZH8MgEmtqazKXjmkaJjWTJ` +- [Core Candy Machine Core](./programs/candy-machine-core/README.md) `CMACYFENjoBMHzapRXyo1JZkVS6EtaDDzkjMrmQLvr4J` +- [Core Candy Guard](./programs/candy-guard/README.md) `CMAGAKJ67e9hRZgfC5SFTbZH8MgEmtqazKXjmkaJjWTJ` You will need a Rust version compatible with BPF to compile the program, currently we recommend using Rust 1.68.0. diff --git a/clients/js/src/createCandyGuard.ts b/clients/js/src/createCandyGuard.ts index a533da8..8368b56 100644 --- a/clients/js/src/createCandyGuard.ts +++ b/clients/js/src/createCandyGuard.ts @@ -40,7 +40,7 @@ export function createCandyGuard( > ): TransactionBuilder { const { guards, groups, ...rest } = input; - const program = context.programs.get('mplCandyGuardAsset'); + const program = context.programs.get('mplCoreCandyGuard'); const serializer = getCandyGuardDataSerializer< DA extends undefined ? DefaultGuardSetArgs : DA, any diff --git a/clients/js/src/createCandyMachineV2.ts b/clients/js/src/createCandyMachineV2.ts index 4c6695a..57fff51 100644 --- a/clients/js/src/createCandyMachineV2.ts +++ b/clients/js/src/createCandyMachineV2.ts @@ -32,7 +32,7 @@ export const createCandyMachineV2 = async ( newAccount: input.candyMachine, lamports, space, - programId: context.programs.get('mplCandyMachineCoreAsset').publicKey, + programId: context.programs.get('mplCoreCandyMachineCore').publicKey, }) ) .add( diff --git a/clients/js/src/createLutForCandyMachine.ts b/clients/js/src/createLutForCandyMachine.ts index dfe59a5..74a1aa7 100644 --- a/clients/js/src/createLutForCandyMachine.ts +++ b/clients/js/src/createLutForCandyMachine.ts @@ -18,7 +18,7 @@ import { import { getMplCoreProgramId } from '@metaplex-foundation/mpl-core'; import { fetchCandyMachine, - getMplCandyMachineCoreAssetProgramId, + getMplCoreCandyMachineCoreProgramId, } from './generated'; import { findCandyMachineAuthorityPda } from './hooked'; @@ -63,6 +63,6 @@ export const getLutAddressesForCandyMachine = async ( getSplTokenProgramId(context), getSplAssociatedTokenProgramId(context), getMplTokenMetadataProgramId(context), - getMplCandyMachineCoreAssetProgramId(context), + getMplCoreCandyMachineCoreProgramId(context), ]); }; diff --git a/clients/js/src/generated/accounts/allocationTracker.ts b/clients/js/src/generated/accounts/allocationTracker.ts index c686a1f..2d4a670 100644 --- a/clients/js/src/generated/accounts/allocationTracker.ts +++ b/clients/js/src/generated/accounts/allocationTracker.ts @@ -118,7 +118,7 @@ export function getAllocationTrackerGpaBuilder( context: Pick ) { const programId = context.programs.getPublicKey( - 'mplCandyGuardAsset', + 'mplCoreCandyGuard', 'CMAGAKJ67e9hRZgfC5SFTbZH8MgEmtqazKXjmkaJjWTJ' ); return gpaBuilder(context, programId) @@ -145,7 +145,7 @@ export function findAllocationTrackerPda( } ): Pda { const programId = context.programs.getPublicKey( - 'mplCandyGuardAsset', + 'mplCoreCandyGuard', 'CMAGAKJ67e9hRZgfC5SFTbZH8MgEmtqazKXjmkaJjWTJ' ); return context.eddsa.findPda(programId, [ diff --git a/clients/js/src/generated/accounts/allowListProof.ts b/clients/js/src/generated/accounts/allowListProof.ts index 89eeb34..7c56caa 100644 --- a/clients/js/src/generated/accounts/allowListProof.ts +++ b/clients/js/src/generated/accounts/allowListProof.ts @@ -113,7 +113,7 @@ export function getAllowListProofGpaBuilder( context: Pick ) { const programId = context.programs.getPublicKey( - 'mplCandyGuardAsset', + 'mplCoreCandyGuard', 'CMAGAKJ67e9hRZgfC5SFTbZH8MgEmtqazKXjmkaJjWTJ' ); return gpaBuilder(context, programId) @@ -142,7 +142,7 @@ export function findAllowListProofPda( } ): Pda { const programId = context.programs.getPublicKey( - 'mplCandyGuardAsset', + 'mplCoreCandyGuard', 'CMAGAKJ67e9hRZgfC5SFTbZH8MgEmtqazKXjmkaJjWTJ' ); return context.eddsa.findPda(programId, [ diff --git a/clients/js/src/generated/accounts/candyGuard.ts b/clients/js/src/generated/accounts/candyGuard.ts index b7a4f08..e77837b 100644 --- a/clients/js/src/generated/accounts/candyGuard.ts +++ b/clients/js/src/generated/accounts/candyGuard.ts @@ -127,7 +127,7 @@ export function getCandyGuardGpaBuilder( context: Pick ) { const programId = context.programs.getPublicKey( - 'mplCandyGuardAsset', + 'mplCoreCandyGuard', 'CMAGAKJ67e9hRZgfC5SFTbZH8MgEmtqazKXjmkaJjWTJ' ); return gpaBuilder(context, programId) @@ -158,7 +158,7 @@ export function findCandyGuardPda( } ): Pda { const programId = context.programs.getPublicKey( - 'mplCandyGuardAsset', + 'mplCoreCandyGuard', 'CMAGAKJ67e9hRZgfC5SFTbZH8MgEmtqazKXjmkaJjWTJ' ); return context.eddsa.findPda(programId, [ diff --git a/clients/js/src/generated/accounts/candyMachine.ts b/clients/js/src/generated/accounts/candyMachine.ts index fad76dd..823cf76 100644 --- a/clients/js/src/generated/accounts/candyMachine.ts +++ b/clients/js/src/generated/accounts/candyMachine.ts @@ -101,7 +101,7 @@ export function getCandyMachineGpaBuilder( context: Pick ) { const programId = context.programs.getPublicKey( - 'mplCandyMachineCoreAsset', + 'mplCoreCandyMachineCore', 'CMACYFENjoBMHzapRXyo1JZkVS6EtaDDzkjMrmQLvr4J' ); return gpaBuilder(context, programId) diff --git a/clients/js/src/generated/accounts/freezeEscrow.ts b/clients/js/src/generated/accounts/freezeEscrow.ts index e2d9920..2553ec5 100644 --- a/clients/js/src/generated/accounts/freezeEscrow.ts +++ b/clients/js/src/generated/accounts/freezeEscrow.ts @@ -183,7 +183,7 @@ export function getFreezeEscrowGpaBuilder( context: Pick ) { const programId = context.programs.getPublicKey( - 'mplCandyGuardAsset', + 'mplCoreCandyGuard', 'CMAGAKJ67e9hRZgfC5SFTbZH8MgEmtqazKXjmkaJjWTJ' ); return gpaBuilder(context, programId) @@ -224,7 +224,7 @@ export function findFreezeEscrowPda( } ): Pda { const programId = context.programs.getPublicKey( - 'mplCandyGuardAsset', + 'mplCoreCandyGuard', 'CMAGAKJ67e9hRZgfC5SFTbZH8MgEmtqazKXjmkaJjWTJ' ); return context.eddsa.findPda(programId, [ diff --git a/clients/js/src/generated/accounts/mintCounter.ts b/clients/js/src/generated/accounts/mintCounter.ts index 0049937..74ceb86 100644 --- a/clients/js/src/generated/accounts/mintCounter.ts +++ b/clients/js/src/generated/accounts/mintCounter.ts @@ -106,7 +106,7 @@ export function getMintCounterGpaBuilder( context: Pick ) { const programId = context.programs.getPublicKey( - 'mplCandyGuardAsset', + 'mplCoreCandyGuard', 'CMAGAKJ67e9hRZgfC5SFTbZH8MgEmtqazKXjmkaJjWTJ' ); return gpaBuilder(context, programId) @@ -133,7 +133,7 @@ export function findMintCounterPda( } ): Pda { const programId = context.programs.getPublicKey( - 'mplCandyGuardAsset', + 'mplCoreCandyGuard', 'CMAGAKJ67e9hRZgfC5SFTbZH8MgEmtqazKXjmkaJjWTJ' ); return context.eddsa.findPda(programId, [ diff --git a/clients/js/src/generated/accounts/nftMintCounter.ts b/clients/js/src/generated/accounts/nftMintCounter.ts index e9eb952..01a7284 100644 --- a/clients/js/src/generated/accounts/nftMintCounter.ts +++ b/clients/js/src/generated/accounts/nftMintCounter.ts @@ -113,7 +113,7 @@ export function getNftMintCounterGpaBuilder( context: Pick ) { const programId = context.programs.getPublicKey( - 'mplCandyGuardAsset', + 'mplCoreCandyGuard', 'CMAGAKJ67e9hRZgfC5SFTbZH8MgEmtqazKXjmkaJjWTJ' ); return gpaBuilder(context, programId) @@ -142,7 +142,7 @@ export function findNftMintCounterPda( } ): Pda { const programId = context.programs.getPublicKey( - 'mplCandyGuardAsset', + 'mplCoreCandyGuard', 'CMAGAKJ67e9hRZgfC5SFTbZH8MgEmtqazKXjmkaJjWTJ' ); return context.eddsa.findPda(programId, [ diff --git a/clients/js/src/generated/errors/index.ts b/clients/js/src/generated/errors/index.ts index adaa53e..50c3c51 100644 --- a/clients/js/src/generated/errors/index.ts +++ b/clients/js/src/generated/errors/index.ts @@ -6,5 +6,5 @@ * @see https://github.com/metaplex-foundation/kinobi */ -export * from './mplCandyGuardAsset'; -export * from './mplCandyMachineCoreAsset'; +export * from './mplCoreCandyGuard'; +export * from './mplCoreCandyMachineCore'; diff --git a/clients/js/src/generated/errors/mplCandyGuardAsset.ts b/clients/js/src/generated/errors/mplCoreCandyGuard.ts similarity index 99% rename from clients/js/src/generated/errors/mplCandyGuardAsset.ts rename to clients/js/src/generated/errors/mplCoreCandyGuard.ts index 217ac65..eb6e127 100644 --- a/clients/js/src/generated/errors/mplCandyGuardAsset.ts +++ b/clients/js/src/generated/errors/mplCoreCandyGuard.ts @@ -735,7 +735,7 @@ nameToErrorMap.set('InvalidAccountVersion', CgInvalidAccountVersionError); * Attempts to resolve a custom program error from the provided error code. * @category Errors */ -export function getMplCandyGuardAssetErrorFromCode( +export function getMplCoreCandyGuardErrorFromCode( code: number, program: Program, cause?: Error @@ -748,7 +748,7 @@ export function getMplCandyGuardAssetErrorFromCode( * Attempts to resolve a custom program error from the provided error name, i.e. 'Unauthorized'. * @category Errors */ -export function getMplCandyGuardAssetErrorFromName( +export function getMplCoreCandyGuardErrorFromName( name: string, program: Program, cause?: Error diff --git a/clients/js/src/generated/errors/mplCandyMachineCoreAsset.ts b/clients/js/src/generated/errors/mplCoreCandyMachineCore.ts similarity index 99% rename from clients/js/src/generated/errors/mplCandyMachineCoreAsset.ts rename to clients/js/src/generated/errors/mplCoreCandyMachineCore.ts index 01e22c3..cb823bf 100644 --- a/clients/js/src/generated/errors/mplCandyMachineCoreAsset.ts +++ b/clients/js/src/generated/errors/mplCoreCandyMachineCore.ts @@ -497,7 +497,7 @@ nameToErrorMap.set('IncorrectPluginAuthority', CmIncorrectPluginAuthorityError); * Attempts to resolve a custom program error from the provided error code. * @category Errors */ -export function getMplCandyMachineCoreAssetErrorFromCode( +export function getMplCoreCandyMachineCoreErrorFromCode( code: number, program: Program, cause?: Error @@ -510,7 +510,7 @@ export function getMplCandyMachineCoreAssetErrorFromCode( * Attempts to resolve a custom program error from the provided error name, i.e. 'Unauthorized'. * @category Errors */ -export function getMplCandyMachineCoreAssetErrorFromName( +export function getMplCoreCandyMachineCoreErrorFromName( name: string, program: Program, cause?: Error diff --git a/clients/js/src/generated/instructions/addConfigLines.ts b/clients/js/src/generated/instructions/addConfigLines.ts index 53b2d70..3699c05 100644 --- a/clients/js/src/generated/instructions/addConfigLines.ts +++ b/clients/js/src/generated/instructions/addConfigLines.ts @@ -86,7 +86,7 @@ export function addConfigLines( ): TransactionBuilder { // Program ID. const programId = context.programs.getPublicKey( - 'mplCandyMachineCoreAsset', + 'mplCoreCandyMachineCore', 'CMACYFENjoBMHzapRXyo1JZkVS6EtaDDzkjMrmQLvr4J' ); diff --git a/clients/js/src/generated/instructions/createCandyGuard.ts b/clients/js/src/generated/instructions/createCandyGuard.ts index aaf40c7..7ef4ea9 100644 --- a/clients/js/src/generated/instructions/createCandyGuard.ts +++ b/clients/js/src/generated/instructions/createCandyGuard.ts @@ -85,7 +85,7 @@ export function createCandyGuard( ): TransactionBuilder { // Program ID. const programId = context.programs.getPublicKey( - 'mplCandyGuardAsset', + 'mplCoreCandyGuard', 'CMAGAKJ67e9hRZgfC5SFTbZH8MgEmtqazKXjmkaJjWTJ' ); diff --git a/clients/js/src/generated/instructions/deleteCandyGuard.ts b/clients/js/src/generated/instructions/deleteCandyGuard.ts index 094ec16..75d919f 100644 --- a/clients/js/src/generated/instructions/deleteCandyGuard.ts +++ b/clients/js/src/generated/instructions/deleteCandyGuard.ts @@ -68,7 +68,7 @@ export function deleteCandyGuard( ): TransactionBuilder { // Program ID. const programId = context.programs.getPublicKey( - 'mplCandyGuardAsset', + 'mplCoreCandyGuard', 'CMAGAKJ67e9hRZgfC5SFTbZH8MgEmtqazKXjmkaJjWTJ' ); diff --git a/clients/js/src/generated/instructions/deleteCandyMachine.ts b/clients/js/src/generated/instructions/deleteCandyMachine.ts index fc08d4d..9ae26a6 100644 --- a/clients/js/src/generated/instructions/deleteCandyMachine.ts +++ b/clients/js/src/generated/instructions/deleteCandyMachine.ts @@ -72,7 +72,7 @@ export function deleteCandyMachine( ): TransactionBuilder { // Program ID. const programId = context.programs.getPublicKey( - 'mplCandyMachineCoreAsset', + 'mplCoreCandyMachineCore', 'CMACYFENjoBMHzapRXyo1JZkVS6EtaDDzkjMrmQLvr4J' ); diff --git a/clients/js/src/generated/instructions/initializeCandyMachineV2.ts b/clients/js/src/generated/instructions/initializeCandyMachineV2.ts index 1ddaa19..9bb79a8 100644 --- a/clients/js/src/generated/instructions/initializeCandyMachineV2.ts +++ b/clients/js/src/generated/instructions/initializeCandyMachineV2.ts @@ -192,7 +192,7 @@ export function initializeCandyMachineV2( ): TransactionBuilder { // Program ID. const programId = context.programs.getPublicKey( - 'mplCandyMachineCoreAsset', + 'mplCoreCandyMachineCore', 'CMACYFENjoBMHzapRXyo1JZkVS6EtaDDzkjMrmQLvr4J' ); diff --git a/clients/js/src/generated/instructions/mintAssetFromCandyMachine.ts b/clients/js/src/generated/instructions/mintAssetFromCandyMachine.ts index cc0d98f..2e38e13 100644 --- a/clients/js/src/generated/instructions/mintAssetFromCandyMachine.ts +++ b/clients/js/src/generated/instructions/mintAssetFromCandyMachine.ts @@ -122,7 +122,7 @@ export function mintAssetFromCandyMachine( ): TransactionBuilder { // Program ID. const programId = context.programs.getPublicKey( - 'mplCandyMachineCoreAsset', + 'mplCoreCandyMachineCore', 'CMACYFENjoBMHzapRXyo1JZkVS6EtaDDzkjMrmQLvr4J' ); diff --git a/clients/js/src/generated/instructions/mintV2.ts b/clients/js/src/generated/instructions/mintV2.ts index a75fbbf..7ab6c8f 100644 --- a/clients/js/src/generated/instructions/mintV2.ts +++ b/clients/js/src/generated/instructions/mintV2.ts @@ -145,7 +145,7 @@ export function mintV2( ): TransactionBuilder { // Program ID. const programId = context.programs.getPublicKey( - 'mplCandyGuardAsset', + 'mplCoreCandyGuard', 'CMAGAKJ67e9hRZgfC5SFTbZH8MgEmtqazKXjmkaJjWTJ' ); diff --git a/clients/js/src/generated/instructions/route.ts b/clients/js/src/generated/instructions/route.ts index bd12775..9725caa 100644 --- a/clients/js/src/generated/instructions/route.ts +++ b/clients/js/src/generated/instructions/route.ts @@ -92,7 +92,7 @@ export function route( ): TransactionBuilder { // Program ID. const programId = context.programs.getPublicKey( - 'mplCandyGuardAsset', + 'mplCoreCandyGuard', 'CMAGAKJ67e9hRZgfC5SFTbZH8MgEmtqazKXjmkaJjWTJ' ); diff --git a/clients/js/src/generated/instructions/setCandyGuardAuthority.ts b/clients/js/src/generated/instructions/setCandyGuardAuthority.ts index 7822c00..65875e4 100644 --- a/clients/js/src/generated/instructions/setCandyGuardAuthority.ts +++ b/clients/js/src/generated/instructions/setCandyGuardAuthority.ts @@ -82,7 +82,7 @@ export function setCandyGuardAuthority( ): TransactionBuilder { // Program ID. const programId = context.programs.getPublicKey( - 'mplCandyGuardAsset', + 'mplCoreCandyGuard', 'CMAGAKJ67e9hRZgfC5SFTbZH8MgEmtqazKXjmkaJjWTJ' ); diff --git a/clients/js/src/generated/instructions/setCandyMachineAuthority.ts b/clients/js/src/generated/instructions/setCandyMachineAuthority.ts index 3e13787..5c49155 100644 --- a/clients/js/src/generated/instructions/setCandyMachineAuthority.ts +++ b/clients/js/src/generated/instructions/setCandyMachineAuthority.ts @@ -84,7 +84,7 @@ export function setCandyMachineAuthority( ): TransactionBuilder { // Program ID. const programId = context.programs.getPublicKey( - 'mplCandyMachineCoreAsset', + 'mplCoreCandyMachineCore', 'CMACYFENjoBMHzapRXyo1JZkVS6EtaDDzkjMrmQLvr4J' ); diff --git a/clients/js/src/generated/instructions/setCollectionV2.ts b/clients/js/src/generated/instructions/setCollectionV2.ts index c210e91..935e3de 100644 --- a/clients/js/src/generated/instructions/setCollectionV2.ts +++ b/clients/js/src/generated/instructions/setCollectionV2.ts @@ -112,7 +112,7 @@ export function setCollectionV2( ): TransactionBuilder { // Program ID. const programId = context.programs.getPublicKey( - 'mplCandyMachineCoreAsset', + 'mplCoreCandyMachineCore', 'CMACYFENjoBMHzapRXyo1JZkVS6EtaDDzkjMrmQLvr4J' ); diff --git a/clients/js/src/generated/instructions/setMintAuthority.ts b/clients/js/src/generated/instructions/setMintAuthority.ts index 2ce55c3..5a0fac5 100644 --- a/clients/js/src/generated/instructions/setMintAuthority.ts +++ b/clients/js/src/generated/instructions/setMintAuthority.ts @@ -72,7 +72,7 @@ export function setMintAuthority( ): TransactionBuilder { // Program ID. const programId = context.programs.getPublicKey( - 'mplCandyMachineCoreAsset', + 'mplCoreCandyMachineCore', 'CMACYFENjoBMHzapRXyo1JZkVS6EtaDDzkjMrmQLvr4J' ); diff --git a/clients/js/src/generated/instructions/unwrap.ts b/clients/js/src/generated/instructions/unwrap.ts index e43ee2e..b33a643 100644 --- a/clients/js/src/generated/instructions/unwrap.ts +++ b/clients/js/src/generated/instructions/unwrap.ts @@ -64,7 +64,7 @@ export function unwrap( ): TransactionBuilder { // Program ID. const programId = context.programs.getPublicKey( - 'mplCandyGuardAsset', + 'mplCoreCandyGuard', 'CMAGAKJ67e9hRZgfC5SFTbZH8MgEmtqazKXjmkaJjWTJ' ); diff --git a/clients/js/src/generated/instructions/updateCandyGuard.ts b/clients/js/src/generated/instructions/updateCandyGuard.ts index cb3b333..0b97dde 100644 --- a/clients/js/src/generated/instructions/updateCandyGuard.ts +++ b/clients/js/src/generated/instructions/updateCandyGuard.ts @@ -82,7 +82,7 @@ export function updateCandyGuard( ): TransactionBuilder { // Program ID. const programId = context.programs.getPublicKey( - 'mplCandyGuardAsset', + 'mplCoreCandyGuard', 'CMAGAKJ67e9hRZgfC5SFTbZH8MgEmtqazKXjmkaJjWTJ' ); diff --git a/clients/js/src/generated/instructions/updateCandyMachine.ts b/clients/js/src/generated/instructions/updateCandyMachine.ts index 2e1266e..fcc3a3e 100644 --- a/clients/js/src/generated/instructions/updateCandyMachine.ts +++ b/clients/js/src/generated/instructions/updateCandyMachine.ts @@ -88,7 +88,7 @@ export function updateCandyMachine( ): TransactionBuilder { // Program ID. const programId = context.programs.getPublicKey( - 'mplCandyMachineCoreAsset', + 'mplCoreCandyMachineCore', 'CMACYFENjoBMHzapRXyo1JZkVS6EtaDDzkjMrmQLvr4J' ); diff --git a/clients/js/src/generated/instructions/wrap.ts b/clients/js/src/generated/instructions/wrap.ts index 00db928..0b432de 100644 --- a/clients/js/src/generated/instructions/wrap.ts +++ b/clients/js/src/generated/instructions/wrap.ts @@ -63,7 +63,7 @@ export function wrap( ): TransactionBuilder { // Program ID. const programId = context.programs.getPublicKey( - 'mplCandyGuardAsset', + 'mplCoreCandyGuard', 'CMAGAKJ67e9hRZgfC5SFTbZH8MgEmtqazKXjmkaJjWTJ' ); diff --git a/clients/js/src/generated/programs/index.ts b/clients/js/src/generated/programs/index.ts index adaa53e..50c3c51 100644 --- a/clients/js/src/generated/programs/index.ts +++ b/clients/js/src/generated/programs/index.ts @@ -6,5 +6,5 @@ * @see https://github.com/metaplex-foundation/kinobi */ -export * from './mplCandyGuardAsset'; -export * from './mplCandyMachineCoreAsset'; +export * from './mplCoreCandyGuard'; +export * from './mplCoreCandyMachineCore'; diff --git a/clients/js/src/generated/programs/mplCandyGuardAsset.ts b/clients/js/src/generated/programs/mplCoreCandyGuard.ts similarity index 57% rename from clients/js/src/generated/programs/mplCandyGuardAsset.ts rename to clients/js/src/generated/programs/mplCoreCandyGuard.ts index 5c809e9..22a85cd 100644 --- a/clients/js/src/generated/programs/mplCandyGuardAsset.ts +++ b/clients/js/src/generated/programs/mplCoreCandyGuard.ts @@ -13,22 +13,22 @@ import { PublicKey, } from '@metaplex-foundation/umi'; import { - getMplCandyGuardAssetErrorFromCode, - getMplCandyGuardAssetErrorFromName, + getMplCoreCandyGuardErrorFromCode, + getMplCoreCandyGuardErrorFromName, } from '../errors'; -export const MPL_CANDY_GUARD_ASSET_PROGRAM_ID = +export const MPL_CORE_CANDY_GUARD_PROGRAM_ID = 'CMAGAKJ67e9hRZgfC5SFTbZH8MgEmtqazKXjmkaJjWTJ' as PublicKey<'CMAGAKJ67e9hRZgfC5SFTbZH8MgEmtqazKXjmkaJjWTJ'>; -export function createMplCandyGuardAssetProgram(): Program { +export function createMplCoreCandyGuardProgram(): Program { return { - name: 'mplCandyGuardAsset', - publicKey: MPL_CANDY_GUARD_ASSET_PROGRAM_ID, + name: 'mplCoreCandyGuard', + publicKey: MPL_CORE_CANDY_GUARD_PROGRAM_ID, getErrorFromCode(code: number, cause?: Error) { - return getMplCandyGuardAssetErrorFromCode(code, this, cause); + return getMplCoreCandyGuardErrorFromCode(code, this, cause); }, getErrorFromName(name: string, cause?: Error) { - return getMplCandyGuardAssetErrorFromName(name, this, cause); + return getMplCoreCandyGuardErrorFromName(name, this, cause); }, isOnCluster() { return true; @@ -36,20 +36,20 @@ export function createMplCandyGuardAssetProgram(): Program { }; } -export function getMplCandyGuardAssetProgram( +export function getMplCoreCandyGuardProgram( context: Pick, clusterFilter?: ClusterFilter ): T { - return context.programs.get('mplCandyGuardAsset', clusterFilter); + return context.programs.get('mplCoreCandyGuard', clusterFilter); } -export function getMplCandyGuardAssetProgramId( +export function getMplCoreCandyGuardProgramId( context: Pick, clusterFilter?: ClusterFilter ): PublicKey { return context.programs.getPublicKey( - 'mplCandyGuardAsset', - MPL_CANDY_GUARD_ASSET_PROGRAM_ID, + 'mplCoreCandyGuard', + MPL_CORE_CANDY_GUARD_PROGRAM_ID, clusterFilter ); } diff --git a/clients/js/src/generated/programs/mplCandyMachineCoreAsset.ts b/clients/js/src/generated/programs/mplCoreCandyMachineCore.ts similarity index 54% rename from clients/js/src/generated/programs/mplCandyMachineCoreAsset.ts rename to clients/js/src/generated/programs/mplCoreCandyMachineCore.ts index 37bb51c..ddfe8de 100644 --- a/clients/js/src/generated/programs/mplCandyMachineCoreAsset.ts +++ b/clients/js/src/generated/programs/mplCoreCandyMachineCore.ts @@ -13,22 +13,22 @@ import { PublicKey, } from '@metaplex-foundation/umi'; import { - getMplCandyMachineCoreAssetErrorFromCode, - getMplCandyMachineCoreAssetErrorFromName, + getMplCoreCandyMachineCoreErrorFromCode, + getMplCoreCandyMachineCoreErrorFromName, } from '../errors'; -export const MPL_CANDY_MACHINE_CORE_ASSET_PROGRAM_ID = +export const MPL_CORE_CANDY_MACHINE_CORE_PROGRAM_ID = 'CMACYFENjoBMHzapRXyo1JZkVS6EtaDDzkjMrmQLvr4J' as PublicKey<'CMACYFENjoBMHzapRXyo1JZkVS6EtaDDzkjMrmQLvr4J'>; -export function createMplCandyMachineCoreAssetProgram(): Program { +export function createMplCoreCandyMachineCoreProgram(): Program { return { - name: 'mplCandyMachineCoreAsset', - publicKey: MPL_CANDY_MACHINE_CORE_ASSET_PROGRAM_ID, + name: 'mplCoreCandyMachineCore', + publicKey: MPL_CORE_CANDY_MACHINE_CORE_PROGRAM_ID, getErrorFromCode(code: number, cause?: Error) { - return getMplCandyMachineCoreAssetErrorFromCode(code, this, cause); + return getMplCoreCandyMachineCoreErrorFromCode(code, this, cause); }, getErrorFromName(name: string, cause?: Error) { - return getMplCandyMachineCoreAssetErrorFromName(name, this, cause); + return getMplCoreCandyMachineCoreErrorFromName(name, this, cause); }, isOnCluster() { return true; @@ -36,20 +36,20 @@ export function createMplCandyMachineCoreAssetProgram(): Program { }; } -export function getMplCandyMachineCoreAssetProgram( +export function getMplCoreCandyMachineCoreProgram( context: Pick, clusterFilter?: ClusterFilter ): T { - return context.programs.get('mplCandyMachineCoreAsset', clusterFilter); + return context.programs.get('mplCoreCandyMachineCore', clusterFilter); } -export function getMplCandyMachineCoreAssetProgramId( +export function getMplCoreCandyMachineCoreProgramId( context: Pick, clusterFilter?: ClusterFilter ): PublicKey { return context.programs.getPublicKey( - 'mplCandyMachineCoreAsset', - MPL_CANDY_MACHINE_CORE_ASSET_PROGRAM_ID, + 'mplCoreCandyMachineCore', + MPL_CORE_CANDY_MACHINE_CORE_PROGRAM_ID, clusterFilter ); } diff --git a/clients/js/src/hooked/candyGuard.ts b/clients/js/src/hooked/candyGuard.ts index fe545a9..7a97491 100644 --- a/clients/js/src/hooked/candyGuard.ts +++ b/clients/js/src/hooked/candyGuard.ts @@ -63,7 +63,7 @@ export function getCandyGuardAccountDataSerializer< }, program?: CandyGuardProgram ): Serializer, CandyGuardAccountData> { - program ??= context.programs.get('mplCandyGuardAsset'); + program ??= context.programs.get('mplCoreCandyGuard'); return mapSerializer( struct( [ @@ -172,7 +172,7 @@ export function getCandyGuardGpaBuilder( program?: CandyGuardProgram ) { const programId = context.programs.getPublicKey( - 'mplCandyGuardAsset', + 'mplCoreCandyGuard', 'CMAGAKJ67e9hRZgfC5SFTbZH8MgEmtqazKXjmkaJjWTJ' ); return gpaBuilder(context, programId) diff --git a/clients/js/src/hooked/candyMachineAuthority.ts b/clients/js/src/hooked/candyMachineAuthority.ts index feaaeaf..7ef5ce5 100644 --- a/clients/js/src/hooked/candyMachineAuthority.ts +++ b/clients/js/src/hooked/candyMachineAuthority.ts @@ -8,7 +8,7 @@ export function findCandyMachineAuthorityPda( candyMachine: PublicKey; } ): Pda { - const programId = context.programs.get('mplCandyMachineCoreAsset').publicKey; + const programId = context.programs.get('mplCoreCandyMachineCore').publicKey; return context.eddsa.findPda(programId, [ string({ size: 'variable' }).serialize('candy_machine'), publicKey().serialize(seeds.candyMachine), diff --git a/clients/js/src/mintV2.ts b/clients/js/src/mintV2.ts index d81af51..5d54cc4 100644 --- a/clients/js/src/mintV2.ts +++ b/clients/js/src/mintV2.ts @@ -46,7 +46,7 @@ export function mintV2( const { mintArgs = {}, group = none(), ...rest } = input; // Parsing mint data. - const program = context.programs.get('mplCandyGuardAsset'); + const program = context.programs.get('mplCoreCandyGuard'); const candyMachine = publicKey(input.candyMachine, false); const mintContext: MintContext = { minter: input.minter ?? context.identity, diff --git a/clients/js/src/plugin.ts b/clients/js/src/plugin.ts index 9d3de13..787b5cb 100644 --- a/clients/js/src/plugin.ts +++ b/clients/js/src/plugin.ts @@ -27,8 +27,8 @@ import { nftMintLimitGuardManifest, } from './defaultGuards'; import { - createMplCandyGuardAssetProgram, - createMplCandyMachineCoreAssetProgram, + createMplCoreCandyGuardProgram, + createMplCoreCandyMachineCoreProgram, } from './generated'; import { CandyGuardProgram, @@ -45,10 +45,10 @@ export const mplCandyMachine = (): UmiPlugin => ({ umi.use(mplTokenMetadata()); // Programs. - umi.programs.add(createMplCandyMachineCoreAssetProgram(), false); + umi.programs.add(createMplCoreCandyMachineCoreProgram(), false); umi.programs.add( { - ...createMplCandyGuardAssetProgram(), + ...createMplCoreCandyGuardProgram(), availableGuards: defaultCandyGuardNames, } as CandyGuardProgram, false diff --git a/clients/js/src/route.ts b/clients/js/src/route.ts index 2f99098..2df3a21 100644 --- a/clients/js/src/route.ts +++ b/clients/js/src/route.ts @@ -56,7 +56,7 @@ export function route< > ): TransactionBuilder { const { routeArgs = {}, group = none(), ...rest } = input; - const program = context.programs.get('mplCandyGuardAsset'); + const program = context.programs.get('mplCoreCandyGuard'); const candyMachine = publicKey(input.candyMachine, false); const routeContext: RouteContext = { payer: input.payer ?? context.payer, diff --git a/clients/js/src/updateCandyGuard.ts b/clients/js/src/updateCandyGuard.ts index 2996314..bc9fd76 100644 --- a/clients/js/src/updateCandyGuard.ts +++ b/clients/js/src/updateCandyGuard.ts @@ -35,7 +35,7 @@ export function updateCandyGuard( > ): TransactionBuilder { const { guards, groups, ...rest } = input; - const program = context.programs.get('mplCandyGuardAsset'); + const program = context.programs.get('mplCoreCandyGuard'); const serializer = getCandyGuardDataSerializer< DA extends undefined ? DefaultGuardSetArgs : DA, any diff --git a/clients/js/test/createLutForCandyMachine.test.ts b/clients/js/test/createLutForCandyMachine.test.ts index 9efd433..265d71e 100644 --- a/clients/js/test/createLutForCandyMachine.test.ts +++ b/clients/js/test/createLutForCandyMachine.test.ts @@ -15,7 +15,7 @@ import { createLutForCandyMachine, findCandyGuardPda, findCandyMachineAuthorityPda, - getMplCandyMachineCoreAssetProgramId, + getMplCoreCandyMachineCoreProgramId, mintV2, setMintAuthority, } from '../src'; @@ -75,7 +75,7 @@ test('it can create a LUT for a candy machine v2', async (t) => { getSplTokenProgramId(umi), getSplAssociatedTokenProgramId(umi), getMplTokenMetadataProgramId(umi), - getMplCandyMachineCoreAssetProgramId(umi), + getMplCoreCandyMachineCoreProgramId(umi), ].sort() ); diff --git a/clients/js/test/initializeCandyMachineV2.test.ts b/clients/js/test/initializeCandyMachineV2.test.ts index 20a41ae..0560149 100644 --- a/clients/js/test/initializeCandyMachineV2.test.ts +++ b/clients/js/test/initializeCandyMachineV2.test.ts @@ -31,7 +31,7 @@ test('it can initialize a new candy machine account', async (t) => { createAccountWithRent(umi, { newAccount: candyMachine, space: 5000, - programId: umi.programs.get('mplCandyMachineCoreAsset').publicKey, + programId: umi.programs.get('mplCoreCandyMachineCore').publicKey, }) ) .sendAndConfirm(umi); diff --git a/configs/kinobi.cjs b/configs/kinobi.cjs index ab5c36b..e1817b4 100755 --- a/configs/kinobi.cjs +++ b/configs/kinobi.cjs @@ -14,8 +14,8 @@ const kinobi = k.createFromIdls([ // Update programs. kinobi.update( new k.UpdateProgramsVisitor({ - candyGuard: { name: "mplCandyGuardAsset", prefix: "Cg" }, - candyMachineCore: { name: "mplCandyMachineCoreAsset", prefix: "Cm" }, + candyGuard: { name: "mplCoreCandyGuard", prefix: "Cg" }, + candyMachineCore: { name: "mplCoreCandyMachineCore", prefix: "Cm" }, }) ); @@ -341,7 +341,7 @@ kinobi.update( // Update instructions. kinobi.update( new k.UpdateInstructionsVisitor({ - "mplCandyGuardAsset.initialize": { + "mplCoreCandyGuard.initialize": { name: "createCandyGuard", internal: true, accounts: { @@ -350,10 +350,10 @@ kinobi.update( }, }, }, - "mplCandyMachineCoreAsset.initializeV2": { + "mplCoreCandyMachineCore.initializeV2": { name: "initializeCandyMachineV2", }, - "mplCandyMachineCoreAsset.mintAsset": { + "mplCoreCandyMachineCore.mintAsset": { name: "mintAssetFromCandyMachine", accounts: { asset: { isSigner: "either" }, @@ -367,17 +367,17 @@ kinobi.update( }, }, }, - "mplCandyGuardAsset.wrap": { + "mplCoreCandyGuard.wrap": { accounts: { candyMachineProgram: { defaultsTo: defaultsToCandyMachineAssetProgram() }, } }, - "mplCandyGuardAsset.unwrap": { + "mplCoreCandyGuard.unwrap": { accounts: { candyMachineProgram: { defaultsTo: defaultsToCandyMachineAssetProgram() }, } }, - "mplCandyGuardAsset.mintV2": { + "mplCoreCandyGuard.mintV2": { internal: true, args: { label: { name: "group" }, @@ -391,7 +391,7 @@ kinobi.update( candyMachineProgram: { defaultsTo: defaultsToCandyMachineAssetProgram() }, }, }, - "mplCandyGuardAsset.route": { + "mplCoreCandyGuard.route": { internal: true, args: { label: { name: "group" }, @@ -401,7 +401,7 @@ kinobi.update( candyMachineProgram: { defaultsTo: defaultsToCandyMachineAssetProgram() }, }, }, - "mplCandyMachineCoreAsset.setCollectionV2": { + "mplCoreCandyMachineCore.setCollectionV2": { accounts: { newCollectionDelegateRecord: { defaultsTo: defaultsToMetadataDelegateRecordPda( @@ -413,12 +413,12 @@ kinobi.update( }, }, }, - "mplCandyMachineCoreAsset.SetAuthority": { name: "SetCandyMachineAuthority" }, - "mplCandyGuardAsset.SetAuthority": { name: "SetCandyGuardAuthority" }, - "mplCandyMachineCoreAsset.update": { name: "updateCandyMachine" }, - "mplCandyGuardAsset.update": { name: "updateCandyGuard", internal: true }, - "mplCandyMachineCoreAsset.withdraw": { name: "deleteCandyMachine" }, - "mplCandyGuardAsset.withdraw": { name: "deleteCandyGuard" }, + "mplCoreCandyMachineCore.SetAuthority": { name: "SetCandyMachineAuthority" }, + "mplCoreCandyGuard.SetAuthority": { name: "SetCandyGuardAuthority" }, + "mplCoreCandyMachineCore.update": { name: "updateCandyMachine" }, + "mplCoreCandyGuard.update": { name: "updateCandyGuard", internal: true }, + "mplCoreCandyMachineCore.withdraw": { name: "deleteCandyMachine" }, + "mplCoreCandyGuard.withdraw": { name: "deleteCandyGuard" }, }) );