diff --git a/.changeset/thick-mails-love.md b/.changeset/thick-mails-love.md new file mode 100644 index 000000000..cbf02b7cf --- /dev/null +++ b/.changeset/thick-mails-love.md @@ -0,0 +1,5 @@ +--- +"@metaplex-foundation/kinobi": minor +--- + +Export program error codes as constants on experimental renderer diff --git a/src/renderers/js-experimental/ImportMap.ts b/src/renderers/js-experimental/ImportMap.ts index cbc3b0cd9..edce82411 100644 --- a/src/renderers/js-experimental/ImportMap.ts +++ b/src/renderers/js-experimental/ImportMap.ts @@ -11,7 +11,6 @@ const DEFAULT_MODULE_MAP: Record = { solanaCodecsStrings: '@solana/codecs', solanaCodecsDataStructures: '@solana/codecs', solanaInstructions: '@solana/instructions', - solanaPrograms: '@solana/programs', solanaOptions: '@solana/codecs', solanaSigners: '@solana/signers', diff --git a/src/renderers/js-experimental/fragments/program.njk b/src/renderers/js-experimental/fragments/program.njk index ae3c093ab..536914afa 100644 --- a/src/renderers/js-experimental/fragments/program.njk +++ b/src/renderers/js-experimental/fragments/program.njk @@ -1,22 +1,3 @@ {% import "templates/macros.njk" as macros %} export const {{ programAddressConstant }} = '{{ program.publicKey }}' as Address<'{{ program.publicKey }}'>; - -{{ macros.docblock(program.docs) }} -export type {{ programType }} = Program<'{{ program.publicKey }}'> -{%- if program.errors.length > 0 %} - & ProgramWithErrors<{{ programErrorCode }}, {{ programErrorClass }}> -{% endif %} -; - -export function {{ programCreateFunction }}(): {{ programType }}{ - return { - name: '{{ program.name | camelCase }}', - address: {{ programAddressConstant }}, - {% if program.errors.length > 0 %} - getErrorFromCode(code: {{ programErrorCode }}, cause?: Error) { - return {{ programGetErrorFromCodeFunction }}(code, cause); - }, - {% endif %} - }; -} diff --git a/src/renderers/js-experimental/fragments/program.ts b/src/renderers/js-experimental/fragments/program.ts index 520121ae5..6215eab3e 100644 --- a/src/renderers/js-experimental/fragments/program.ts +++ b/src/renderers/js-experimental/fragments/program.ts @@ -8,32 +8,9 @@ export function getProgramFragment( } ): Fragment { const { programNode, nameApi } = scope; - const programErrorClass = nameApi.programErrorClass(programNode.name); - const programErrorCode = nameApi.programErrorCodeEnum(programNode.name); - const programGetErrorFromCodeFunction = - nameApi.programGetErrorFromCodeFunction(programNode.name); - const programFragment = fragmentFromTemplate('program.njk', { + return fragmentFromTemplate('program.njk', { program: programNode, - programType: nameApi.programType(programNode.name), programAddressConstant: nameApi.programAddressConstant(programNode.name), - programCreateFunction: nameApi.programCreateFunction(programNode.name), - programErrorClass, - programErrorCode, - programGetErrorFromCodeFunction, - }) - .addImports('solanaAddresses', ['Address']) - .addImports('solanaPrograms', ['Program']); - - if (programNode.errors.length > 0) { - programFragment - .addImports('solanaPrograms', ['ProgramWithErrors']) - .addImports('generatedErrors', [ - programErrorClass, - programErrorCode, - programGetErrorFromCodeFunction, - ]); - } - - return programFragment; + }).addImports('solanaAddresses', ['Address']); } diff --git a/src/renderers/js-experimental/fragments/programErrors.njk b/src/renderers/js-experimental/fragments/programErrors.njk index 6af568bdb..5ec02b9e4 100644 --- a/src/renderers/js-experimental/fragments/programErrors.njk +++ b/src/renderers/js-experimental/fragments/programErrors.njk @@ -1,39 +1,28 @@ {% import "templates/macros.njk" as macros %} -export const enum {{ programErrorCodeEnum }} { - {% for error in errors | sort(false, false, 'code') %} - {{ macros.docblock(error.docs) }} - {{ error.name | snakeCase | upper }} = 0x{{ error.code.toString(16) }}, // {{ error.code }} - {% endfor %} -} - -export class {{ programErrorClass }} extends Error { - override readonly name = '{{ programErrorClass }}'; - - readonly code: {{ programErrorCodeEnum }}; +{% for error in errors | sort(false, false, 'code') %} + {{ macros.docblock(error.docs) }} + export const {{ getProgramErrorConstant(error.name) }} = 0x{{ error.code.toString(16) }}, // {{ error.code }} +{% endfor %} - readonly cause: Error | undefined; - - constructor(code: {{ programErrorCodeEnum }}, name: string, message: string, cause?: Error) { - super(`${name} (${code}): ${message}`); - this.code = code; - this.cause = cause; - } -} +export type {{ programErrorUnion }} = + {% for error in errors | sort(false, false, 'name') %} + | typeof {{ getProgramErrorConstant(error.name) }} + {% endfor %}; -let {{ programErrorCodeMap }}: Record<{{ programErrorCodeEnum }}, [string, string]> | undefined; +let {{ programErrorMessagesMap }}: Record<{{ programErrorUnion }}, string> | undefined; if (__DEV__) { - {{ programErrorCodeMap }} = { - {% for error in errors | sort(false, false, 'code') %} - [{{ programErrorCodeEnum }}.{{ error.name | snakeCase | upper }}]: ['{{ error.name | pascalCase }}', `{{ error.message }}`], + {{ programErrorMessagesMap }} = { + {% for error in errors | sort(false, false, 'name') %} + [{{ getProgramErrorConstant(error.name) }}]: `{{ error.message }}`, {% endfor %} }; } -export function {{ programGetErrorFromCodeFunction }}(code: {{ programErrorCodeEnum }}, cause?: Error): {{ programErrorClass }} { +export function {{ programGetErrorMessageFunction }}(code: {{ programErrorUnion }}): string { if (__DEV__) { - return new {{ programErrorClass }}(code, ...({{ programErrorCodeMap }} as Record<{{ programErrorCodeEnum }}, [string, string]>)[code], cause); + return ({{ programErrorMessagesMap }} as Record<{{ programErrorUnion }}, string>)[code]; } - return new {{ programErrorClass }}(code, 'Unknown', 'Error message not available in production bundles. Compile with __DEV__ set to true to see more information.', cause); + return 'Error message not available in production bundles. Compile with `__DEV__` set to true to see more information.'; } diff --git a/src/renderers/js-experimental/fragments/programErrors.ts b/src/renderers/js-experimental/fragments/programErrors.ts index 34a10fc30..5fb3a3f19 100644 --- a/src/renderers/js-experimental/fragments/programErrors.ts +++ b/src/renderers/js-experimental/fragments/programErrors.ts @@ -10,11 +10,13 @@ export function getProgramErrorsFragment( const { programNode, nameApi } = scope; return fragmentFromTemplate('programErrors.njk', { errors: programNode.errors, - programErrorClass: nameApi.programErrorClass(programNode.name), - programErrorCodeEnum: nameApi.programErrorCodeEnum(programNode.name), - programErrorCodeMap: nameApi.programErrorCodeMap(programNode.name), - programGetErrorFromCodeFunction: nameApi.programGetErrorFromCodeFunction( + programErrorUnion: nameApi.programErrorUnion(programNode.name), + programErrorMessagesMap: nameApi.programErrorMessagesMap(programNode.name), + programGetErrorMessageFunction: nameApi.programGetErrorMessageFunction( programNode.name ), + getProgramErrorConstant: (name: string) => + nameApi.programErrorConstantPrefix(programNode.name) + + nameApi.programErrorConstant(name), }); } diff --git a/src/renderers/js-experimental/nameTransformers.ts b/src/renderers/js-experimental/nameTransformers.ts index fa5e2d2d5..083f9eacf 100644 --- a/src/renderers/js-experimental/nameTransformers.ts +++ b/src/renderers/js-experimental/nameTransformers.ts @@ -51,9 +51,7 @@ export type NameTransformerKey = | 'instructionSyncFunction' | 'instructionParsedType' | 'instructionParseFunction' - | 'programType' | 'programAddressConstant' - | 'programCreateFunction' | 'programAccountsEnum' | 'programAccountsEnumVariant' | 'programAccountsIdentifierFunction' @@ -61,10 +59,11 @@ export type NameTransformerKey = | 'programInstructionsEnumVariant' | 'programInstructionsIdentifierFunction' | 'programInstructionsParsedUnionType' - | 'programErrorClass' - | 'programErrorCodeEnum' - | 'programErrorCodeMap' - | 'programGetErrorFromCodeFunction' + | 'programErrorConstantPrefix' + | 'programErrorConstant' + | 'programErrorUnion' + | 'programErrorMessagesMap' + | 'programGetErrorMessageFunction' | 'resolverFunction'; export type NameTransformers = Record; @@ -119,10 +118,8 @@ export const DEFAULT_NAME_TRANSFORMERS: NameTransformers = { instructionSyncFunction: (name) => `get${pascalCase(name)}Instruction`, instructionParsedType: (name) => `Parsed${pascalCase(name)}Instruction`, instructionParseFunction: (name) => `parse${pascalCase(name)}Instruction`, - programType: (name) => `${pascalCase(name)}Program`, programAddressConstant: (name) => `${snakeCase(name).toUpperCase()}_PROGRAM_ADDRESS`, - programCreateFunction: (name) => `get${pascalCase(name)}Program`, programAccountsEnum: (name) => `${pascalCase(name)}Account`, programAccountsEnumVariant: (name) => `${pascalCase(name)}`, programAccountsIdentifierFunction: (name) => @@ -133,10 +130,12 @@ export const DEFAULT_NAME_TRANSFORMERS: NameTransformers = { `identify${pascalCase(name)}Instruction`, programInstructionsParsedUnionType: (name) => `Parsed${pascalCase(name)}Instruction`, - programErrorClass: (name) => `${pascalCase(name)}ProgramError`, - programErrorCodeEnum: (name) => `${pascalCase(name)}ProgramErrorCode`, - programErrorCodeMap: (name) => `${camelCase(name)}ProgramErrorCodeMap`, - programGetErrorFromCodeFunction: (name) => - `get${pascalCase(name)}ProgramErrorFromCode`, + programErrorConstantPrefix: (name) => + `${snakeCase(name)}_ERROR__`.toUpperCase(), + programErrorConstant: (name) => snakeCase(name).toUpperCase(), + programErrorUnion: (name) => `${pascalCase(name)}Error`, + programErrorMessagesMap: (name) => `${camelCase(name)}ErrorMessages`, + programGetErrorMessageFunction: (name) => + `get${pascalCase(name)}ErrorMessage`, resolverFunction: (name) => `${camelCase(name)}`, }; diff --git a/test/packages/js-experimental/package.json b/test/packages/js-experimental/package.json index 0c814d2ac..4d281df3e 100644 --- a/test/packages/js-experimental/package.json +++ b/test/packages/js-experimental/package.json @@ -16,7 +16,6 @@ "@solana/addresses": "2.0.0-preview.1.20240412114257.1882615a63943d158ad8ee86231f39d6f31763f2", "@solana/codecs": "2.0.0-preview.1.20240412114257.1882615a63943d158ad8ee86231f39d6f31763f2", "@solana/instructions": "2.0.0-preview.1.20240412114257.1882615a63943d158ad8ee86231f39d6f31763f2", - "@solana/programs": "2.0.0-preview.1.20240412114257.1882615a63943d158ad8ee86231f39d6f31763f2", "@solana/signers": "2.0.0-preview.1.20240412114257.1882615a63943d158ad8ee86231f39d6f31763f2" }, "devDependencies": { diff --git a/test/packages/js-experimental/pnpm-lock.yaml b/test/packages/js-experimental/pnpm-lock.yaml index a3851415f..9f3c64e93 100644 --- a/test/packages/js-experimental/pnpm-lock.yaml +++ b/test/packages/js-experimental/pnpm-lock.yaml @@ -17,9 +17,6 @@ dependencies: '@solana/instructions': specifier: 2.0.0-preview.1.20240412114257.1882615a63943d158ad8ee86231f39d6f31763f2 version: 2.0.0-preview.1.20240412114257.1882615a63943d158ad8ee86231f39d6f31763f2 - '@solana/programs': - specifier: 2.0.0-preview.1.20240412114257.1882615a63943d158ad8ee86231f39d6f31763f2 - version: 2.0.0-preview.1.20240412114257.1882615a63943d158ad8ee86231f39d6f31763f2 '@solana/signers': specifier: 2.0.0-preview.1.20240412114257.1882615a63943d158ad8ee86231f39d6f31763f2 version: 2.0.0-preview.1.20240412114257.1882615a63943d158ad8ee86231f39d6f31763f2(fastestsmallesttextencoderdecoder@1.0.22) @@ -256,10 +253,6 @@ packages: - fastestsmallesttextencoderdecoder dev: false - /@solana/programs@2.0.0-preview.1.20240412114257.1882615a63943d158ad8ee86231f39d6f31763f2: - resolution: {integrity: sha512-f3gF9VUjw3/V24LJUtuohH9593E9Y+J8L8gwH4rOmtEq18zG13Kj97gwyLljNQ0aq9a/6DKpGnNgQtgTqe6Dxg==} - dev: false - /@solana/rpc-spec-types@2.0.0-preview.1.20240412114257.1882615a63943d158ad8ee86231f39d6f31763f2: resolution: {integrity: sha512-9aiLz1AxjvqoGsyWMmBfbrLtlmA7fIX/c4Rd36izNTgUGTFer6+dGqKI/upRBfsAAjr+FufQ5EskjBqe1gF+YQ==} dev: false diff --git a/test/packages/js-experimental/src/generated/errors/mplCandyMachineCore.ts b/test/packages/js-experimental/src/generated/errors/mplCandyMachineCore.ts index 359731f94..4f5bf01a3 100644 --- a/test/packages/js-experimental/src/generated/errors/mplCandyMachineCore.ts +++ b/test/packages/js-experimental/src/generated/errors/mplCandyMachineCore.ts @@ -6,185 +6,112 @@ * @see https://github.com/metaplex-foundation/kinobi */ -export const enum MplCandyMachineCoreProgramErrorCode { - /** IncorrectOwner: Account does not have correct owner */ - INCORRECT_OWNER = 0x1770, // 6000 - /** Uninitialized: Account is not initialized */ - UNINITIALIZED = 0x1771, // 6001 - /** MintMismatch: Mint Mismatch */ - MINT_MISMATCH = 0x1772, // 6002 - /** IndexGreaterThanLength: Index greater than length */ - INDEX_GREATER_THAN_LENGTH = 0x1773, // 6003 - /** NumericalOverflowError: Numerical overflow error */ - NUMERICAL_OVERFLOW_ERROR = 0x1774, // 6004 - /** TooManyCreators: Can only provide up to 4 creators to candy machine (because candy machine is one) */ - TOO_MANY_CREATORS = 0x1775, // 6005 - /** CandyMachineEmpty: Candy machine is empty */ - CANDY_MACHINE_EMPTY = 0x1776, // 6006 - /** HiddenSettingsDoNotHaveConfigLines: Candy machines using hidden uris do not have config lines, they have a single hash representing hashed order */ - HIDDEN_SETTINGS_DO_NOT_HAVE_CONFIG_LINES = 0x1777, // 6007 - /** CannotChangeNumberOfLines: Cannot change number of lines unless is a hidden config */ - CANNOT_CHANGE_NUMBER_OF_LINES = 0x1778, // 6008 - /** CannotSwitchToHiddenSettings: Cannot switch to hidden settings after items available is greater than 0 */ - CANNOT_SWITCH_TO_HIDDEN_SETTINGS = 0x1779, // 6009 - /** IncorrectCollectionAuthority: Incorrect collection NFT authority */ - INCORRECT_COLLECTION_AUTHORITY = 0x177a, // 6010 - /** MetadataAccountMustBeEmpty: The metadata account has data in it, and this must be empty to mint a new NFT */ - METADATA_ACCOUNT_MUST_BE_EMPTY = 0x177b, // 6011 - /** NoChangingCollectionDuringMint: Can't change collection settings after items have begun to be minted */ - NO_CHANGING_COLLECTION_DURING_MINT = 0x177c, // 6012 - /** ExceededLengthError: Value longer than expected maximum value */ - EXCEEDED_LENGTH_ERROR = 0x177d, // 6013 - /** MissingConfigLinesSettings: Missing config lines settings */ - MISSING_CONFIG_LINES_SETTINGS = 0x177e, // 6014 - /** CannotIncreaseLength: Cannot increase the length in config lines settings */ - CANNOT_INCREASE_LENGTH = 0x177f, // 6015 - /** CannotSwitchFromHiddenSettings: Cannot switch from hidden settings */ - CANNOT_SWITCH_FROM_HIDDEN_SETTINGS = 0x1780, // 6016 - /** CannotChangeSequentialIndexGeneration: Cannot change sequential index generation after items have begun to be minted */ - CANNOT_CHANGE_SEQUENTIAL_INDEX_GENERATION = 0x1781, // 6017 - /** CollectionKeyMismatch: Collection public key mismatch */ - COLLECTION_KEY_MISMATCH = 0x1782, // 6018 - /** CouldNotRetrieveConfigLineData: Could not retrive config line data */ - COULD_NOT_RETRIEVE_CONFIG_LINE_DATA = 0x1783, // 6019 - /** NotFullyLoaded: Not all config lines were added to the candy machine */ - NOT_FULLY_LOADED = 0x1784, // 6020 -} - -export class MplCandyMachineCoreProgramError extends Error { - override readonly name = 'MplCandyMachineCoreProgramError'; - - readonly code: MplCandyMachineCoreProgramErrorCode; +/** IncorrectOwner: Account does not have correct owner */ +export const MPL_CANDY_MACHINE_CORE_ERROR__INCORRECT_OWNER = 0x1770; // 6000 +/** Uninitialized: Account is not initialized */ +export const MPL_CANDY_MACHINE_CORE_ERROR__UNINITIALIZED = 0x1771; // 6001 +/** MintMismatch: Mint Mismatch */ +export const MPL_CANDY_MACHINE_CORE_ERROR__MINT_MISMATCH = 0x1772; // 6002 +/** IndexGreaterThanLength: Index greater than length */ +export const MPL_CANDY_MACHINE_CORE_ERROR__INDEX_GREATER_THAN_LENGTH = 0x1773; // 6003 +/** NumericalOverflowError: Numerical overflow error */ +export const MPL_CANDY_MACHINE_CORE_ERROR__NUMERICAL_OVERFLOW_ERROR = 0x1774; // 6004 +/** TooManyCreators: Can only provide up to 4 creators to candy machine (because candy machine is one) */ +export const MPL_CANDY_MACHINE_CORE_ERROR__TOO_MANY_CREATORS = 0x1775; // 6005 +/** CandyMachineEmpty: Candy machine is empty */ +export const MPL_CANDY_MACHINE_CORE_ERROR__CANDY_MACHINE_EMPTY = 0x1776; // 6006 +/** HiddenSettingsDoNotHaveConfigLines: Candy machines using hidden uris do not have config lines, they have a single hash representing hashed order */ +export const MPL_CANDY_MACHINE_CORE_ERROR__HIDDEN_SETTINGS_DO_NOT_HAVE_CONFIG_LINES = 0x1777; // 6007 +/** CannotChangeNumberOfLines: Cannot change number of lines unless is a hidden config */ +export const MPL_CANDY_MACHINE_CORE_ERROR__CANNOT_CHANGE_NUMBER_OF_LINES = 0x1778; // 6008 +/** CannotSwitchToHiddenSettings: Cannot switch to hidden settings after items available is greater than 0 */ +export const MPL_CANDY_MACHINE_CORE_ERROR__CANNOT_SWITCH_TO_HIDDEN_SETTINGS = 0x1779; // 6009 +/** IncorrectCollectionAuthority: Incorrect collection NFT authority */ +export const MPL_CANDY_MACHINE_CORE_ERROR__INCORRECT_COLLECTION_AUTHORITY = 0x177a; // 6010 +/** MetadataAccountMustBeEmpty: The metadata account has data in it, and this must be empty to mint a new NFT */ +export const MPL_CANDY_MACHINE_CORE_ERROR__METADATA_ACCOUNT_MUST_BE_EMPTY = 0x177b; // 6011 +/** NoChangingCollectionDuringMint: Can't change collection settings after items have begun to be minted */ +export const MPL_CANDY_MACHINE_CORE_ERROR__NO_CHANGING_COLLECTION_DURING_MINT = 0x177c; // 6012 +/** ExceededLengthError: Value longer than expected maximum value */ +export const MPL_CANDY_MACHINE_CORE_ERROR__EXCEEDED_LENGTH_ERROR = 0x177d; // 6013 +/** MissingConfigLinesSettings: Missing config lines settings */ +export const MPL_CANDY_MACHINE_CORE_ERROR__MISSING_CONFIG_LINES_SETTINGS = 0x177e; // 6014 +/** CannotIncreaseLength: Cannot increase the length in config lines settings */ +export const MPL_CANDY_MACHINE_CORE_ERROR__CANNOT_INCREASE_LENGTH = 0x177f; // 6015 +/** CannotSwitchFromHiddenSettings: Cannot switch from hidden settings */ +export const MPL_CANDY_MACHINE_CORE_ERROR__CANNOT_SWITCH_FROM_HIDDEN_SETTINGS = 0x1780; // 6016 +/** CannotChangeSequentialIndexGeneration: Cannot change sequential index generation after items have begun to be minted */ +export const MPL_CANDY_MACHINE_CORE_ERROR__CANNOT_CHANGE_SEQUENTIAL_INDEX_GENERATION = 0x1781; // 6017 +/** CollectionKeyMismatch: Collection public key mismatch */ +export const MPL_CANDY_MACHINE_CORE_ERROR__COLLECTION_KEY_MISMATCH = 0x1782; // 6018 +/** CouldNotRetrieveConfigLineData: Could not retrive config line data */ +export const MPL_CANDY_MACHINE_CORE_ERROR__COULD_NOT_RETRIEVE_CONFIG_LINE_DATA = 0x1783; // 6019 +/** NotFullyLoaded: Not all config lines were added to the candy machine */ +export const MPL_CANDY_MACHINE_CORE_ERROR__NOT_FULLY_LOADED = 0x1784; // 6020 - readonly cause: Error | undefined; - - constructor( - code: MplCandyMachineCoreProgramErrorCode, - name: string, - message: string, - cause?: Error - ) { - super(`${name} (${code}): ${message}`); - this.code = code; - this.cause = cause; - } -} +export type MplCandyMachineCoreError = + | typeof MPL_CANDY_MACHINE_CORE_ERROR__CANDY_MACHINE_EMPTY + | typeof MPL_CANDY_MACHINE_CORE_ERROR__CANNOT_CHANGE_NUMBER_OF_LINES + | typeof MPL_CANDY_MACHINE_CORE_ERROR__CANNOT_CHANGE_SEQUENTIAL_INDEX_GENERATION + | typeof MPL_CANDY_MACHINE_CORE_ERROR__CANNOT_INCREASE_LENGTH + | typeof MPL_CANDY_MACHINE_CORE_ERROR__CANNOT_SWITCH_FROM_HIDDEN_SETTINGS + | typeof MPL_CANDY_MACHINE_CORE_ERROR__CANNOT_SWITCH_TO_HIDDEN_SETTINGS + | typeof MPL_CANDY_MACHINE_CORE_ERROR__COLLECTION_KEY_MISMATCH + | typeof MPL_CANDY_MACHINE_CORE_ERROR__COULD_NOT_RETRIEVE_CONFIG_LINE_DATA + | typeof MPL_CANDY_MACHINE_CORE_ERROR__EXCEEDED_LENGTH_ERROR + | typeof MPL_CANDY_MACHINE_CORE_ERROR__HIDDEN_SETTINGS_DO_NOT_HAVE_CONFIG_LINES + | typeof MPL_CANDY_MACHINE_CORE_ERROR__INCORRECT_COLLECTION_AUTHORITY + | typeof MPL_CANDY_MACHINE_CORE_ERROR__INCORRECT_OWNER + | typeof MPL_CANDY_MACHINE_CORE_ERROR__INDEX_GREATER_THAN_LENGTH + | typeof MPL_CANDY_MACHINE_CORE_ERROR__METADATA_ACCOUNT_MUST_BE_EMPTY + | typeof MPL_CANDY_MACHINE_CORE_ERROR__MINT_MISMATCH + | typeof MPL_CANDY_MACHINE_CORE_ERROR__MISSING_CONFIG_LINES_SETTINGS + | typeof MPL_CANDY_MACHINE_CORE_ERROR__NO_CHANGING_COLLECTION_DURING_MINT + | typeof MPL_CANDY_MACHINE_CORE_ERROR__NOT_FULLY_LOADED + | typeof MPL_CANDY_MACHINE_CORE_ERROR__NUMERICAL_OVERFLOW_ERROR + | typeof MPL_CANDY_MACHINE_CORE_ERROR__TOO_MANY_CREATORS + | typeof MPL_CANDY_MACHINE_CORE_ERROR__UNINITIALIZED; -let mplCandyMachineCoreProgramErrorCodeMap: - | Record +let mplCandyMachineCoreErrorMessages: + | Record | undefined; if (__DEV__) { - mplCandyMachineCoreProgramErrorCodeMap = { - [MplCandyMachineCoreProgramErrorCode.INCORRECT_OWNER]: [ - 'IncorrectOwner', - `Account does not have correct owner`, - ], - [MplCandyMachineCoreProgramErrorCode.UNINITIALIZED]: [ - 'Uninitialized', - `Account is not initialized`, - ], - [MplCandyMachineCoreProgramErrorCode.MINT_MISMATCH]: [ - 'MintMismatch', - `Mint Mismatch`, - ], - [MplCandyMachineCoreProgramErrorCode.INDEX_GREATER_THAN_LENGTH]: [ - 'IndexGreaterThanLength', - `Index greater than length`, - ], - [MplCandyMachineCoreProgramErrorCode.NUMERICAL_OVERFLOW_ERROR]: [ - 'NumericalOverflowError', - `Numerical overflow error`, - ], - [MplCandyMachineCoreProgramErrorCode.TOO_MANY_CREATORS]: [ - 'TooManyCreators', - `Can only provide up to 4 creators to candy machine (because candy machine is one)`, - ], - [MplCandyMachineCoreProgramErrorCode.CANDY_MACHINE_EMPTY]: [ - 'CandyMachineEmpty', - `Candy machine is empty`, - ], - [MplCandyMachineCoreProgramErrorCode.HIDDEN_SETTINGS_DO_NOT_HAVE_CONFIG_LINES]: - [ - 'HiddenSettingsDoNotHaveConfigLines', - `Candy machines using hidden uris do not have config lines, they have a single hash representing hashed order`, - ], - [MplCandyMachineCoreProgramErrorCode.CANNOT_CHANGE_NUMBER_OF_LINES]: [ - 'CannotChangeNumberOfLines', - `Cannot change number of lines unless is a hidden config`, - ], - [MplCandyMachineCoreProgramErrorCode.CANNOT_SWITCH_TO_HIDDEN_SETTINGS]: [ - 'CannotSwitchToHiddenSettings', - `Cannot switch to hidden settings after items available is greater than 0`, - ], - [MplCandyMachineCoreProgramErrorCode.INCORRECT_COLLECTION_AUTHORITY]: [ - 'IncorrectCollectionAuthority', - `Incorrect collection NFT authority`, - ], - [MplCandyMachineCoreProgramErrorCode.METADATA_ACCOUNT_MUST_BE_EMPTY]: [ - 'MetadataAccountMustBeEmpty', - `The metadata account has data in it, and this must be empty to mint a new NFT`, - ], - [MplCandyMachineCoreProgramErrorCode.NO_CHANGING_COLLECTION_DURING_MINT]: [ - 'NoChangingCollectionDuringMint', - `Can't change collection settings after items have begun to be minted`, - ], - [MplCandyMachineCoreProgramErrorCode.EXCEEDED_LENGTH_ERROR]: [ - 'ExceededLengthError', - `Value longer than expected maximum value`, - ], - [MplCandyMachineCoreProgramErrorCode.MISSING_CONFIG_LINES_SETTINGS]: [ - 'MissingConfigLinesSettings', - `Missing config lines settings`, - ], - [MplCandyMachineCoreProgramErrorCode.CANNOT_INCREASE_LENGTH]: [ - 'CannotIncreaseLength', - `Cannot increase the length in config lines settings`, - ], - [MplCandyMachineCoreProgramErrorCode.CANNOT_SWITCH_FROM_HIDDEN_SETTINGS]: [ - 'CannotSwitchFromHiddenSettings', - `Cannot switch from hidden settings`, - ], - [MplCandyMachineCoreProgramErrorCode.CANNOT_CHANGE_SEQUENTIAL_INDEX_GENERATION]: - [ - 'CannotChangeSequentialIndexGeneration', - `Cannot change sequential index generation after items have begun to be minted`, - ], - [MplCandyMachineCoreProgramErrorCode.COLLECTION_KEY_MISMATCH]: [ - 'CollectionKeyMismatch', - `Collection public key mismatch`, - ], - [MplCandyMachineCoreProgramErrorCode.COULD_NOT_RETRIEVE_CONFIG_LINE_DATA]: [ - 'CouldNotRetrieveConfigLineData', - `Could not retrive config line data`, - ], - [MplCandyMachineCoreProgramErrorCode.NOT_FULLY_LOADED]: [ - 'NotFullyLoaded', - `Not all config lines were added to the candy machine`, - ], + mplCandyMachineCoreErrorMessages = { + [MPL_CANDY_MACHINE_CORE_ERROR__CANDY_MACHINE_EMPTY]: `Candy machine is empty`, + [MPL_CANDY_MACHINE_CORE_ERROR__CANNOT_CHANGE_NUMBER_OF_LINES]: `Cannot change number of lines unless is a hidden config`, + [MPL_CANDY_MACHINE_CORE_ERROR__CANNOT_CHANGE_SEQUENTIAL_INDEX_GENERATION]: `Cannot change sequential index generation after items have begun to be minted`, + [MPL_CANDY_MACHINE_CORE_ERROR__CANNOT_INCREASE_LENGTH]: `Cannot increase the length in config lines settings`, + [MPL_CANDY_MACHINE_CORE_ERROR__CANNOT_SWITCH_FROM_HIDDEN_SETTINGS]: `Cannot switch from hidden settings`, + [MPL_CANDY_MACHINE_CORE_ERROR__CANNOT_SWITCH_TO_HIDDEN_SETTINGS]: `Cannot switch to hidden settings after items available is greater than 0`, + [MPL_CANDY_MACHINE_CORE_ERROR__COLLECTION_KEY_MISMATCH]: `Collection public key mismatch`, + [MPL_CANDY_MACHINE_CORE_ERROR__COULD_NOT_RETRIEVE_CONFIG_LINE_DATA]: `Could not retrive config line data`, + [MPL_CANDY_MACHINE_CORE_ERROR__EXCEEDED_LENGTH_ERROR]: `Value longer than expected maximum value`, + [MPL_CANDY_MACHINE_CORE_ERROR__HIDDEN_SETTINGS_DO_NOT_HAVE_CONFIG_LINES]: `Candy machines using hidden uris do not have config lines, they have a single hash representing hashed order`, + [MPL_CANDY_MACHINE_CORE_ERROR__INCORRECT_COLLECTION_AUTHORITY]: `Incorrect collection NFT authority`, + [MPL_CANDY_MACHINE_CORE_ERROR__INCORRECT_OWNER]: `Account does not have correct owner`, + [MPL_CANDY_MACHINE_CORE_ERROR__INDEX_GREATER_THAN_LENGTH]: `Index greater than length`, + [MPL_CANDY_MACHINE_CORE_ERROR__METADATA_ACCOUNT_MUST_BE_EMPTY]: `The metadata account has data in it, and this must be empty to mint a new NFT`, + [MPL_CANDY_MACHINE_CORE_ERROR__MINT_MISMATCH]: `Mint Mismatch`, + [MPL_CANDY_MACHINE_CORE_ERROR__MISSING_CONFIG_LINES_SETTINGS]: `Missing config lines settings`, + [MPL_CANDY_MACHINE_CORE_ERROR__NO_CHANGING_COLLECTION_DURING_MINT]: `Can't change collection settings after items have begun to be minted`, + [MPL_CANDY_MACHINE_CORE_ERROR__NOT_FULLY_LOADED]: `Not all config lines were added to the candy machine`, + [MPL_CANDY_MACHINE_CORE_ERROR__NUMERICAL_OVERFLOW_ERROR]: `Numerical overflow error`, + [MPL_CANDY_MACHINE_CORE_ERROR__TOO_MANY_CREATORS]: `Can only provide up to 4 creators to candy machine (because candy machine is one)`, + [MPL_CANDY_MACHINE_CORE_ERROR__UNINITIALIZED]: `Account is not initialized`, }; } -export function getMplCandyMachineCoreProgramErrorFromCode( - code: MplCandyMachineCoreProgramErrorCode, - cause?: Error -): MplCandyMachineCoreProgramError { +export function getMplCandyMachineCoreErrorMessage( + code: MplCandyMachineCoreError +): string { if (__DEV__) { - return new MplCandyMachineCoreProgramError( - code, - ...( - mplCandyMachineCoreProgramErrorCodeMap as Record< - MplCandyMachineCoreProgramErrorCode, - [string, string] - > - )[code], - cause - ); + return ( + mplCandyMachineCoreErrorMessages as Record< + MplCandyMachineCoreError, + string + > + )[code]; } - return new MplCandyMachineCoreProgramError( - code, - 'Unknown', - 'Error message not available in production bundles. Compile with __DEV__ set to true to see more information.', - cause - ); + return 'Error message not available in production bundles. Compile with `__DEV__` set to true to see more information.'; } diff --git a/test/packages/js-experimental/src/generated/errors/mplTokenAuthRules.ts b/test/packages/js-experimental/src/generated/errors/mplTokenAuthRules.ts index 4b3d9d688..26cfe1f41 100644 --- a/test/packages/js-experimental/src/generated/errors/mplTokenAuthRules.ts +++ b/test/packages/js-experimental/src/generated/errors/mplTokenAuthRules.ts @@ -6,144 +6,85 @@ * @see https://github.com/metaplex-foundation/kinobi */ -export const enum MplTokenAuthRulesProgramErrorCode { - /** NumericalOverflow: Numerical Overflow */ - NUMERICAL_OVERFLOW = 0x0, // 0 - /** DataTypeMismatch: Data type mismatch */ - DATA_TYPE_MISMATCH = 0x1, // 1 - /** IncorrectOwner: Incorrect account owner */ - INCORRECT_OWNER = 0x2, // 2 - /** PayloadVecIndexError: Could not index into PayloadVec */ - PAYLOAD_VEC_INDEX_ERROR = 0x3, // 3 - /** DerivedKeyInvalid: Derived key invalid */ - DERIVED_KEY_INVALID = 0x4, // 4 - /** AdditionalSignerCheckFailed: Additional Signer check failed */ - ADDITIONAL_SIGNER_CHECK_FAILED = 0x5, // 5 - /** PubkeyMatchCheckFailed: Pubkey Match check failed */ - PUBKEY_MATCH_CHECK_FAILED = 0x6, // 6 - /** DerivedKeyMatchCheckFailed: Derived Key Match check failed */ - DERIVED_KEY_MATCH_CHECK_FAILED = 0x7, // 7 - /** ProgramOwnedCheckFailed: Program Owned check failed */ - PROGRAM_OWNED_CHECK_FAILED = 0x8, // 8 - /** AmountCheckFailed: Amount checked failed */ - AMOUNT_CHECK_FAILED = 0x9, // 9 - /** FrequencyCheckFailed: Frequency check failed */ - FREQUENCY_CHECK_FAILED = 0xa, // 10 - /** PubkeyTreeMatchCheckFailed: Pubkey Tree Match check failed */ - PUBKEY_TREE_MATCH_CHECK_FAILED = 0xb, // 11 - /** PayerIsNotSigner: Payer is not a signer */ - PAYER_IS_NOT_SIGNER = 0xc, // 12 - /** NotImplemented */ - NOT_IMPLEMENTED = 0xd, // 13 - /** BorshSerializationError: Borsh Serialization Error */ - BORSH_SERIALIZATION_ERROR = 0xe, // 14 -} - -export class MplTokenAuthRulesProgramError extends Error { - override readonly name = 'MplTokenAuthRulesProgramError'; - - readonly code: MplTokenAuthRulesProgramErrorCode; +/** NumericalOverflow: Numerical Overflow */ +export const MPL_TOKEN_AUTH_RULES_ERROR__NUMERICAL_OVERFLOW = 0x0; // 0 +/** DataTypeMismatch: Data type mismatch */ +export const MPL_TOKEN_AUTH_RULES_ERROR__DATA_TYPE_MISMATCH = 0x1; // 1 +/** IncorrectOwner: Incorrect account owner */ +export const MPL_TOKEN_AUTH_RULES_ERROR__INCORRECT_OWNER = 0x2; // 2 +/** PayloadVecIndexError: Could not index into PayloadVec */ +export const MPL_TOKEN_AUTH_RULES_ERROR__PAYLOAD_VEC_INDEX_ERROR = 0x3; // 3 +/** DerivedKeyInvalid: Derived key invalid */ +export const MPL_TOKEN_AUTH_RULES_ERROR__DERIVED_KEY_INVALID = 0x4; // 4 +/** AdditionalSignerCheckFailed: Additional Signer check failed */ +export const MPL_TOKEN_AUTH_RULES_ERROR__ADDITIONAL_SIGNER_CHECK_FAILED = 0x5; // 5 +/** PubkeyMatchCheckFailed: Pubkey Match check failed */ +export const MPL_TOKEN_AUTH_RULES_ERROR__PUBKEY_MATCH_CHECK_FAILED = 0x6; // 6 +/** DerivedKeyMatchCheckFailed: Derived Key Match check failed */ +export const MPL_TOKEN_AUTH_RULES_ERROR__DERIVED_KEY_MATCH_CHECK_FAILED = 0x7; // 7 +/** ProgramOwnedCheckFailed: Program Owned check failed */ +export const MPL_TOKEN_AUTH_RULES_ERROR__PROGRAM_OWNED_CHECK_FAILED = 0x8; // 8 +/** AmountCheckFailed: Amount checked failed */ +export const MPL_TOKEN_AUTH_RULES_ERROR__AMOUNT_CHECK_FAILED = 0x9; // 9 +/** FrequencyCheckFailed: Frequency check failed */ +export const MPL_TOKEN_AUTH_RULES_ERROR__FREQUENCY_CHECK_FAILED = 0xa; // 10 +/** PubkeyTreeMatchCheckFailed: Pubkey Tree Match check failed */ +export const MPL_TOKEN_AUTH_RULES_ERROR__PUBKEY_TREE_MATCH_CHECK_FAILED = 0xb; // 11 +/** PayerIsNotSigner: Payer is not a signer */ +export const MPL_TOKEN_AUTH_RULES_ERROR__PAYER_IS_NOT_SIGNER = 0xc; // 12 +/** NotImplemented */ +export const MPL_TOKEN_AUTH_RULES_ERROR__NOT_IMPLEMENTED = 0xd; // 13 +/** BorshSerializationError: Borsh Serialization Error */ +export const MPL_TOKEN_AUTH_RULES_ERROR__BORSH_SERIALIZATION_ERROR = 0xe; // 14 - readonly cause: Error | undefined; - - constructor( - code: MplTokenAuthRulesProgramErrorCode, - name: string, - message: string, - cause?: Error - ) { - super(`${name} (${code}): ${message}`); - this.code = code; - this.cause = cause; - } -} +export type MplTokenAuthRulesError = + | typeof MPL_TOKEN_AUTH_RULES_ERROR__ADDITIONAL_SIGNER_CHECK_FAILED + | typeof MPL_TOKEN_AUTH_RULES_ERROR__AMOUNT_CHECK_FAILED + | typeof MPL_TOKEN_AUTH_RULES_ERROR__BORSH_SERIALIZATION_ERROR + | typeof MPL_TOKEN_AUTH_RULES_ERROR__DATA_TYPE_MISMATCH + | typeof MPL_TOKEN_AUTH_RULES_ERROR__DERIVED_KEY_INVALID + | typeof MPL_TOKEN_AUTH_RULES_ERROR__DERIVED_KEY_MATCH_CHECK_FAILED + | typeof MPL_TOKEN_AUTH_RULES_ERROR__FREQUENCY_CHECK_FAILED + | typeof MPL_TOKEN_AUTH_RULES_ERROR__INCORRECT_OWNER + | typeof MPL_TOKEN_AUTH_RULES_ERROR__NOT_IMPLEMENTED + | typeof MPL_TOKEN_AUTH_RULES_ERROR__NUMERICAL_OVERFLOW + | typeof MPL_TOKEN_AUTH_RULES_ERROR__PAYER_IS_NOT_SIGNER + | typeof MPL_TOKEN_AUTH_RULES_ERROR__PAYLOAD_VEC_INDEX_ERROR + | typeof MPL_TOKEN_AUTH_RULES_ERROR__PROGRAM_OWNED_CHECK_FAILED + | typeof MPL_TOKEN_AUTH_RULES_ERROR__PUBKEY_MATCH_CHECK_FAILED + | typeof MPL_TOKEN_AUTH_RULES_ERROR__PUBKEY_TREE_MATCH_CHECK_FAILED; -let mplTokenAuthRulesProgramErrorCodeMap: - | Record +let mplTokenAuthRulesErrorMessages: + | Record | undefined; if (__DEV__) { - mplTokenAuthRulesProgramErrorCodeMap = { - [MplTokenAuthRulesProgramErrorCode.NUMERICAL_OVERFLOW]: [ - 'NumericalOverflow', - `Numerical Overflow`, - ], - [MplTokenAuthRulesProgramErrorCode.DATA_TYPE_MISMATCH]: [ - 'DataTypeMismatch', - `Data type mismatch`, - ], - [MplTokenAuthRulesProgramErrorCode.INCORRECT_OWNER]: [ - 'IncorrectOwner', - `Incorrect account owner`, - ], - [MplTokenAuthRulesProgramErrorCode.PAYLOAD_VEC_INDEX_ERROR]: [ - 'PayloadVecIndexError', - `Could not index into PayloadVec`, - ], - [MplTokenAuthRulesProgramErrorCode.DERIVED_KEY_INVALID]: [ - 'DerivedKeyInvalid', - `Derived key invalid`, - ], - [MplTokenAuthRulesProgramErrorCode.ADDITIONAL_SIGNER_CHECK_FAILED]: [ - 'AdditionalSignerCheckFailed', - `Additional Signer check failed`, - ], - [MplTokenAuthRulesProgramErrorCode.PUBKEY_MATCH_CHECK_FAILED]: [ - 'PubkeyMatchCheckFailed', - `Pubkey Match check failed`, - ], - [MplTokenAuthRulesProgramErrorCode.DERIVED_KEY_MATCH_CHECK_FAILED]: [ - 'DerivedKeyMatchCheckFailed', - `Derived Key Match check failed`, - ], - [MplTokenAuthRulesProgramErrorCode.PROGRAM_OWNED_CHECK_FAILED]: [ - 'ProgramOwnedCheckFailed', - `Program Owned check failed`, - ], - [MplTokenAuthRulesProgramErrorCode.AMOUNT_CHECK_FAILED]: [ - 'AmountCheckFailed', - `Amount checked failed`, - ], - [MplTokenAuthRulesProgramErrorCode.FREQUENCY_CHECK_FAILED]: [ - 'FrequencyCheckFailed', - `Frequency check failed`, - ], - [MplTokenAuthRulesProgramErrorCode.PUBKEY_TREE_MATCH_CHECK_FAILED]: [ - 'PubkeyTreeMatchCheckFailed', - `Pubkey Tree Match check failed`, - ], - [MplTokenAuthRulesProgramErrorCode.PAYER_IS_NOT_SIGNER]: [ - 'PayerIsNotSigner', - `Payer is not a signer`, - ], - [MplTokenAuthRulesProgramErrorCode.NOT_IMPLEMENTED]: ['NotImplemented', ``], - [MplTokenAuthRulesProgramErrorCode.BORSH_SERIALIZATION_ERROR]: [ - 'BorshSerializationError', - `Borsh Serialization Error`, - ], + mplTokenAuthRulesErrorMessages = { + [MPL_TOKEN_AUTH_RULES_ERROR__ADDITIONAL_SIGNER_CHECK_FAILED]: `Additional Signer check failed`, + [MPL_TOKEN_AUTH_RULES_ERROR__AMOUNT_CHECK_FAILED]: `Amount checked failed`, + [MPL_TOKEN_AUTH_RULES_ERROR__BORSH_SERIALIZATION_ERROR]: `Borsh Serialization Error`, + [MPL_TOKEN_AUTH_RULES_ERROR__DATA_TYPE_MISMATCH]: `Data type mismatch`, + [MPL_TOKEN_AUTH_RULES_ERROR__DERIVED_KEY_INVALID]: `Derived key invalid`, + [MPL_TOKEN_AUTH_RULES_ERROR__DERIVED_KEY_MATCH_CHECK_FAILED]: `Derived Key Match check failed`, + [MPL_TOKEN_AUTH_RULES_ERROR__FREQUENCY_CHECK_FAILED]: `Frequency check failed`, + [MPL_TOKEN_AUTH_RULES_ERROR__INCORRECT_OWNER]: `Incorrect account owner`, + [MPL_TOKEN_AUTH_RULES_ERROR__NOT_IMPLEMENTED]: ``, + [MPL_TOKEN_AUTH_RULES_ERROR__NUMERICAL_OVERFLOW]: `Numerical Overflow`, + [MPL_TOKEN_AUTH_RULES_ERROR__PAYER_IS_NOT_SIGNER]: `Payer is not a signer`, + [MPL_TOKEN_AUTH_RULES_ERROR__PAYLOAD_VEC_INDEX_ERROR]: `Could not index into PayloadVec`, + [MPL_TOKEN_AUTH_RULES_ERROR__PROGRAM_OWNED_CHECK_FAILED]: `Program Owned check failed`, + [MPL_TOKEN_AUTH_RULES_ERROR__PUBKEY_MATCH_CHECK_FAILED]: `Pubkey Match check failed`, + [MPL_TOKEN_AUTH_RULES_ERROR__PUBKEY_TREE_MATCH_CHECK_FAILED]: `Pubkey Tree Match check failed`, }; } -export function getMplTokenAuthRulesProgramErrorFromCode( - code: MplTokenAuthRulesProgramErrorCode, - cause?: Error -): MplTokenAuthRulesProgramError { +export function getMplTokenAuthRulesErrorMessage( + code: MplTokenAuthRulesError +): string { if (__DEV__) { - return new MplTokenAuthRulesProgramError( - code, - ...( - mplTokenAuthRulesProgramErrorCodeMap as Record< - MplTokenAuthRulesProgramErrorCode, - [string, string] - > - )[code], - cause - ); + return ( + mplTokenAuthRulesErrorMessages as Record + )[code]; } - return new MplTokenAuthRulesProgramError( - code, - 'Unknown', - 'Error message not available in production bundles. Compile with __DEV__ set to true to see more information.', - cause - ); + return 'Error message not available in production bundles. Compile with `__DEV__` set to true to see more information.'; } diff --git a/test/packages/js-experimental/src/generated/errors/mplTokenMetadata.ts b/test/packages/js-experimental/src/generated/errors/mplTokenMetadata.ts index e27be9891..8f5202697 100644 --- a/test/packages/js-experimental/src/generated/errors/mplTokenMetadata.ts +++ b/test/packages/js-experimental/src/generated/errors/mplTokenMetadata.ts @@ -6,983 +6,629 @@ * @see https://github.com/metaplex-foundation/kinobi */ -export const enum MplTokenMetadataProgramErrorCode { - /** InstructionUnpackError: Failed to unpack instruction data */ - INSTRUCTION_UNPACK_ERROR = 0x0, // 0 - /** InstructionPackError: Failed to pack instruction data */ - INSTRUCTION_PACK_ERROR = 0x1, // 1 - /** NotRentExempt: Lamport balance below rent-exempt threshold */ - NOT_RENT_EXEMPT = 0x2, // 2 - /** AlreadyInitialized: Already initialized */ - ALREADY_INITIALIZED = 0x3, // 3 - /** Uninitialized: Uninitialized */ - UNINITIALIZED = 0x4, // 4 - /** InvalidMetadataKey: Metadata's key must match seed of ['metadata', program id, mint] provided */ - INVALID_METADATA_KEY = 0x5, // 5 - /** InvalidEditionKey: Edition's key must match seed of ['metadata', program id, name, 'edition'] provided */ - INVALID_EDITION_KEY = 0x6, // 6 - /** UpdateAuthorityIncorrect: Update Authority given does not match */ - UPDATE_AUTHORITY_INCORRECT = 0x7, // 7 - /** UpdateAuthorityIsNotSigner: Update Authority needs to be signer to update metadata */ - UPDATE_AUTHORITY_IS_NOT_SIGNER = 0x8, // 8 - /** NotMintAuthority: You must be the mint authority and signer on this transaction */ - NOT_MINT_AUTHORITY = 0x9, // 9 - /** InvalidMintAuthority: Mint authority provided does not match the authority on the mint */ - INVALID_MINT_AUTHORITY = 0xa, // 10 - /** NameTooLong: Name too long */ - NAME_TOO_LONG = 0xb, // 11 - /** SymbolTooLong: Symbol too long */ - SYMBOL_TOO_LONG = 0xc, // 12 - /** UriTooLong: URI too long */ - URI_TOO_LONG = 0xd, // 13 - /** UpdateAuthorityMustBeEqualToMetadataAuthorityAndSigner: Update authority must be equivalent to the metadata's authority and also signer of this transaction */ - UPDATE_AUTHORITY_MUST_BE_EQUAL_TO_METADATA_AUTHORITY_AND_SIGNER = 0xe, // 14 - /** MintMismatch: Mint given does not match mint on Metadata */ - MINT_MISMATCH = 0xf, // 15 - /** EditionsMustHaveExactlyOneToken: Editions must have exactly one token */ - EDITIONS_MUST_HAVE_EXACTLY_ONE_TOKEN = 0x10, // 16 - /** MaxEditionsMintedAlready: Maximum editions printed already */ - MAX_EDITIONS_MINTED_ALREADY = 0x11, // 17 - /** TokenMintToFailed: Token mint to failed */ - TOKEN_MINT_TO_FAILED = 0x12, // 18 - /** MasterRecordMismatch: The master edition record passed must match the master record on the edition given */ - MASTER_RECORD_MISMATCH = 0x13, // 19 - /** DestinationMintMismatch: The destination account does not have the right mint */ - DESTINATION_MINT_MISMATCH = 0x14, // 20 - /** EditionAlreadyMinted: An edition can only mint one of its kind! */ - EDITION_ALREADY_MINTED = 0x15, // 21 - /** PrintingMintDecimalsShouldBeZero: Printing mint decimals should be zero */ - PRINTING_MINT_DECIMALS_SHOULD_BE_ZERO = 0x16, // 22 - /** OneTimePrintingAuthorizationMintDecimalsShouldBeZero: OneTimePrintingAuthorization mint decimals should be zero */ - ONE_TIME_PRINTING_AUTHORIZATION_MINT_DECIMALS_SHOULD_BE_ZERO = 0x17, // 23 - /** EditionMintDecimalsShouldBeZero: EditionMintDecimalsShouldBeZero */ - EDITION_MINT_DECIMALS_SHOULD_BE_ZERO = 0x18, // 24 - /** TokenBurnFailed: Token burn failed */ - TOKEN_BURN_FAILED = 0x19, // 25 - /** TokenAccountOneTimeAuthMintMismatch: The One Time authorization mint does not match that on the token account! */ - TOKEN_ACCOUNT_ONE_TIME_AUTH_MINT_MISMATCH = 0x1a, // 26 - /** DerivedKeyInvalid: Derived key invalid */ - DERIVED_KEY_INVALID = 0x1b, // 27 - /** PrintingMintMismatch: The Printing mint does not match that on the master edition! */ - PRINTING_MINT_MISMATCH = 0x1c, // 28 - /** OneTimePrintingAuthMintMismatch: The One Time Printing Auth mint does not match that on the master edition! */ - ONE_TIME_PRINTING_AUTH_MINT_MISMATCH = 0x1d, // 29 - /** TokenAccountMintMismatch: The mint of the token account does not match the Printing mint! */ - TOKEN_ACCOUNT_MINT_MISMATCH = 0x1e, // 30 - /** TokenAccountMintMismatchV2: The mint of the token account does not match the master metadata mint! */ - TOKEN_ACCOUNT_MINT_MISMATCH_V2 = 0x1f, // 31 - /** NotEnoughTokens: Not enough tokens to mint a limited edition */ - NOT_ENOUGH_TOKENS = 0x20, // 32 - /** PrintingMintAuthorizationAccountMismatch: The mint on your authorization token holding account does not match your Printing mint! */ - PRINTING_MINT_AUTHORIZATION_ACCOUNT_MISMATCH = 0x21, // 33 - /** AuthorizationTokenAccountOwnerMismatch: The authorization token account has a different owner than the update authority for the master edition! */ - AUTHORIZATION_TOKEN_ACCOUNT_OWNER_MISMATCH = 0x22, // 34 - /** Disabled: This feature is currently disabled. */ - DISABLED = 0x23, // 35 - /** CreatorsTooLong: Creators list too long */ - CREATORS_TOO_LONG = 0x24, // 36 - /** CreatorsMustBeAtleastOne: Creators must be at least one if set */ - CREATORS_MUST_BE_ATLEAST_ONE = 0x25, // 37 - /** MustBeOneOfCreators: If using a creators array, you must be one of the creators listed */ - MUST_BE_ONE_OF_CREATORS = 0x26, // 38 - /** NoCreatorsPresentOnMetadata: This metadata does not have creators */ - NO_CREATORS_PRESENT_ON_METADATA = 0x27, // 39 - /** CreatorNotFound: This creator address was not found */ - CREATOR_NOT_FOUND = 0x28, // 40 - /** InvalidBasisPoints: Basis points cannot be more than 10000 */ - INVALID_BASIS_POINTS = 0x29, // 41 - /** PrimarySaleCanOnlyBeFlippedToTrue: Primary sale can only be flipped to true and is immutable */ - PRIMARY_SALE_CAN_ONLY_BE_FLIPPED_TO_TRUE = 0x2a, // 42 - /** OwnerMismatch: Owner does not match that on the account given */ - OWNER_MISMATCH = 0x2b, // 43 - /** NoBalanceInAccountForAuthorization: This account has no tokens to be used for authorization */ - NO_BALANCE_IN_ACCOUNT_FOR_AUTHORIZATION = 0x2c, // 44 - /** ShareTotalMustBe100: Share total must equal 100 for creator array */ - SHARE_TOTAL_MUST_BE100 = 0x2d, // 45 - /** ReservationExists: This reservation list already exists! */ - RESERVATION_EXISTS = 0x2e, // 46 - /** ReservationDoesNotExist: This reservation list does not exist! */ - RESERVATION_DOES_NOT_EXIST = 0x2f, // 47 - /** ReservationNotSet: This reservation list exists but was never set with reservations */ - RESERVATION_NOT_SET = 0x30, // 48 - /** ReservationAlreadyMade: This reservation list has already been set! */ - RESERVATION_ALREADY_MADE = 0x31, // 49 - /** BeyondMaxAddressSize: Provided more addresses than max allowed in single reservation */ - BEYOND_MAX_ADDRESS_SIZE = 0x32, // 50 - /** NumericalOverflowError: NumericalOverflowError */ - NUMERICAL_OVERFLOW_ERROR = 0x33, // 51 - /** ReservationBreachesMaximumSupply: This reservation would go beyond the maximum supply of the master edition! */ - RESERVATION_BREACHES_MAXIMUM_SUPPLY = 0x34, // 52 - /** AddressNotInReservation: Address not in reservation! */ - ADDRESS_NOT_IN_RESERVATION = 0x35, // 53 - /** CannotVerifyAnotherCreator: You cannot unilaterally verify another creator, they must sign */ - CANNOT_VERIFY_ANOTHER_CREATOR = 0x36, // 54 - /** CannotUnverifyAnotherCreator: You cannot unilaterally unverify another creator */ - CANNOT_UNVERIFY_ANOTHER_CREATOR = 0x37, // 55 - /** SpotMismatch: In initial reservation setting, spots remaining should equal total spots */ - SPOT_MISMATCH = 0x38, // 56 - /** IncorrectOwner: Incorrect account owner */ - INCORRECT_OWNER = 0x39, // 57 - /** PrintingWouldBreachMaximumSupply: printing these tokens would breach the maximum supply limit of the master edition */ - PRINTING_WOULD_BREACH_MAXIMUM_SUPPLY = 0x3a, // 58 - /** DataIsImmutable: Data is immutable */ - DATA_IS_IMMUTABLE = 0x3b, // 59 - /** DuplicateCreatorAddress: No duplicate creator addresses */ - DUPLICATE_CREATOR_ADDRESS = 0x3c, // 60 - /** ReservationSpotsRemainingShouldMatchTotalSpotsAtStart: Reservation spots remaining should match total spots when first being created */ - RESERVATION_SPOTS_REMAINING_SHOULD_MATCH_TOTAL_SPOTS_AT_START = 0x3d, // 61 - /** InvalidTokenProgram: Invalid token program */ - INVALID_TOKEN_PROGRAM = 0x3e, // 62 - /** DataTypeMismatch: Data type mismatch */ - DATA_TYPE_MISMATCH = 0x3f, // 63 - /** BeyondAlottedAddressSize: Beyond alotted address size in reservation! */ - BEYOND_ALOTTED_ADDRESS_SIZE = 0x40, // 64 - /** ReservationNotComplete: The reservation has only been partially alotted */ - RESERVATION_NOT_COMPLETE = 0x41, // 65 - /** TriedToReplaceAnExistingReservation: You cannot splice over an existing reservation! */ - TRIED_TO_REPLACE_AN_EXISTING_RESERVATION = 0x42, // 66 - /** InvalidOperation: Invalid operation */ - INVALID_OPERATION = 0x43, // 67 - /** InvalidOwner: Invalid Owner */ - INVALID_OWNER = 0x44, // 68 - /** PrintingMintSupplyMustBeZeroForConversion: Printing mint supply must be zero for conversion */ - PRINTING_MINT_SUPPLY_MUST_BE_ZERO_FOR_CONVERSION = 0x45, // 69 - /** OneTimeAuthMintSupplyMustBeZeroForConversion: One Time Auth mint supply must be zero for conversion */ - ONE_TIME_AUTH_MINT_SUPPLY_MUST_BE_ZERO_FOR_CONVERSION = 0x46, // 70 - /** InvalidEditionIndex: You tried to insert one edition too many into an edition mark pda */ - INVALID_EDITION_INDEX = 0x47, // 71 - /** ReservationArrayShouldBeSizeOne: In the legacy system the reservation needs to be of size one for cpu limit reasons */ - RESERVATION_ARRAY_SHOULD_BE_SIZE_ONE = 0x48, // 72 - /** IsMutableCanOnlyBeFlippedToFalse: Is Mutable can only be flipped to false */ - IS_MUTABLE_CAN_ONLY_BE_FLIPPED_TO_FALSE = 0x49, // 73 - /** CollectionCannotBeVerifiedInThisInstruction: Collection cannot be verified in this instruction */ - COLLECTION_CANNOT_BE_VERIFIED_IN_THIS_INSTRUCTION = 0x4a, // 74 - /** Removed: This instruction was deprecated in a previous release and is now removed */ - REMOVED = 0x4b, // 75 - /** MustBeBurned: This token use method is burn and there are no remaining uses, it must be burned */ - MUST_BE_BURNED = 0x4c, // 76 - /** InvalidUseMethod: This use method is invalid */ - INVALID_USE_METHOD = 0x4d, // 77 - /** CannotChangeUseMethodAfterFirstUse: Cannot Change Use Method after the first use */ - CANNOT_CHANGE_USE_METHOD_AFTER_FIRST_USE = 0x4e, // 78 - /** CannotChangeUsesAfterFirstUse: Cannot Change Remaining or Available uses after the first use */ - CANNOT_CHANGE_USES_AFTER_FIRST_USE = 0x4f, // 79 - /** CollectionNotFound: Collection Not Found on Metadata */ - COLLECTION_NOT_FOUND = 0x50, // 80 - /** InvalidCollectionUpdateAuthority: Collection Update Authority is invalid */ - INVALID_COLLECTION_UPDATE_AUTHORITY = 0x51, // 81 - /** CollectionMustBeAUniqueMasterEdition: Collection Must Be a Unique Master Edition v2 */ - COLLECTION_MUST_BE_A_UNIQUE_MASTER_EDITION = 0x52, // 82 - /** UseAuthorityRecordAlreadyExists: The Use Authority Record Already Exists, to modify it Revoke, then Approve */ - USE_AUTHORITY_RECORD_ALREADY_EXISTS = 0x53, // 83 - /** UseAuthorityRecordAlreadyRevoked: The Use Authority Record is empty or already revoked */ - USE_AUTHORITY_RECORD_ALREADY_REVOKED = 0x54, // 84 - /** Unusable: This token has no uses */ - UNUSABLE = 0x55, // 85 - /** NotEnoughUses: There are not enough Uses left on this token. */ - NOT_ENOUGH_USES = 0x56, // 86 - /** CollectionAuthorityRecordAlreadyExists: This Collection Authority Record Already Exists. */ - COLLECTION_AUTHORITY_RECORD_ALREADY_EXISTS = 0x57, // 87 - /** CollectionAuthorityDoesNotExist: This Collection Authority Record Does Not Exist. */ - COLLECTION_AUTHORITY_DOES_NOT_EXIST = 0x58, // 88 - /** InvalidUseAuthorityRecord: This Use Authority Record is invalid. */ - INVALID_USE_AUTHORITY_RECORD = 0x59, // 89 - /** InvalidCollectionAuthorityRecord: This Collection Authority Record is invalid. */ - INVALID_COLLECTION_AUTHORITY_RECORD = 0x5a, // 90 - /** InvalidFreezeAuthority: Metadata does not match the freeze authority on the mint */ - INVALID_FREEZE_AUTHORITY = 0x5b, // 91 - /** InvalidDelegate: All tokens in this account have not been delegated to this user. */ - INVALID_DELEGATE = 0x5c, // 92 - /** CannotAdjustVerifiedCreator: Creator can not be adjusted once they are verified. */ - CANNOT_ADJUST_VERIFIED_CREATOR = 0x5d, // 93 - /** CannotRemoveVerifiedCreator: Verified creators cannot be removed. */ - CANNOT_REMOVE_VERIFIED_CREATOR = 0x5e, // 94 - /** CannotWipeVerifiedCreators: Can not wipe verified creators. */ - CANNOT_WIPE_VERIFIED_CREATORS = 0x5f, // 95 - /** NotAllowedToChangeSellerFeeBasisPoints: Not allowed to change seller fee basis points. */ - NOT_ALLOWED_TO_CHANGE_SELLER_FEE_BASIS_POINTS = 0x60, // 96 - /** EditionOverrideCannotBeZero: Edition override cannot be zero */ - EDITION_OVERRIDE_CANNOT_BE_ZERO = 0x61, // 97 - /** InvalidUser: Invalid User */ - INVALID_USER = 0x62, // 98 - /** RevokeCollectionAuthoritySignerIncorrect: Revoke Collection Authority signer is incorrect */ - REVOKE_COLLECTION_AUTHORITY_SIGNER_INCORRECT = 0x63, // 99 - /** TokenCloseFailed: Token close failed */ - TOKEN_CLOSE_FAILED = 0x64, // 100 - /** UnsizedCollection: Can't use this function on unsized collection */ - UNSIZED_COLLECTION = 0x65, // 101 - /** SizedCollection: Can't use this function on a sized collection */ - SIZED_COLLECTION = 0x66, // 102 - /** MissingCollectionMetadata: Can't burn a verified member of a collection w/o providing collection metadata account */ - MISSING_COLLECTION_METADATA = 0x67, // 103 - /** NotAMemberOfCollection: This NFT is not a member of the specified collection. */ - NOT_A_MEMBER_OF_COLLECTION = 0x68, // 104 - /** NotVerifiedMemberOfCollection: This NFT is not a verified member of the specified collection. */ - NOT_VERIFIED_MEMBER_OF_COLLECTION = 0x69, // 105 - /** NotACollectionParent: This NFT is not a collection parent NFT. */ - NOT_A_COLLECTION_PARENT = 0x6a, // 106 - /** CouldNotDetermineTokenStandard: Could not determine a TokenStandard type. */ - COULD_NOT_DETERMINE_TOKEN_STANDARD = 0x6b, // 107 - /** MissingEditionAccount: This mint account has an edition but none was provided. */ - MISSING_EDITION_ACCOUNT = 0x6c, // 108 - /** NotAMasterEdition: This edition is not a Master Edition */ - NOT_A_MASTER_EDITION = 0x6d, // 109 - /** MasterEditionHasPrints: This Master Edition has existing prints */ - MASTER_EDITION_HAS_PRINTS = 0x6e, // 110 - /** BorshDeserializationError: Borsh Deserialization Error */ - BORSH_DESERIALIZATION_ERROR = 0x6f, // 111 - /** CannotUpdateVerifiedCollection: Cannot update a verified collection in this command */ - CANNOT_UPDATE_VERIFIED_COLLECTION = 0x70, // 112 - /** CollectionMasterEditionAccountInvalid: Edition account doesnt match collection */ - COLLECTION_MASTER_EDITION_ACCOUNT_INVALID = 0x71, // 113 - /** AlreadyVerified: Item is already verified. */ - ALREADY_VERIFIED = 0x72, // 114 - /** AlreadyUnverified: Item is already unverified. */ - ALREADY_UNVERIFIED = 0x73, // 115 - /** NotAPrintEdition: This edition is not a Print Edition */ - NOT_A_PRINT_EDITION = 0x74, // 116 - /** InvalidMasterEdition: Invalid Master Edition */ - INVALID_MASTER_EDITION = 0x75, // 117 - /** InvalidPrintEdition: Invalid Print Edition */ - INVALID_PRINT_EDITION = 0x76, // 118 - /** InvalidEditionMarker: Invalid Edition Marker */ - INVALID_EDITION_MARKER = 0x77, // 119 - /** ReservationListDeprecated: Reservation List is Deprecated */ - RESERVATION_LIST_DEPRECATED = 0x78, // 120 - /** PrintEditionDoesNotMatchMasterEdition: Print Edition does not match Master Edition */ - PRINT_EDITION_DOES_NOT_MATCH_MASTER_EDITION = 0x79, // 121 - /** EditionNumberGreaterThanMaxSupply: Edition Number greater than max supply */ - EDITION_NUMBER_GREATER_THAN_MAX_SUPPLY = 0x7a, // 122 - /** MustUnverify: Must unverify before migrating collections. */ - MUST_UNVERIFY = 0x7b, // 123 - /** InvalidEscrowBumpSeed: Invalid Escrow Account Bump Seed */ - INVALID_ESCROW_BUMP_SEED = 0x7c, // 124 - /** MustBeEscrowAuthority: Must Escrow Authority */ - MUST_BE_ESCROW_AUTHORITY = 0x7d, // 125 - /** InvalidSystemProgram: Invalid System Program */ - INVALID_SYSTEM_PROGRAM = 0x7e, // 126 - /** MustBeNonFungible: Must be a Non Fungible Token */ - MUST_BE_NON_FUNGIBLE = 0x7f, // 127 - /** InsufficientTokens: Insufficient tokens for transfer */ - INSUFFICIENT_TOKENS = 0x80, // 128 - /** BorshSerializationError: Borsh Serialization Error */ - BORSH_SERIALIZATION_ERROR = 0x81, // 129 - /** NoFreezeAuthoritySet: Cannot create NFT with no Freeze Authority. */ - NO_FREEZE_AUTHORITY_SET = 0x82, // 130 - /** InvalidCollectionSizeChange: Invalid collection size change */ - INVALID_COLLECTION_SIZE_CHANGE = 0x83, // 131 - /** InvalidBubblegumSigner: Invalid bubblegum signer */ - INVALID_BUBBLEGUM_SIGNER = 0x84, // 132 - /** MintIsNotSigner: Mint needs to be signer to initialize the account */ - MINT_IS_NOT_SIGNER = 0x85, // 133 - /** InvalidTokenStandard: Invalid token standard */ - INVALID_TOKEN_STANDARD = 0x86, // 134 - /** InvalidMintForTokenStandard: Invalid mint account for specified token standard */ - INVALID_MINT_FOR_TOKEN_STANDARD = 0x87, // 135 - /** InvalidAuthorizationRules: Invalid authorization rules account */ - INVALID_AUTHORIZATION_RULES = 0x88, // 136 - /** MissingAuthorizationRules: Missing authorization rules account */ - MISSING_AUTHORIZATION_RULES = 0x89, // 137 - /** MissingProgrammableConfig: Missing programmable configuration */ - MISSING_PROGRAMMABLE_CONFIG = 0x8a, // 138 - /** InvalidProgrammableConfig: Invalid programmable configuration */ - INVALID_PROGRAMMABLE_CONFIG = 0x8b, // 139 - /** DelegateAlreadyExists: Delegate already exists */ - DELEGATE_ALREADY_EXISTS = 0x8c, // 140 - /** DelegateNotFound: Delegate not found */ - DELEGATE_NOT_FOUND = 0x8d, // 141 - /** MissingAccountInBuilder: Required account not set in instruction builder */ - MISSING_ACCOUNT_IN_BUILDER = 0x8e, // 142 - /** MissingArgumentInBuilder: Required argument not set in instruction builder */ - MISSING_ARGUMENT_IN_BUILDER = 0x8f, // 143 - /** FeatureNotSupported: Feature not supported currently */ - FEATURE_NOT_SUPPORTED = 0x90, // 144 - /** InvalidSystemWallet: Invalid system wallet */ - INVALID_SYSTEM_WALLET = 0x91, // 145 - /** OnlySaleDelegateCanTransfer: Only the sale delegate can transfer while its set */ - ONLY_SALE_DELEGATE_CAN_TRANSFER = 0x92, // 146 - /** MissingTokenAccount: Missing token account */ - MISSING_TOKEN_ACCOUNT = 0x93, // 147 - /** MissingSplTokenProgram: Missing SPL token program */ - MISSING_SPL_TOKEN_PROGRAM = 0x94, // 148 - /** MissingAuthorizationRulesProgram: Missing SPL token program */ - MISSING_AUTHORIZATION_RULES_PROGRAM = 0x95, // 149 - /** InvalidDelegateRoleForTransfer: Invalid delegate role for transfer */ - INVALID_DELEGATE_ROLE_FOR_TRANSFER = 0x96, // 150 -} - -export class MplTokenMetadataProgramError extends Error { - override readonly name = 'MplTokenMetadataProgramError'; - - readonly code: MplTokenMetadataProgramErrorCode; +/** InstructionUnpackError: Failed to unpack instruction data */ +export const MPL_TOKEN_METADATA_ERROR__INSTRUCTION_UNPACK_ERROR = 0x0; // 0 +/** InstructionPackError: Failed to pack instruction data */ +export const MPL_TOKEN_METADATA_ERROR__INSTRUCTION_PACK_ERROR = 0x1; // 1 +/** NotRentExempt: Lamport balance below rent-exempt threshold */ +export const MPL_TOKEN_METADATA_ERROR__NOT_RENT_EXEMPT = 0x2; // 2 +/** AlreadyInitialized: Already initialized */ +export const MPL_TOKEN_METADATA_ERROR__ALREADY_INITIALIZED = 0x3; // 3 +/** Uninitialized: Uninitialized */ +export const MPL_TOKEN_METADATA_ERROR__UNINITIALIZED = 0x4; // 4 +/** InvalidMetadataKey: Metadata's key must match seed of ['metadata', program id, mint] provided */ +export const MPL_TOKEN_METADATA_ERROR__INVALID_METADATA_KEY = 0x5; // 5 +/** InvalidEditionKey: Edition's key must match seed of ['metadata', program id, name, 'edition'] provided */ +export const MPL_TOKEN_METADATA_ERROR__INVALID_EDITION_KEY = 0x6; // 6 +/** UpdateAuthorityIncorrect: Update Authority given does not match */ +export const MPL_TOKEN_METADATA_ERROR__UPDATE_AUTHORITY_INCORRECT = 0x7; // 7 +/** UpdateAuthorityIsNotSigner: Update Authority needs to be signer to update metadata */ +export const MPL_TOKEN_METADATA_ERROR__UPDATE_AUTHORITY_IS_NOT_SIGNER = 0x8; // 8 +/** NotMintAuthority: You must be the mint authority and signer on this transaction */ +export const MPL_TOKEN_METADATA_ERROR__NOT_MINT_AUTHORITY = 0x9; // 9 +/** InvalidMintAuthority: Mint authority provided does not match the authority on the mint */ +export const MPL_TOKEN_METADATA_ERROR__INVALID_MINT_AUTHORITY = 0xa; // 10 +/** NameTooLong: Name too long */ +export const MPL_TOKEN_METADATA_ERROR__NAME_TOO_LONG = 0xb; // 11 +/** SymbolTooLong: Symbol too long */ +export const MPL_TOKEN_METADATA_ERROR__SYMBOL_TOO_LONG = 0xc; // 12 +/** UriTooLong: URI too long */ +export const MPL_TOKEN_METADATA_ERROR__URI_TOO_LONG = 0xd; // 13 +/** UpdateAuthorityMustBeEqualToMetadataAuthorityAndSigner: Update authority must be equivalent to the metadata's authority and also signer of this transaction */ +export const MPL_TOKEN_METADATA_ERROR__UPDATE_AUTHORITY_MUST_BE_EQUAL_TO_METADATA_AUTHORITY_AND_SIGNER = 0xe; // 14 +/** MintMismatch: Mint given does not match mint on Metadata */ +export const MPL_TOKEN_METADATA_ERROR__MINT_MISMATCH = 0xf; // 15 +/** EditionsMustHaveExactlyOneToken: Editions must have exactly one token */ +export const MPL_TOKEN_METADATA_ERROR__EDITIONS_MUST_HAVE_EXACTLY_ONE_TOKEN = 0x10; // 16 +/** MaxEditionsMintedAlready: Maximum editions printed already */ +export const MPL_TOKEN_METADATA_ERROR__MAX_EDITIONS_MINTED_ALREADY = 0x11; // 17 +/** TokenMintToFailed: Token mint to failed */ +export const MPL_TOKEN_METADATA_ERROR__TOKEN_MINT_TO_FAILED = 0x12; // 18 +/** MasterRecordMismatch: The master edition record passed must match the master record on the edition given */ +export const MPL_TOKEN_METADATA_ERROR__MASTER_RECORD_MISMATCH = 0x13; // 19 +/** DestinationMintMismatch: The destination account does not have the right mint */ +export const MPL_TOKEN_METADATA_ERROR__DESTINATION_MINT_MISMATCH = 0x14; // 20 +/** EditionAlreadyMinted: An edition can only mint one of its kind! */ +export const MPL_TOKEN_METADATA_ERROR__EDITION_ALREADY_MINTED = 0x15; // 21 +/** PrintingMintDecimalsShouldBeZero: Printing mint decimals should be zero */ +export const MPL_TOKEN_METADATA_ERROR__PRINTING_MINT_DECIMALS_SHOULD_BE_ZERO = 0x16; // 22 +/** OneTimePrintingAuthorizationMintDecimalsShouldBeZero: OneTimePrintingAuthorization mint decimals should be zero */ +export const MPL_TOKEN_METADATA_ERROR__ONE_TIME_PRINTING_AUTHORIZATION_MINT_DECIMALS_SHOULD_BE_ZERO = 0x17; // 23 +/** EditionMintDecimalsShouldBeZero: EditionMintDecimalsShouldBeZero */ +export const MPL_TOKEN_METADATA_ERROR__EDITION_MINT_DECIMALS_SHOULD_BE_ZERO = 0x18; // 24 +/** TokenBurnFailed: Token burn failed */ +export const MPL_TOKEN_METADATA_ERROR__TOKEN_BURN_FAILED = 0x19; // 25 +/** TokenAccountOneTimeAuthMintMismatch: The One Time authorization mint does not match that on the token account! */ +export const MPL_TOKEN_METADATA_ERROR__TOKEN_ACCOUNT_ONE_TIME_AUTH_MINT_MISMATCH = 0x1a; // 26 +/** DerivedKeyInvalid: Derived key invalid */ +export const MPL_TOKEN_METADATA_ERROR__DERIVED_KEY_INVALID = 0x1b; // 27 +/** PrintingMintMismatch: The Printing mint does not match that on the master edition! */ +export const MPL_TOKEN_METADATA_ERROR__PRINTING_MINT_MISMATCH = 0x1c; // 28 +/** OneTimePrintingAuthMintMismatch: The One Time Printing Auth mint does not match that on the master edition! */ +export const MPL_TOKEN_METADATA_ERROR__ONE_TIME_PRINTING_AUTH_MINT_MISMATCH = 0x1d; // 29 +/** TokenAccountMintMismatch: The mint of the token account does not match the Printing mint! */ +export const MPL_TOKEN_METADATA_ERROR__TOKEN_ACCOUNT_MINT_MISMATCH = 0x1e; // 30 +/** TokenAccountMintMismatchV2: The mint of the token account does not match the master metadata mint! */ +export const MPL_TOKEN_METADATA_ERROR__TOKEN_ACCOUNT_MINT_MISMATCH_V2 = 0x1f; // 31 +/** NotEnoughTokens: Not enough tokens to mint a limited edition */ +export const MPL_TOKEN_METADATA_ERROR__NOT_ENOUGH_TOKENS = 0x20; // 32 +/** PrintingMintAuthorizationAccountMismatch: The mint on your authorization token holding account does not match your Printing mint! */ +export const MPL_TOKEN_METADATA_ERROR__PRINTING_MINT_AUTHORIZATION_ACCOUNT_MISMATCH = 0x21; // 33 +/** AuthorizationTokenAccountOwnerMismatch: The authorization token account has a different owner than the update authority for the master edition! */ +export const MPL_TOKEN_METADATA_ERROR__AUTHORIZATION_TOKEN_ACCOUNT_OWNER_MISMATCH = 0x22; // 34 +/** Disabled: This feature is currently disabled. */ +export const MPL_TOKEN_METADATA_ERROR__DISABLED = 0x23; // 35 +/** CreatorsTooLong: Creators list too long */ +export const MPL_TOKEN_METADATA_ERROR__CREATORS_TOO_LONG = 0x24; // 36 +/** CreatorsMustBeAtleastOne: Creators must be at least one if set */ +export const MPL_TOKEN_METADATA_ERROR__CREATORS_MUST_BE_ATLEAST_ONE = 0x25; // 37 +/** MustBeOneOfCreators: If using a creators array, you must be one of the creators listed */ +export const MPL_TOKEN_METADATA_ERROR__MUST_BE_ONE_OF_CREATORS = 0x26; // 38 +/** NoCreatorsPresentOnMetadata: This metadata does not have creators */ +export const MPL_TOKEN_METADATA_ERROR__NO_CREATORS_PRESENT_ON_METADATA = 0x27; // 39 +/** CreatorNotFound: This creator address was not found */ +export const MPL_TOKEN_METADATA_ERROR__CREATOR_NOT_FOUND = 0x28; // 40 +/** InvalidBasisPoints: Basis points cannot be more than 10000 */ +export const MPL_TOKEN_METADATA_ERROR__INVALID_BASIS_POINTS = 0x29; // 41 +/** PrimarySaleCanOnlyBeFlippedToTrue: Primary sale can only be flipped to true and is immutable */ +export const MPL_TOKEN_METADATA_ERROR__PRIMARY_SALE_CAN_ONLY_BE_FLIPPED_TO_TRUE = 0x2a; // 42 +/** OwnerMismatch: Owner does not match that on the account given */ +export const MPL_TOKEN_METADATA_ERROR__OWNER_MISMATCH = 0x2b; // 43 +/** NoBalanceInAccountForAuthorization: This account has no tokens to be used for authorization */ +export const MPL_TOKEN_METADATA_ERROR__NO_BALANCE_IN_ACCOUNT_FOR_AUTHORIZATION = 0x2c; // 44 +/** ShareTotalMustBe100: Share total must equal 100 for creator array */ +export const MPL_TOKEN_METADATA_ERROR__SHARE_TOTAL_MUST_BE100 = 0x2d; // 45 +/** ReservationExists: This reservation list already exists! */ +export const MPL_TOKEN_METADATA_ERROR__RESERVATION_EXISTS = 0x2e; // 46 +/** ReservationDoesNotExist: This reservation list does not exist! */ +export const MPL_TOKEN_METADATA_ERROR__RESERVATION_DOES_NOT_EXIST = 0x2f; // 47 +/** ReservationNotSet: This reservation list exists but was never set with reservations */ +export const MPL_TOKEN_METADATA_ERROR__RESERVATION_NOT_SET = 0x30; // 48 +/** ReservationAlreadyMade: This reservation list has already been set! */ +export const MPL_TOKEN_METADATA_ERROR__RESERVATION_ALREADY_MADE = 0x31; // 49 +/** BeyondMaxAddressSize: Provided more addresses than max allowed in single reservation */ +export const MPL_TOKEN_METADATA_ERROR__BEYOND_MAX_ADDRESS_SIZE = 0x32; // 50 +/** NumericalOverflowError: NumericalOverflowError */ +export const MPL_TOKEN_METADATA_ERROR__NUMERICAL_OVERFLOW_ERROR = 0x33; // 51 +/** ReservationBreachesMaximumSupply: This reservation would go beyond the maximum supply of the master edition! */ +export const MPL_TOKEN_METADATA_ERROR__RESERVATION_BREACHES_MAXIMUM_SUPPLY = 0x34; // 52 +/** AddressNotInReservation: Address not in reservation! */ +export const MPL_TOKEN_METADATA_ERROR__ADDRESS_NOT_IN_RESERVATION = 0x35; // 53 +/** CannotVerifyAnotherCreator: You cannot unilaterally verify another creator, they must sign */ +export const MPL_TOKEN_METADATA_ERROR__CANNOT_VERIFY_ANOTHER_CREATOR = 0x36; // 54 +/** CannotUnverifyAnotherCreator: You cannot unilaterally unverify another creator */ +export const MPL_TOKEN_METADATA_ERROR__CANNOT_UNVERIFY_ANOTHER_CREATOR = 0x37; // 55 +/** SpotMismatch: In initial reservation setting, spots remaining should equal total spots */ +export const MPL_TOKEN_METADATA_ERROR__SPOT_MISMATCH = 0x38; // 56 +/** IncorrectOwner: Incorrect account owner */ +export const MPL_TOKEN_METADATA_ERROR__INCORRECT_OWNER = 0x39; // 57 +/** PrintingWouldBreachMaximumSupply: printing these tokens would breach the maximum supply limit of the master edition */ +export const MPL_TOKEN_METADATA_ERROR__PRINTING_WOULD_BREACH_MAXIMUM_SUPPLY = 0x3a; // 58 +/** DataIsImmutable: Data is immutable */ +export const MPL_TOKEN_METADATA_ERROR__DATA_IS_IMMUTABLE = 0x3b; // 59 +/** DuplicateCreatorAddress: No duplicate creator addresses */ +export const MPL_TOKEN_METADATA_ERROR__DUPLICATE_CREATOR_ADDRESS = 0x3c; // 60 +/** ReservationSpotsRemainingShouldMatchTotalSpotsAtStart: Reservation spots remaining should match total spots when first being created */ +export const MPL_TOKEN_METADATA_ERROR__RESERVATION_SPOTS_REMAINING_SHOULD_MATCH_TOTAL_SPOTS_AT_START = 0x3d; // 61 +/** InvalidTokenProgram: Invalid token program */ +export const MPL_TOKEN_METADATA_ERROR__INVALID_TOKEN_PROGRAM = 0x3e; // 62 +/** DataTypeMismatch: Data type mismatch */ +export const MPL_TOKEN_METADATA_ERROR__DATA_TYPE_MISMATCH = 0x3f; // 63 +/** BeyondAlottedAddressSize: Beyond alotted address size in reservation! */ +export const MPL_TOKEN_METADATA_ERROR__BEYOND_ALOTTED_ADDRESS_SIZE = 0x40; // 64 +/** ReservationNotComplete: The reservation has only been partially alotted */ +export const MPL_TOKEN_METADATA_ERROR__RESERVATION_NOT_COMPLETE = 0x41; // 65 +/** TriedToReplaceAnExistingReservation: You cannot splice over an existing reservation! */ +export const MPL_TOKEN_METADATA_ERROR__TRIED_TO_REPLACE_AN_EXISTING_RESERVATION = 0x42; // 66 +/** InvalidOperation: Invalid operation */ +export const MPL_TOKEN_METADATA_ERROR__INVALID_OPERATION = 0x43; // 67 +/** InvalidOwner: Invalid Owner */ +export const MPL_TOKEN_METADATA_ERROR__INVALID_OWNER = 0x44; // 68 +/** PrintingMintSupplyMustBeZeroForConversion: Printing mint supply must be zero for conversion */ +export const MPL_TOKEN_METADATA_ERROR__PRINTING_MINT_SUPPLY_MUST_BE_ZERO_FOR_CONVERSION = 0x45; // 69 +/** OneTimeAuthMintSupplyMustBeZeroForConversion: One Time Auth mint supply must be zero for conversion */ +export const MPL_TOKEN_METADATA_ERROR__ONE_TIME_AUTH_MINT_SUPPLY_MUST_BE_ZERO_FOR_CONVERSION = 0x46; // 70 +/** InvalidEditionIndex: You tried to insert one edition too many into an edition mark pda */ +export const MPL_TOKEN_METADATA_ERROR__INVALID_EDITION_INDEX = 0x47; // 71 +/** ReservationArrayShouldBeSizeOne: In the legacy system the reservation needs to be of size one for cpu limit reasons */ +export const MPL_TOKEN_METADATA_ERROR__RESERVATION_ARRAY_SHOULD_BE_SIZE_ONE = 0x48; // 72 +/** IsMutableCanOnlyBeFlippedToFalse: Is Mutable can only be flipped to false */ +export const MPL_TOKEN_METADATA_ERROR__IS_MUTABLE_CAN_ONLY_BE_FLIPPED_TO_FALSE = 0x49; // 73 +/** CollectionCannotBeVerifiedInThisInstruction: Collection cannot be verified in this instruction */ +export const MPL_TOKEN_METADATA_ERROR__COLLECTION_CANNOT_BE_VERIFIED_IN_THIS_INSTRUCTION = 0x4a; // 74 +/** Removed: This instruction was deprecated in a previous release and is now removed */ +export const MPL_TOKEN_METADATA_ERROR__REMOVED = 0x4b; // 75 +/** MustBeBurned: This token use method is burn and there are no remaining uses, it must be burned */ +export const MPL_TOKEN_METADATA_ERROR__MUST_BE_BURNED = 0x4c; // 76 +/** InvalidUseMethod: This use method is invalid */ +export const MPL_TOKEN_METADATA_ERROR__INVALID_USE_METHOD = 0x4d; // 77 +/** CannotChangeUseMethodAfterFirstUse: Cannot Change Use Method after the first use */ +export const MPL_TOKEN_METADATA_ERROR__CANNOT_CHANGE_USE_METHOD_AFTER_FIRST_USE = 0x4e; // 78 +/** CannotChangeUsesAfterFirstUse: Cannot Change Remaining or Available uses after the first use */ +export const MPL_TOKEN_METADATA_ERROR__CANNOT_CHANGE_USES_AFTER_FIRST_USE = 0x4f; // 79 +/** CollectionNotFound: Collection Not Found on Metadata */ +export const MPL_TOKEN_METADATA_ERROR__COLLECTION_NOT_FOUND = 0x50; // 80 +/** InvalidCollectionUpdateAuthority: Collection Update Authority is invalid */ +export const MPL_TOKEN_METADATA_ERROR__INVALID_COLLECTION_UPDATE_AUTHORITY = 0x51; // 81 +/** CollectionMustBeAUniqueMasterEdition: Collection Must Be a Unique Master Edition v2 */ +export const MPL_TOKEN_METADATA_ERROR__COLLECTION_MUST_BE_A_UNIQUE_MASTER_EDITION = 0x52; // 82 +/** UseAuthorityRecordAlreadyExists: The Use Authority Record Already Exists, to modify it Revoke, then Approve */ +export const MPL_TOKEN_METADATA_ERROR__USE_AUTHORITY_RECORD_ALREADY_EXISTS = 0x53; // 83 +/** UseAuthorityRecordAlreadyRevoked: The Use Authority Record is empty or already revoked */ +export const MPL_TOKEN_METADATA_ERROR__USE_AUTHORITY_RECORD_ALREADY_REVOKED = 0x54; // 84 +/** Unusable: This token has no uses */ +export const MPL_TOKEN_METADATA_ERROR__UNUSABLE = 0x55; // 85 +/** NotEnoughUses: There are not enough Uses left on this token. */ +export const MPL_TOKEN_METADATA_ERROR__NOT_ENOUGH_USES = 0x56; // 86 +/** CollectionAuthorityRecordAlreadyExists: This Collection Authority Record Already Exists. */ +export const MPL_TOKEN_METADATA_ERROR__COLLECTION_AUTHORITY_RECORD_ALREADY_EXISTS = 0x57; // 87 +/** CollectionAuthorityDoesNotExist: This Collection Authority Record Does Not Exist. */ +export const MPL_TOKEN_METADATA_ERROR__COLLECTION_AUTHORITY_DOES_NOT_EXIST = 0x58; // 88 +/** InvalidUseAuthorityRecord: This Use Authority Record is invalid. */ +export const MPL_TOKEN_METADATA_ERROR__INVALID_USE_AUTHORITY_RECORD = 0x59; // 89 +/** InvalidCollectionAuthorityRecord: This Collection Authority Record is invalid. */ +export const MPL_TOKEN_METADATA_ERROR__INVALID_COLLECTION_AUTHORITY_RECORD = 0x5a; // 90 +/** InvalidFreezeAuthority: Metadata does not match the freeze authority on the mint */ +export const MPL_TOKEN_METADATA_ERROR__INVALID_FREEZE_AUTHORITY = 0x5b; // 91 +/** InvalidDelegate: All tokens in this account have not been delegated to this user. */ +export const MPL_TOKEN_METADATA_ERROR__INVALID_DELEGATE = 0x5c; // 92 +/** CannotAdjustVerifiedCreator: Creator can not be adjusted once they are verified. */ +export const MPL_TOKEN_METADATA_ERROR__CANNOT_ADJUST_VERIFIED_CREATOR = 0x5d; // 93 +/** CannotRemoveVerifiedCreator: Verified creators cannot be removed. */ +export const MPL_TOKEN_METADATA_ERROR__CANNOT_REMOVE_VERIFIED_CREATOR = 0x5e; // 94 +/** CannotWipeVerifiedCreators: Can not wipe verified creators. */ +export const MPL_TOKEN_METADATA_ERROR__CANNOT_WIPE_VERIFIED_CREATORS = 0x5f; // 95 +/** NotAllowedToChangeSellerFeeBasisPoints: Not allowed to change seller fee basis points. */ +export const MPL_TOKEN_METADATA_ERROR__NOT_ALLOWED_TO_CHANGE_SELLER_FEE_BASIS_POINTS = 0x60; // 96 +/** EditionOverrideCannotBeZero: Edition override cannot be zero */ +export const MPL_TOKEN_METADATA_ERROR__EDITION_OVERRIDE_CANNOT_BE_ZERO = 0x61; // 97 +/** InvalidUser: Invalid User */ +export const MPL_TOKEN_METADATA_ERROR__INVALID_USER = 0x62; // 98 +/** RevokeCollectionAuthoritySignerIncorrect: Revoke Collection Authority signer is incorrect */ +export const MPL_TOKEN_METADATA_ERROR__REVOKE_COLLECTION_AUTHORITY_SIGNER_INCORRECT = 0x63; // 99 +/** TokenCloseFailed: Token close failed */ +export const MPL_TOKEN_METADATA_ERROR__TOKEN_CLOSE_FAILED = 0x64; // 100 +/** UnsizedCollection: Can't use this function on unsized collection */ +export const MPL_TOKEN_METADATA_ERROR__UNSIZED_COLLECTION = 0x65; // 101 +/** SizedCollection: Can't use this function on a sized collection */ +export const MPL_TOKEN_METADATA_ERROR__SIZED_COLLECTION = 0x66; // 102 +/** MissingCollectionMetadata: Can't burn a verified member of a collection w/o providing collection metadata account */ +export const MPL_TOKEN_METADATA_ERROR__MISSING_COLLECTION_METADATA = 0x67; // 103 +/** NotAMemberOfCollection: This NFT is not a member of the specified collection. */ +export const MPL_TOKEN_METADATA_ERROR__NOT_A_MEMBER_OF_COLLECTION = 0x68; // 104 +/** NotVerifiedMemberOfCollection: This NFT is not a verified member of the specified collection. */ +export const MPL_TOKEN_METADATA_ERROR__NOT_VERIFIED_MEMBER_OF_COLLECTION = 0x69; // 105 +/** NotACollectionParent: This NFT is not a collection parent NFT. */ +export const MPL_TOKEN_METADATA_ERROR__NOT_A_COLLECTION_PARENT = 0x6a; // 106 +/** CouldNotDetermineTokenStandard: Could not determine a TokenStandard type. */ +export const MPL_TOKEN_METADATA_ERROR__COULD_NOT_DETERMINE_TOKEN_STANDARD = 0x6b; // 107 +/** MissingEditionAccount: This mint account has an edition but none was provided. */ +export const MPL_TOKEN_METADATA_ERROR__MISSING_EDITION_ACCOUNT = 0x6c; // 108 +/** NotAMasterEdition: This edition is not a Master Edition */ +export const MPL_TOKEN_METADATA_ERROR__NOT_A_MASTER_EDITION = 0x6d; // 109 +/** MasterEditionHasPrints: This Master Edition has existing prints */ +export const MPL_TOKEN_METADATA_ERROR__MASTER_EDITION_HAS_PRINTS = 0x6e; // 110 +/** BorshDeserializationError: Borsh Deserialization Error */ +export const MPL_TOKEN_METADATA_ERROR__BORSH_DESERIALIZATION_ERROR = 0x6f; // 111 +/** CannotUpdateVerifiedCollection: Cannot update a verified collection in this command */ +export const MPL_TOKEN_METADATA_ERROR__CANNOT_UPDATE_VERIFIED_COLLECTION = 0x70; // 112 +/** CollectionMasterEditionAccountInvalid: Edition account doesnt match collection */ +export const MPL_TOKEN_METADATA_ERROR__COLLECTION_MASTER_EDITION_ACCOUNT_INVALID = 0x71; // 113 +/** AlreadyVerified: Item is already verified. */ +export const MPL_TOKEN_METADATA_ERROR__ALREADY_VERIFIED = 0x72; // 114 +/** AlreadyUnverified: Item is already unverified. */ +export const MPL_TOKEN_METADATA_ERROR__ALREADY_UNVERIFIED = 0x73; // 115 +/** NotAPrintEdition: This edition is not a Print Edition */ +export const MPL_TOKEN_METADATA_ERROR__NOT_A_PRINT_EDITION = 0x74; // 116 +/** InvalidMasterEdition: Invalid Master Edition */ +export const MPL_TOKEN_METADATA_ERROR__INVALID_MASTER_EDITION = 0x75; // 117 +/** InvalidPrintEdition: Invalid Print Edition */ +export const MPL_TOKEN_METADATA_ERROR__INVALID_PRINT_EDITION = 0x76; // 118 +/** InvalidEditionMarker: Invalid Edition Marker */ +export const MPL_TOKEN_METADATA_ERROR__INVALID_EDITION_MARKER = 0x77; // 119 +/** ReservationListDeprecated: Reservation List is Deprecated */ +export const MPL_TOKEN_METADATA_ERROR__RESERVATION_LIST_DEPRECATED = 0x78; // 120 +/** PrintEditionDoesNotMatchMasterEdition: Print Edition does not match Master Edition */ +export const MPL_TOKEN_METADATA_ERROR__PRINT_EDITION_DOES_NOT_MATCH_MASTER_EDITION = 0x79; // 121 +/** EditionNumberGreaterThanMaxSupply: Edition Number greater than max supply */ +export const MPL_TOKEN_METADATA_ERROR__EDITION_NUMBER_GREATER_THAN_MAX_SUPPLY = 0x7a; // 122 +/** MustUnverify: Must unverify before migrating collections. */ +export const MPL_TOKEN_METADATA_ERROR__MUST_UNVERIFY = 0x7b; // 123 +/** InvalidEscrowBumpSeed: Invalid Escrow Account Bump Seed */ +export const MPL_TOKEN_METADATA_ERROR__INVALID_ESCROW_BUMP_SEED = 0x7c; // 124 +/** MustBeEscrowAuthority: Must Escrow Authority */ +export const MPL_TOKEN_METADATA_ERROR__MUST_BE_ESCROW_AUTHORITY = 0x7d; // 125 +/** InvalidSystemProgram: Invalid System Program */ +export const MPL_TOKEN_METADATA_ERROR__INVALID_SYSTEM_PROGRAM = 0x7e; // 126 +/** MustBeNonFungible: Must be a Non Fungible Token */ +export const MPL_TOKEN_METADATA_ERROR__MUST_BE_NON_FUNGIBLE = 0x7f; // 127 +/** InsufficientTokens: Insufficient tokens for transfer */ +export const MPL_TOKEN_METADATA_ERROR__INSUFFICIENT_TOKENS = 0x80; // 128 +/** BorshSerializationError: Borsh Serialization Error */ +export const MPL_TOKEN_METADATA_ERROR__BORSH_SERIALIZATION_ERROR = 0x81; // 129 +/** NoFreezeAuthoritySet: Cannot create NFT with no Freeze Authority. */ +export const MPL_TOKEN_METADATA_ERROR__NO_FREEZE_AUTHORITY_SET = 0x82; // 130 +/** InvalidCollectionSizeChange: Invalid collection size change */ +export const MPL_TOKEN_METADATA_ERROR__INVALID_COLLECTION_SIZE_CHANGE = 0x83; // 131 +/** InvalidBubblegumSigner: Invalid bubblegum signer */ +export const MPL_TOKEN_METADATA_ERROR__INVALID_BUBBLEGUM_SIGNER = 0x84; // 132 +/** MintIsNotSigner: Mint needs to be signer to initialize the account */ +export const MPL_TOKEN_METADATA_ERROR__MINT_IS_NOT_SIGNER = 0x85; // 133 +/** InvalidTokenStandard: Invalid token standard */ +export const MPL_TOKEN_METADATA_ERROR__INVALID_TOKEN_STANDARD = 0x86; // 134 +/** InvalidMintForTokenStandard: Invalid mint account for specified token standard */ +export const MPL_TOKEN_METADATA_ERROR__INVALID_MINT_FOR_TOKEN_STANDARD = 0x87; // 135 +/** InvalidAuthorizationRules: Invalid authorization rules account */ +export const MPL_TOKEN_METADATA_ERROR__INVALID_AUTHORIZATION_RULES = 0x88; // 136 +/** MissingAuthorizationRules: Missing authorization rules account */ +export const MPL_TOKEN_METADATA_ERROR__MISSING_AUTHORIZATION_RULES = 0x89; // 137 +/** MissingProgrammableConfig: Missing programmable configuration */ +export const MPL_TOKEN_METADATA_ERROR__MISSING_PROGRAMMABLE_CONFIG = 0x8a; // 138 +/** InvalidProgrammableConfig: Invalid programmable configuration */ +export const MPL_TOKEN_METADATA_ERROR__INVALID_PROGRAMMABLE_CONFIG = 0x8b; // 139 +/** DelegateAlreadyExists: Delegate already exists */ +export const MPL_TOKEN_METADATA_ERROR__DELEGATE_ALREADY_EXISTS = 0x8c; // 140 +/** DelegateNotFound: Delegate not found */ +export const MPL_TOKEN_METADATA_ERROR__DELEGATE_NOT_FOUND = 0x8d; // 141 +/** MissingAccountInBuilder: Required account not set in instruction builder */ +export const MPL_TOKEN_METADATA_ERROR__MISSING_ACCOUNT_IN_BUILDER = 0x8e; // 142 +/** MissingArgumentInBuilder: Required argument not set in instruction builder */ +export const MPL_TOKEN_METADATA_ERROR__MISSING_ARGUMENT_IN_BUILDER = 0x8f; // 143 +/** FeatureNotSupported: Feature not supported currently */ +export const MPL_TOKEN_METADATA_ERROR__FEATURE_NOT_SUPPORTED = 0x90; // 144 +/** InvalidSystemWallet: Invalid system wallet */ +export const MPL_TOKEN_METADATA_ERROR__INVALID_SYSTEM_WALLET = 0x91; // 145 +/** OnlySaleDelegateCanTransfer: Only the sale delegate can transfer while its set */ +export const MPL_TOKEN_METADATA_ERROR__ONLY_SALE_DELEGATE_CAN_TRANSFER = 0x92; // 146 +/** MissingTokenAccount: Missing token account */ +export const MPL_TOKEN_METADATA_ERROR__MISSING_TOKEN_ACCOUNT = 0x93; // 147 +/** MissingSplTokenProgram: Missing SPL token program */ +export const MPL_TOKEN_METADATA_ERROR__MISSING_SPL_TOKEN_PROGRAM = 0x94; // 148 +/** MissingAuthorizationRulesProgram: Missing SPL token program */ +export const MPL_TOKEN_METADATA_ERROR__MISSING_AUTHORIZATION_RULES_PROGRAM = 0x95; // 149 +/** InvalidDelegateRoleForTransfer: Invalid delegate role for transfer */ +export const MPL_TOKEN_METADATA_ERROR__INVALID_DELEGATE_ROLE_FOR_TRANSFER = 0x96; // 150 - readonly cause: Error | undefined; - - constructor( - code: MplTokenMetadataProgramErrorCode, - name: string, - message: string, - cause?: Error - ) { - super(`${name} (${code}): ${message}`); - this.code = code; - this.cause = cause; - } -} +export type MplTokenMetadataError = + | typeof MPL_TOKEN_METADATA_ERROR__ADDRESS_NOT_IN_RESERVATION + | typeof MPL_TOKEN_METADATA_ERROR__ALREADY_INITIALIZED + | typeof MPL_TOKEN_METADATA_ERROR__ALREADY_UNVERIFIED + | typeof MPL_TOKEN_METADATA_ERROR__ALREADY_VERIFIED + | typeof MPL_TOKEN_METADATA_ERROR__AUTHORIZATION_TOKEN_ACCOUNT_OWNER_MISMATCH + | typeof MPL_TOKEN_METADATA_ERROR__BEYOND_ALOTTED_ADDRESS_SIZE + | typeof MPL_TOKEN_METADATA_ERROR__BEYOND_MAX_ADDRESS_SIZE + | typeof MPL_TOKEN_METADATA_ERROR__BORSH_DESERIALIZATION_ERROR + | typeof MPL_TOKEN_METADATA_ERROR__BORSH_SERIALIZATION_ERROR + | typeof MPL_TOKEN_METADATA_ERROR__CANNOT_ADJUST_VERIFIED_CREATOR + | typeof MPL_TOKEN_METADATA_ERROR__CANNOT_CHANGE_USE_METHOD_AFTER_FIRST_USE + | typeof MPL_TOKEN_METADATA_ERROR__CANNOT_CHANGE_USES_AFTER_FIRST_USE + | typeof MPL_TOKEN_METADATA_ERROR__CANNOT_REMOVE_VERIFIED_CREATOR + | typeof MPL_TOKEN_METADATA_ERROR__CANNOT_UNVERIFY_ANOTHER_CREATOR + | typeof MPL_TOKEN_METADATA_ERROR__CANNOT_UPDATE_VERIFIED_COLLECTION + | typeof MPL_TOKEN_METADATA_ERROR__CANNOT_VERIFY_ANOTHER_CREATOR + | typeof MPL_TOKEN_METADATA_ERROR__CANNOT_WIPE_VERIFIED_CREATORS + | typeof MPL_TOKEN_METADATA_ERROR__COLLECTION_AUTHORITY_DOES_NOT_EXIST + | typeof MPL_TOKEN_METADATA_ERROR__COLLECTION_AUTHORITY_RECORD_ALREADY_EXISTS + | typeof MPL_TOKEN_METADATA_ERROR__COLLECTION_CANNOT_BE_VERIFIED_IN_THIS_INSTRUCTION + | typeof MPL_TOKEN_METADATA_ERROR__COLLECTION_MASTER_EDITION_ACCOUNT_INVALID + | typeof MPL_TOKEN_METADATA_ERROR__COLLECTION_MUST_BE_A_UNIQUE_MASTER_EDITION + | typeof MPL_TOKEN_METADATA_ERROR__COLLECTION_NOT_FOUND + | typeof MPL_TOKEN_METADATA_ERROR__COULD_NOT_DETERMINE_TOKEN_STANDARD + | typeof MPL_TOKEN_METADATA_ERROR__CREATOR_NOT_FOUND + | typeof MPL_TOKEN_METADATA_ERROR__CREATORS_MUST_BE_ATLEAST_ONE + | typeof MPL_TOKEN_METADATA_ERROR__CREATORS_TOO_LONG + | typeof MPL_TOKEN_METADATA_ERROR__DATA_IS_IMMUTABLE + | typeof MPL_TOKEN_METADATA_ERROR__DATA_TYPE_MISMATCH + | typeof MPL_TOKEN_METADATA_ERROR__DELEGATE_ALREADY_EXISTS + | typeof MPL_TOKEN_METADATA_ERROR__DELEGATE_NOT_FOUND + | typeof MPL_TOKEN_METADATA_ERROR__DERIVED_KEY_INVALID + | typeof MPL_TOKEN_METADATA_ERROR__DESTINATION_MINT_MISMATCH + | typeof MPL_TOKEN_METADATA_ERROR__DISABLED + | typeof MPL_TOKEN_METADATA_ERROR__DUPLICATE_CREATOR_ADDRESS + | typeof MPL_TOKEN_METADATA_ERROR__EDITION_ALREADY_MINTED + | typeof MPL_TOKEN_METADATA_ERROR__EDITION_MINT_DECIMALS_SHOULD_BE_ZERO + | typeof MPL_TOKEN_METADATA_ERROR__EDITION_NUMBER_GREATER_THAN_MAX_SUPPLY + | typeof MPL_TOKEN_METADATA_ERROR__EDITION_OVERRIDE_CANNOT_BE_ZERO + | typeof MPL_TOKEN_METADATA_ERROR__EDITIONS_MUST_HAVE_EXACTLY_ONE_TOKEN + | typeof MPL_TOKEN_METADATA_ERROR__FEATURE_NOT_SUPPORTED + | typeof MPL_TOKEN_METADATA_ERROR__INCORRECT_OWNER + | typeof MPL_TOKEN_METADATA_ERROR__INSTRUCTION_PACK_ERROR + | typeof MPL_TOKEN_METADATA_ERROR__INSTRUCTION_UNPACK_ERROR + | typeof MPL_TOKEN_METADATA_ERROR__INSUFFICIENT_TOKENS + | typeof MPL_TOKEN_METADATA_ERROR__INVALID_AUTHORIZATION_RULES + | typeof MPL_TOKEN_METADATA_ERROR__INVALID_BASIS_POINTS + | typeof MPL_TOKEN_METADATA_ERROR__INVALID_BUBBLEGUM_SIGNER + | typeof MPL_TOKEN_METADATA_ERROR__INVALID_COLLECTION_AUTHORITY_RECORD + | typeof MPL_TOKEN_METADATA_ERROR__INVALID_COLLECTION_SIZE_CHANGE + | typeof MPL_TOKEN_METADATA_ERROR__INVALID_COLLECTION_UPDATE_AUTHORITY + | typeof MPL_TOKEN_METADATA_ERROR__INVALID_DELEGATE + | typeof MPL_TOKEN_METADATA_ERROR__INVALID_DELEGATE_ROLE_FOR_TRANSFER + | typeof MPL_TOKEN_METADATA_ERROR__INVALID_EDITION_INDEX + | typeof MPL_TOKEN_METADATA_ERROR__INVALID_EDITION_KEY + | typeof MPL_TOKEN_METADATA_ERROR__INVALID_EDITION_MARKER + | typeof MPL_TOKEN_METADATA_ERROR__INVALID_ESCROW_BUMP_SEED + | typeof MPL_TOKEN_METADATA_ERROR__INVALID_FREEZE_AUTHORITY + | typeof MPL_TOKEN_METADATA_ERROR__INVALID_MASTER_EDITION + | typeof MPL_TOKEN_METADATA_ERROR__INVALID_METADATA_KEY + | typeof MPL_TOKEN_METADATA_ERROR__INVALID_MINT_AUTHORITY + | typeof MPL_TOKEN_METADATA_ERROR__INVALID_MINT_FOR_TOKEN_STANDARD + | typeof MPL_TOKEN_METADATA_ERROR__INVALID_OPERATION + | typeof MPL_TOKEN_METADATA_ERROR__INVALID_OWNER + | typeof MPL_TOKEN_METADATA_ERROR__INVALID_PRINT_EDITION + | typeof MPL_TOKEN_METADATA_ERROR__INVALID_PROGRAMMABLE_CONFIG + | typeof MPL_TOKEN_METADATA_ERROR__INVALID_SYSTEM_PROGRAM + | typeof MPL_TOKEN_METADATA_ERROR__INVALID_SYSTEM_WALLET + | typeof MPL_TOKEN_METADATA_ERROR__INVALID_TOKEN_PROGRAM + | typeof MPL_TOKEN_METADATA_ERROR__INVALID_TOKEN_STANDARD + | typeof MPL_TOKEN_METADATA_ERROR__INVALID_USE_AUTHORITY_RECORD + | typeof MPL_TOKEN_METADATA_ERROR__INVALID_USE_METHOD + | typeof MPL_TOKEN_METADATA_ERROR__INVALID_USER + | typeof MPL_TOKEN_METADATA_ERROR__IS_MUTABLE_CAN_ONLY_BE_FLIPPED_TO_FALSE + | typeof MPL_TOKEN_METADATA_ERROR__MASTER_EDITION_HAS_PRINTS + | typeof MPL_TOKEN_METADATA_ERROR__MASTER_RECORD_MISMATCH + | typeof MPL_TOKEN_METADATA_ERROR__MAX_EDITIONS_MINTED_ALREADY + | typeof MPL_TOKEN_METADATA_ERROR__MINT_IS_NOT_SIGNER + | typeof MPL_TOKEN_METADATA_ERROR__MINT_MISMATCH + | typeof MPL_TOKEN_METADATA_ERROR__MISSING_ACCOUNT_IN_BUILDER + | typeof MPL_TOKEN_METADATA_ERROR__MISSING_ARGUMENT_IN_BUILDER + | typeof MPL_TOKEN_METADATA_ERROR__MISSING_AUTHORIZATION_RULES + | typeof MPL_TOKEN_METADATA_ERROR__MISSING_AUTHORIZATION_RULES_PROGRAM + | typeof MPL_TOKEN_METADATA_ERROR__MISSING_COLLECTION_METADATA + | typeof MPL_TOKEN_METADATA_ERROR__MISSING_EDITION_ACCOUNT + | typeof MPL_TOKEN_METADATA_ERROR__MISSING_PROGRAMMABLE_CONFIG + | typeof MPL_TOKEN_METADATA_ERROR__MISSING_SPL_TOKEN_PROGRAM + | typeof MPL_TOKEN_METADATA_ERROR__MISSING_TOKEN_ACCOUNT + | typeof MPL_TOKEN_METADATA_ERROR__MUST_BE_BURNED + | typeof MPL_TOKEN_METADATA_ERROR__MUST_BE_ESCROW_AUTHORITY + | typeof MPL_TOKEN_METADATA_ERROR__MUST_BE_NON_FUNGIBLE + | typeof MPL_TOKEN_METADATA_ERROR__MUST_BE_ONE_OF_CREATORS + | typeof MPL_TOKEN_METADATA_ERROR__MUST_UNVERIFY + | typeof MPL_TOKEN_METADATA_ERROR__NAME_TOO_LONG + | typeof MPL_TOKEN_METADATA_ERROR__NO_BALANCE_IN_ACCOUNT_FOR_AUTHORIZATION + | typeof MPL_TOKEN_METADATA_ERROR__NO_CREATORS_PRESENT_ON_METADATA + | typeof MPL_TOKEN_METADATA_ERROR__NO_FREEZE_AUTHORITY_SET + | typeof MPL_TOKEN_METADATA_ERROR__NOT_A_COLLECTION_PARENT + | typeof MPL_TOKEN_METADATA_ERROR__NOT_ALLOWED_TO_CHANGE_SELLER_FEE_BASIS_POINTS + | typeof MPL_TOKEN_METADATA_ERROR__NOT_A_MASTER_EDITION + | typeof MPL_TOKEN_METADATA_ERROR__NOT_A_MEMBER_OF_COLLECTION + | typeof MPL_TOKEN_METADATA_ERROR__NOT_A_PRINT_EDITION + | typeof MPL_TOKEN_METADATA_ERROR__NOT_ENOUGH_TOKENS + | typeof MPL_TOKEN_METADATA_ERROR__NOT_ENOUGH_USES + | typeof MPL_TOKEN_METADATA_ERROR__NOT_MINT_AUTHORITY + | typeof MPL_TOKEN_METADATA_ERROR__NOT_RENT_EXEMPT + | typeof MPL_TOKEN_METADATA_ERROR__NOT_VERIFIED_MEMBER_OF_COLLECTION + | typeof MPL_TOKEN_METADATA_ERROR__NUMERICAL_OVERFLOW_ERROR + | typeof MPL_TOKEN_METADATA_ERROR__ONE_TIME_AUTH_MINT_SUPPLY_MUST_BE_ZERO_FOR_CONVERSION + | typeof MPL_TOKEN_METADATA_ERROR__ONE_TIME_PRINTING_AUTH_MINT_MISMATCH + | typeof MPL_TOKEN_METADATA_ERROR__ONE_TIME_PRINTING_AUTHORIZATION_MINT_DECIMALS_SHOULD_BE_ZERO + | typeof MPL_TOKEN_METADATA_ERROR__ONLY_SALE_DELEGATE_CAN_TRANSFER + | typeof MPL_TOKEN_METADATA_ERROR__OWNER_MISMATCH + | typeof MPL_TOKEN_METADATA_ERROR__PRIMARY_SALE_CAN_ONLY_BE_FLIPPED_TO_TRUE + | typeof MPL_TOKEN_METADATA_ERROR__PRINT_EDITION_DOES_NOT_MATCH_MASTER_EDITION + | typeof MPL_TOKEN_METADATA_ERROR__PRINTING_MINT_AUTHORIZATION_ACCOUNT_MISMATCH + | typeof MPL_TOKEN_METADATA_ERROR__PRINTING_MINT_DECIMALS_SHOULD_BE_ZERO + | typeof MPL_TOKEN_METADATA_ERROR__PRINTING_MINT_MISMATCH + | typeof MPL_TOKEN_METADATA_ERROR__PRINTING_MINT_SUPPLY_MUST_BE_ZERO_FOR_CONVERSION + | typeof MPL_TOKEN_METADATA_ERROR__PRINTING_WOULD_BREACH_MAXIMUM_SUPPLY + | typeof MPL_TOKEN_METADATA_ERROR__REMOVED + | typeof MPL_TOKEN_METADATA_ERROR__RESERVATION_ALREADY_MADE + | typeof MPL_TOKEN_METADATA_ERROR__RESERVATION_ARRAY_SHOULD_BE_SIZE_ONE + | typeof MPL_TOKEN_METADATA_ERROR__RESERVATION_BREACHES_MAXIMUM_SUPPLY + | typeof MPL_TOKEN_METADATA_ERROR__RESERVATION_DOES_NOT_EXIST + | typeof MPL_TOKEN_METADATA_ERROR__RESERVATION_EXISTS + | typeof MPL_TOKEN_METADATA_ERROR__RESERVATION_LIST_DEPRECATED + | typeof MPL_TOKEN_METADATA_ERROR__RESERVATION_NOT_COMPLETE + | typeof MPL_TOKEN_METADATA_ERROR__RESERVATION_NOT_SET + | typeof MPL_TOKEN_METADATA_ERROR__RESERVATION_SPOTS_REMAINING_SHOULD_MATCH_TOTAL_SPOTS_AT_START + | typeof MPL_TOKEN_METADATA_ERROR__REVOKE_COLLECTION_AUTHORITY_SIGNER_INCORRECT + | typeof MPL_TOKEN_METADATA_ERROR__SHARE_TOTAL_MUST_BE100 + | typeof MPL_TOKEN_METADATA_ERROR__SIZED_COLLECTION + | typeof MPL_TOKEN_METADATA_ERROR__SPOT_MISMATCH + | typeof MPL_TOKEN_METADATA_ERROR__SYMBOL_TOO_LONG + | typeof MPL_TOKEN_METADATA_ERROR__TOKEN_ACCOUNT_MINT_MISMATCH + | typeof MPL_TOKEN_METADATA_ERROR__TOKEN_ACCOUNT_MINT_MISMATCH_V2 + | typeof MPL_TOKEN_METADATA_ERROR__TOKEN_ACCOUNT_ONE_TIME_AUTH_MINT_MISMATCH + | typeof MPL_TOKEN_METADATA_ERROR__TOKEN_BURN_FAILED + | typeof MPL_TOKEN_METADATA_ERROR__TOKEN_CLOSE_FAILED + | typeof MPL_TOKEN_METADATA_ERROR__TOKEN_MINT_TO_FAILED + | typeof MPL_TOKEN_METADATA_ERROR__TRIED_TO_REPLACE_AN_EXISTING_RESERVATION + | typeof MPL_TOKEN_METADATA_ERROR__UNINITIALIZED + | typeof MPL_TOKEN_METADATA_ERROR__UNSIZED_COLLECTION + | typeof MPL_TOKEN_METADATA_ERROR__UNUSABLE + | typeof MPL_TOKEN_METADATA_ERROR__UPDATE_AUTHORITY_INCORRECT + | typeof MPL_TOKEN_METADATA_ERROR__UPDATE_AUTHORITY_IS_NOT_SIGNER + | typeof MPL_TOKEN_METADATA_ERROR__UPDATE_AUTHORITY_MUST_BE_EQUAL_TO_METADATA_AUTHORITY_AND_SIGNER + | typeof MPL_TOKEN_METADATA_ERROR__URI_TOO_LONG + | typeof MPL_TOKEN_METADATA_ERROR__USE_AUTHORITY_RECORD_ALREADY_EXISTS + | typeof MPL_TOKEN_METADATA_ERROR__USE_AUTHORITY_RECORD_ALREADY_REVOKED; -let mplTokenMetadataProgramErrorCodeMap: - | Record +let mplTokenMetadataErrorMessages: + | Record | undefined; if (__DEV__) { - mplTokenMetadataProgramErrorCodeMap = { - [MplTokenMetadataProgramErrorCode.INSTRUCTION_UNPACK_ERROR]: [ - 'InstructionUnpackError', - `Failed to unpack instruction data`, - ], - [MplTokenMetadataProgramErrorCode.INSTRUCTION_PACK_ERROR]: [ - 'InstructionPackError', - `Failed to pack instruction data`, - ], - [MplTokenMetadataProgramErrorCode.NOT_RENT_EXEMPT]: [ - 'NotRentExempt', - `Lamport balance below rent-exempt threshold`, - ], - [MplTokenMetadataProgramErrorCode.ALREADY_INITIALIZED]: [ - 'AlreadyInitialized', - `Already initialized`, - ], - [MplTokenMetadataProgramErrorCode.UNINITIALIZED]: [ - 'Uninitialized', - `Uninitialized`, - ], - [MplTokenMetadataProgramErrorCode.INVALID_METADATA_KEY]: [ - 'InvalidMetadataKey', - ` Metadata's key must match seed of ['metadata', program id, mint] provided`, - ], - [MplTokenMetadataProgramErrorCode.INVALID_EDITION_KEY]: [ - 'InvalidEditionKey', - `Edition's key must match seed of ['metadata', program id, name, 'edition'] provided`, - ], - [MplTokenMetadataProgramErrorCode.UPDATE_AUTHORITY_INCORRECT]: [ - 'UpdateAuthorityIncorrect', - `Update Authority given does not match`, - ], - [MplTokenMetadataProgramErrorCode.UPDATE_AUTHORITY_IS_NOT_SIGNER]: [ - 'UpdateAuthorityIsNotSigner', - `Update Authority needs to be signer to update metadata`, - ], - [MplTokenMetadataProgramErrorCode.NOT_MINT_AUTHORITY]: [ - 'NotMintAuthority', - `You must be the mint authority and signer on this transaction`, - ], - [MplTokenMetadataProgramErrorCode.INVALID_MINT_AUTHORITY]: [ - 'InvalidMintAuthority', - `Mint authority provided does not match the authority on the mint`, - ], - [MplTokenMetadataProgramErrorCode.NAME_TOO_LONG]: [ - 'NameTooLong', - `Name too long`, - ], - [MplTokenMetadataProgramErrorCode.SYMBOL_TOO_LONG]: [ - 'SymbolTooLong', - `Symbol too long`, - ], - [MplTokenMetadataProgramErrorCode.URI_TOO_LONG]: [ - 'UriTooLong', - `URI too long`, - ], - [MplTokenMetadataProgramErrorCode.UPDATE_AUTHORITY_MUST_BE_EQUAL_TO_METADATA_AUTHORITY_AND_SIGNER]: - [ - 'UpdateAuthorityMustBeEqualToMetadataAuthorityAndSigner', - `Update authority must be equivalent to the metadata's authority and also signer of this transaction`, - ], - [MplTokenMetadataProgramErrorCode.MINT_MISMATCH]: [ - 'MintMismatch', - `Mint given does not match mint on Metadata`, - ], - [MplTokenMetadataProgramErrorCode.EDITIONS_MUST_HAVE_EXACTLY_ONE_TOKEN]: [ - 'EditionsMustHaveExactlyOneToken', - `Editions must have exactly one token`, - ], - [MplTokenMetadataProgramErrorCode.MAX_EDITIONS_MINTED_ALREADY]: [ - 'MaxEditionsMintedAlready', - `Maximum editions printed already`, - ], - [MplTokenMetadataProgramErrorCode.TOKEN_MINT_TO_FAILED]: [ - 'TokenMintToFailed', - `Token mint to failed`, - ], - [MplTokenMetadataProgramErrorCode.MASTER_RECORD_MISMATCH]: [ - 'MasterRecordMismatch', - `The master edition record passed must match the master record on the edition given`, - ], - [MplTokenMetadataProgramErrorCode.DESTINATION_MINT_MISMATCH]: [ - 'DestinationMintMismatch', - `The destination account does not have the right mint`, - ], - [MplTokenMetadataProgramErrorCode.EDITION_ALREADY_MINTED]: [ - 'EditionAlreadyMinted', - `An edition can only mint one of its kind!`, - ], - [MplTokenMetadataProgramErrorCode.PRINTING_MINT_DECIMALS_SHOULD_BE_ZERO]: [ - 'PrintingMintDecimalsShouldBeZero', - `Printing mint decimals should be zero`, - ], - [MplTokenMetadataProgramErrorCode.ONE_TIME_PRINTING_AUTHORIZATION_MINT_DECIMALS_SHOULD_BE_ZERO]: - [ - 'OneTimePrintingAuthorizationMintDecimalsShouldBeZero', - `OneTimePrintingAuthorization mint decimals should be zero`, - ], - [MplTokenMetadataProgramErrorCode.EDITION_MINT_DECIMALS_SHOULD_BE_ZERO]: [ - 'EditionMintDecimalsShouldBeZero', - `EditionMintDecimalsShouldBeZero`, - ], - [MplTokenMetadataProgramErrorCode.TOKEN_BURN_FAILED]: [ - 'TokenBurnFailed', - `Token burn failed`, - ], - [MplTokenMetadataProgramErrorCode.TOKEN_ACCOUNT_ONE_TIME_AUTH_MINT_MISMATCH]: - [ - 'TokenAccountOneTimeAuthMintMismatch', - `The One Time authorization mint does not match that on the token account!`, - ], - [MplTokenMetadataProgramErrorCode.DERIVED_KEY_INVALID]: [ - 'DerivedKeyInvalid', - `Derived key invalid`, - ], - [MplTokenMetadataProgramErrorCode.PRINTING_MINT_MISMATCH]: [ - 'PrintingMintMismatch', - `The Printing mint does not match that on the master edition!`, - ], - [MplTokenMetadataProgramErrorCode.ONE_TIME_PRINTING_AUTH_MINT_MISMATCH]: [ - 'OneTimePrintingAuthMintMismatch', - `The One Time Printing Auth mint does not match that on the master edition!`, - ], - [MplTokenMetadataProgramErrorCode.TOKEN_ACCOUNT_MINT_MISMATCH]: [ - 'TokenAccountMintMismatch', - `The mint of the token account does not match the Printing mint!`, - ], - [MplTokenMetadataProgramErrorCode.TOKEN_ACCOUNT_MINT_MISMATCH_V2]: [ - 'TokenAccountMintMismatchV2', - `The mint of the token account does not match the master metadata mint!`, - ], - [MplTokenMetadataProgramErrorCode.NOT_ENOUGH_TOKENS]: [ - 'NotEnoughTokens', - `Not enough tokens to mint a limited edition`, - ], - [MplTokenMetadataProgramErrorCode.PRINTING_MINT_AUTHORIZATION_ACCOUNT_MISMATCH]: - [ - 'PrintingMintAuthorizationAccountMismatch', - `The mint on your authorization token holding account does not match your Printing mint!`, - ], - [MplTokenMetadataProgramErrorCode.AUTHORIZATION_TOKEN_ACCOUNT_OWNER_MISMATCH]: - [ - 'AuthorizationTokenAccountOwnerMismatch', - `The authorization token account has a different owner than the update authority for the master edition!`, - ], - [MplTokenMetadataProgramErrorCode.DISABLED]: [ - 'Disabled', - `This feature is currently disabled.`, - ], - [MplTokenMetadataProgramErrorCode.CREATORS_TOO_LONG]: [ - 'CreatorsTooLong', - `Creators list too long`, - ], - [MplTokenMetadataProgramErrorCode.CREATORS_MUST_BE_ATLEAST_ONE]: [ - 'CreatorsMustBeAtleastOne', - `Creators must be at least one if set`, - ], - [MplTokenMetadataProgramErrorCode.MUST_BE_ONE_OF_CREATORS]: [ - 'MustBeOneOfCreators', - `If using a creators array, you must be one of the creators listed`, - ], - [MplTokenMetadataProgramErrorCode.NO_CREATORS_PRESENT_ON_METADATA]: [ - 'NoCreatorsPresentOnMetadata', - `This metadata does not have creators`, - ], - [MplTokenMetadataProgramErrorCode.CREATOR_NOT_FOUND]: [ - 'CreatorNotFound', - `This creator address was not found`, - ], - [MplTokenMetadataProgramErrorCode.INVALID_BASIS_POINTS]: [ - 'InvalidBasisPoints', - `Basis points cannot be more than 10000`, - ], - [MplTokenMetadataProgramErrorCode.PRIMARY_SALE_CAN_ONLY_BE_FLIPPED_TO_TRUE]: - [ - 'PrimarySaleCanOnlyBeFlippedToTrue', - `Primary sale can only be flipped to true and is immutable`, - ], - [MplTokenMetadataProgramErrorCode.OWNER_MISMATCH]: [ - 'OwnerMismatch', - `Owner does not match that on the account given`, - ], - [MplTokenMetadataProgramErrorCode.NO_BALANCE_IN_ACCOUNT_FOR_AUTHORIZATION]: - [ - 'NoBalanceInAccountForAuthorization', - `This account has no tokens to be used for authorization`, - ], - [MplTokenMetadataProgramErrorCode.SHARE_TOTAL_MUST_BE100]: [ - 'ShareTotalMustBe100', - `Share total must equal 100 for creator array`, - ], - [MplTokenMetadataProgramErrorCode.RESERVATION_EXISTS]: [ - 'ReservationExists', - `This reservation list already exists!`, - ], - [MplTokenMetadataProgramErrorCode.RESERVATION_DOES_NOT_EXIST]: [ - 'ReservationDoesNotExist', - `This reservation list does not exist!`, - ], - [MplTokenMetadataProgramErrorCode.RESERVATION_NOT_SET]: [ - 'ReservationNotSet', - `This reservation list exists but was never set with reservations`, - ], - [MplTokenMetadataProgramErrorCode.RESERVATION_ALREADY_MADE]: [ - 'ReservationAlreadyMade', - `This reservation list has already been set!`, - ], - [MplTokenMetadataProgramErrorCode.BEYOND_MAX_ADDRESS_SIZE]: [ - 'BeyondMaxAddressSize', - `Provided more addresses than max allowed in single reservation`, - ], - [MplTokenMetadataProgramErrorCode.NUMERICAL_OVERFLOW_ERROR]: [ - 'NumericalOverflowError', - `NumericalOverflowError`, - ], - [MplTokenMetadataProgramErrorCode.RESERVATION_BREACHES_MAXIMUM_SUPPLY]: [ - 'ReservationBreachesMaximumSupply', - `This reservation would go beyond the maximum supply of the master edition!`, - ], - [MplTokenMetadataProgramErrorCode.ADDRESS_NOT_IN_RESERVATION]: [ - 'AddressNotInReservation', - `Address not in reservation!`, - ], - [MplTokenMetadataProgramErrorCode.CANNOT_VERIFY_ANOTHER_CREATOR]: [ - 'CannotVerifyAnotherCreator', - `You cannot unilaterally verify another creator, they must sign`, - ], - [MplTokenMetadataProgramErrorCode.CANNOT_UNVERIFY_ANOTHER_CREATOR]: [ - 'CannotUnverifyAnotherCreator', - `You cannot unilaterally unverify another creator`, - ], - [MplTokenMetadataProgramErrorCode.SPOT_MISMATCH]: [ - 'SpotMismatch', - `In initial reservation setting, spots remaining should equal total spots`, - ], - [MplTokenMetadataProgramErrorCode.INCORRECT_OWNER]: [ - 'IncorrectOwner', - `Incorrect account owner`, - ], - [MplTokenMetadataProgramErrorCode.PRINTING_WOULD_BREACH_MAXIMUM_SUPPLY]: [ - 'PrintingWouldBreachMaximumSupply', - `printing these tokens would breach the maximum supply limit of the master edition`, - ], - [MplTokenMetadataProgramErrorCode.DATA_IS_IMMUTABLE]: [ - 'DataIsImmutable', - `Data is immutable`, - ], - [MplTokenMetadataProgramErrorCode.DUPLICATE_CREATOR_ADDRESS]: [ - 'DuplicateCreatorAddress', - `No duplicate creator addresses`, - ], - [MplTokenMetadataProgramErrorCode.RESERVATION_SPOTS_REMAINING_SHOULD_MATCH_TOTAL_SPOTS_AT_START]: - [ - 'ReservationSpotsRemainingShouldMatchTotalSpotsAtStart', - `Reservation spots remaining should match total spots when first being created`, - ], - [MplTokenMetadataProgramErrorCode.INVALID_TOKEN_PROGRAM]: [ - 'InvalidTokenProgram', - `Invalid token program`, - ], - [MplTokenMetadataProgramErrorCode.DATA_TYPE_MISMATCH]: [ - 'DataTypeMismatch', - `Data type mismatch`, - ], - [MplTokenMetadataProgramErrorCode.BEYOND_ALOTTED_ADDRESS_SIZE]: [ - 'BeyondAlottedAddressSize', - `Beyond alotted address size in reservation!`, - ], - [MplTokenMetadataProgramErrorCode.RESERVATION_NOT_COMPLETE]: [ - 'ReservationNotComplete', - `The reservation has only been partially alotted`, - ], - [MplTokenMetadataProgramErrorCode.TRIED_TO_REPLACE_AN_EXISTING_RESERVATION]: - [ - 'TriedToReplaceAnExistingReservation', - `You cannot splice over an existing reservation!`, - ], - [MplTokenMetadataProgramErrorCode.INVALID_OPERATION]: [ - 'InvalidOperation', - `Invalid operation`, - ], - [MplTokenMetadataProgramErrorCode.INVALID_OWNER]: [ - 'InvalidOwner', - `Invalid Owner`, - ], - [MplTokenMetadataProgramErrorCode.PRINTING_MINT_SUPPLY_MUST_BE_ZERO_FOR_CONVERSION]: - [ - 'PrintingMintSupplyMustBeZeroForConversion', - `Printing mint supply must be zero for conversion`, - ], - [MplTokenMetadataProgramErrorCode.ONE_TIME_AUTH_MINT_SUPPLY_MUST_BE_ZERO_FOR_CONVERSION]: - [ - 'OneTimeAuthMintSupplyMustBeZeroForConversion', - `One Time Auth mint supply must be zero for conversion`, - ], - [MplTokenMetadataProgramErrorCode.INVALID_EDITION_INDEX]: [ - 'InvalidEditionIndex', - `You tried to insert one edition too many into an edition mark pda`, - ], - [MplTokenMetadataProgramErrorCode.RESERVATION_ARRAY_SHOULD_BE_SIZE_ONE]: [ - 'ReservationArrayShouldBeSizeOne', - `In the legacy system the reservation needs to be of size one for cpu limit reasons`, - ], - [MplTokenMetadataProgramErrorCode.IS_MUTABLE_CAN_ONLY_BE_FLIPPED_TO_FALSE]: - [ - 'IsMutableCanOnlyBeFlippedToFalse', - `Is Mutable can only be flipped to false`, - ], - [MplTokenMetadataProgramErrorCode.COLLECTION_CANNOT_BE_VERIFIED_IN_THIS_INSTRUCTION]: - [ - 'CollectionCannotBeVerifiedInThisInstruction', - `Collection cannot be verified in this instruction`, - ], - [MplTokenMetadataProgramErrorCode.REMOVED]: [ - 'Removed', - `This instruction was deprecated in a previous release and is now removed`, - ], - [MplTokenMetadataProgramErrorCode.MUST_BE_BURNED]: [ - 'MustBeBurned', - `This token use method is burn and there are no remaining uses, it must be burned`, - ], - [MplTokenMetadataProgramErrorCode.INVALID_USE_METHOD]: [ - 'InvalidUseMethod', - `This use method is invalid`, - ], - [MplTokenMetadataProgramErrorCode.CANNOT_CHANGE_USE_METHOD_AFTER_FIRST_USE]: - [ - 'CannotChangeUseMethodAfterFirstUse', - `Cannot Change Use Method after the first use`, - ], - [MplTokenMetadataProgramErrorCode.CANNOT_CHANGE_USES_AFTER_FIRST_USE]: [ - 'CannotChangeUsesAfterFirstUse', - `Cannot Change Remaining or Available uses after the first use`, - ], - [MplTokenMetadataProgramErrorCode.COLLECTION_NOT_FOUND]: [ - 'CollectionNotFound', - `Collection Not Found on Metadata`, - ], - [MplTokenMetadataProgramErrorCode.INVALID_COLLECTION_UPDATE_AUTHORITY]: [ - 'InvalidCollectionUpdateAuthority', - `Collection Update Authority is invalid`, - ], - [MplTokenMetadataProgramErrorCode.COLLECTION_MUST_BE_A_UNIQUE_MASTER_EDITION]: - [ - 'CollectionMustBeAUniqueMasterEdition', - `Collection Must Be a Unique Master Edition v2`, - ], - [MplTokenMetadataProgramErrorCode.USE_AUTHORITY_RECORD_ALREADY_EXISTS]: [ - 'UseAuthorityRecordAlreadyExists', - `The Use Authority Record Already Exists, to modify it Revoke, then Approve`, - ], - [MplTokenMetadataProgramErrorCode.USE_AUTHORITY_RECORD_ALREADY_REVOKED]: [ - 'UseAuthorityRecordAlreadyRevoked', - `The Use Authority Record is empty or already revoked`, - ], - [MplTokenMetadataProgramErrorCode.UNUSABLE]: [ - 'Unusable', - `This token has no uses`, - ], - [MplTokenMetadataProgramErrorCode.NOT_ENOUGH_USES]: [ - 'NotEnoughUses', - `There are not enough Uses left on this token.`, - ], - [MplTokenMetadataProgramErrorCode.COLLECTION_AUTHORITY_RECORD_ALREADY_EXISTS]: - [ - 'CollectionAuthorityRecordAlreadyExists', - `This Collection Authority Record Already Exists.`, - ], - [MplTokenMetadataProgramErrorCode.COLLECTION_AUTHORITY_DOES_NOT_EXIST]: [ - 'CollectionAuthorityDoesNotExist', - `This Collection Authority Record Does Not Exist.`, - ], - [MplTokenMetadataProgramErrorCode.INVALID_USE_AUTHORITY_RECORD]: [ - 'InvalidUseAuthorityRecord', - `This Use Authority Record is invalid.`, - ], - [MplTokenMetadataProgramErrorCode.INVALID_COLLECTION_AUTHORITY_RECORD]: [ - 'InvalidCollectionAuthorityRecord', - `This Collection Authority Record is invalid.`, - ], - [MplTokenMetadataProgramErrorCode.INVALID_FREEZE_AUTHORITY]: [ - 'InvalidFreezeAuthority', - `Metadata does not match the freeze authority on the mint`, - ], - [MplTokenMetadataProgramErrorCode.INVALID_DELEGATE]: [ - 'InvalidDelegate', - `All tokens in this account have not been delegated to this user.`, - ], - [MplTokenMetadataProgramErrorCode.CANNOT_ADJUST_VERIFIED_CREATOR]: [ - 'CannotAdjustVerifiedCreator', - `Creator can not be adjusted once they are verified.`, - ], - [MplTokenMetadataProgramErrorCode.CANNOT_REMOVE_VERIFIED_CREATOR]: [ - 'CannotRemoveVerifiedCreator', - `Verified creators cannot be removed.`, - ], - [MplTokenMetadataProgramErrorCode.CANNOT_WIPE_VERIFIED_CREATORS]: [ - 'CannotWipeVerifiedCreators', - `Can not wipe verified creators.`, - ], - [MplTokenMetadataProgramErrorCode.NOT_ALLOWED_TO_CHANGE_SELLER_FEE_BASIS_POINTS]: - [ - 'NotAllowedToChangeSellerFeeBasisPoints', - `Not allowed to change seller fee basis points.`, - ], - [MplTokenMetadataProgramErrorCode.EDITION_OVERRIDE_CANNOT_BE_ZERO]: [ - 'EditionOverrideCannotBeZero', - `Edition override cannot be zero`, - ], - [MplTokenMetadataProgramErrorCode.INVALID_USER]: [ - 'InvalidUser', - `Invalid User`, - ], - [MplTokenMetadataProgramErrorCode.REVOKE_COLLECTION_AUTHORITY_SIGNER_INCORRECT]: - [ - 'RevokeCollectionAuthoritySignerIncorrect', - `Revoke Collection Authority signer is incorrect`, - ], - [MplTokenMetadataProgramErrorCode.TOKEN_CLOSE_FAILED]: [ - 'TokenCloseFailed', - `Token close failed`, - ], - [MplTokenMetadataProgramErrorCode.UNSIZED_COLLECTION]: [ - 'UnsizedCollection', - `Can't use this function on unsized collection`, - ], - [MplTokenMetadataProgramErrorCode.SIZED_COLLECTION]: [ - 'SizedCollection', - `Can't use this function on a sized collection`, - ], - [MplTokenMetadataProgramErrorCode.MISSING_COLLECTION_METADATA]: [ - 'MissingCollectionMetadata', - `Can't burn a verified member of a collection w/o providing collection metadata account`, - ], - [MplTokenMetadataProgramErrorCode.NOT_A_MEMBER_OF_COLLECTION]: [ - 'NotAMemberOfCollection', - `This NFT is not a member of the specified collection.`, - ], - [MplTokenMetadataProgramErrorCode.NOT_VERIFIED_MEMBER_OF_COLLECTION]: [ - 'NotVerifiedMemberOfCollection', - `This NFT is not a verified member of the specified collection.`, - ], - [MplTokenMetadataProgramErrorCode.NOT_A_COLLECTION_PARENT]: [ - 'NotACollectionParent', - `This NFT is not a collection parent NFT.`, - ], - [MplTokenMetadataProgramErrorCode.COULD_NOT_DETERMINE_TOKEN_STANDARD]: [ - 'CouldNotDetermineTokenStandard', - `Could not determine a TokenStandard type.`, - ], - [MplTokenMetadataProgramErrorCode.MISSING_EDITION_ACCOUNT]: [ - 'MissingEditionAccount', - `This mint account has an edition but none was provided.`, - ], - [MplTokenMetadataProgramErrorCode.NOT_A_MASTER_EDITION]: [ - 'NotAMasterEdition', - `This edition is not a Master Edition`, - ], - [MplTokenMetadataProgramErrorCode.MASTER_EDITION_HAS_PRINTS]: [ - 'MasterEditionHasPrints', - `This Master Edition has existing prints`, - ], - [MplTokenMetadataProgramErrorCode.BORSH_DESERIALIZATION_ERROR]: [ - 'BorshDeserializationError', - `Borsh Deserialization Error`, - ], - [MplTokenMetadataProgramErrorCode.CANNOT_UPDATE_VERIFIED_COLLECTION]: [ - 'CannotUpdateVerifiedCollection', - `Cannot update a verified collection in this command`, - ], - [MplTokenMetadataProgramErrorCode.COLLECTION_MASTER_EDITION_ACCOUNT_INVALID]: - [ - 'CollectionMasterEditionAccountInvalid', - `Edition account doesnt match collection `, - ], - [MplTokenMetadataProgramErrorCode.ALREADY_VERIFIED]: [ - 'AlreadyVerified', - `Item is already verified.`, - ], - [MplTokenMetadataProgramErrorCode.ALREADY_UNVERIFIED]: [ - 'AlreadyUnverified', - `Item is already unverified.`, - ], - [MplTokenMetadataProgramErrorCode.NOT_A_PRINT_EDITION]: [ - 'NotAPrintEdition', - `This edition is not a Print Edition`, - ], - [MplTokenMetadataProgramErrorCode.INVALID_MASTER_EDITION]: [ - 'InvalidMasterEdition', - `Invalid Master Edition`, - ], - [MplTokenMetadataProgramErrorCode.INVALID_PRINT_EDITION]: [ - 'InvalidPrintEdition', - `Invalid Print Edition`, - ], - [MplTokenMetadataProgramErrorCode.INVALID_EDITION_MARKER]: [ - 'InvalidEditionMarker', - `Invalid Edition Marker`, - ], - [MplTokenMetadataProgramErrorCode.RESERVATION_LIST_DEPRECATED]: [ - 'ReservationListDeprecated', - `Reservation List is Deprecated`, - ], - [MplTokenMetadataProgramErrorCode.PRINT_EDITION_DOES_NOT_MATCH_MASTER_EDITION]: - [ - 'PrintEditionDoesNotMatchMasterEdition', - `Print Edition does not match Master Edition`, - ], - [MplTokenMetadataProgramErrorCode.EDITION_NUMBER_GREATER_THAN_MAX_SUPPLY]: [ - 'EditionNumberGreaterThanMaxSupply', - `Edition Number greater than max supply`, - ], - [MplTokenMetadataProgramErrorCode.MUST_UNVERIFY]: [ - 'MustUnverify', - `Must unverify before migrating collections.`, - ], - [MplTokenMetadataProgramErrorCode.INVALID_ESCROW_BUMP_SEED]: [ - 'InvalidEscrowBumpSeed', - `Invalid Escrow Account Bump Seed`, - ], - [MplTokenMetadataProgramErrorCode.MUST_BE_ESCROW_AUTHORITY]: [ - 'MustBeEscrowAuthority', - `Must Escrow Authority`, - ], - [MplTokenMetadataProgramErrorCode.INVALID_SYSTEM_PROGRAM]: [ - 'InvalidSystemProgram', - `Invalid System Program`, - ], - [MplTokenMetadataProgramErrorCode.MUST_BE_NON_FUNGIBLE]: [ - 'MustBeNonFungible', - `Must be a Non Fungible Token`, - ], - [MplTokenMetadataProgramErrorCode.INSUFFICIENT_TOKENS]: [ - 'InsufficientTokens', - `Insufficient tokens for transfer`, - ], - [MplTokenMetadataProgramErrorCode.BORSH_SERIALIZATION_ERROR]: [ - 'BorshSerializationError', - `Borsh Serialization Error`, - ], - [MplTokenMetadataProgramErrorCode.NO_FREEZE_AUTHORITY_SET]: [ - 'NoFreezeAuthoritySet', - `Cannot create NFT with no Freeze Authority.`, - ], - [MplTokenMetadataProgramErrorCode.INVALID_COLLECTION_SIZE_CHANGE]: [ - 'InvalidCollectionSizeChange', - `Invalid collection size change`, - ], - [MplTokenMetadataProgramErrorCode.INVALID_BUBBLEGUM_SIGNER]: [ - 'InvalidBubblegumSigner', - `Invalid bubblegum signer`, - ], - [MplTokenMetadataProgramErrorCode.MINT_IS_NOT_SIGNER]: [ - 'MintIsNotSigner', - `Mint needs to be signer to initialize the account`, - ], - [MplTokenMetadataProgramErrorCode.INVALID_TOKEN_STANDARD]: [ - 'InvalidTokenStandard', - `Invalid token standard`, - ], - [MplTokenMetadataProgramErrorCode.INVALID_MINT_FOR_TOKEN_STANDARD]: [ - 'InvalidMintForTokenStandard', - `Invalid mint account for specified token standard`, - ], - [MplTokenMetadataProgramErrorCode.INVALID_AUTHORIZATION_RULES]: [ - 'InvalidAuthorizationRules', - `Invalid authorization rules account`, - ], - [MplTokenMetadataProgramErrorCode.MISSING_AUTHORIZATION_RULES]: [ - 'MissingAuthorizationRules', - `Missing authorization rules account`, - ], - [MplTokenMetadataProgramErrorCode.MISSING_PROGRAMMABLE_CONFIG]: [ - 'MissingProgrammableConfig', - `Missing programmable configuration`, - ], - [MplTokenMetadataProgramErrorCode.INVALID_PROGRAMMABLE_CONFIG]: [ - 'InvalidProgrammableConfig', - `Invalid programmable configuration`, - ], - [MplTokenMetadataProgramErrorCode.DELEGATE_ALREADY_EXISTS]: [ - 'DelegateAlreadyExists', - `Delegate already exists`, - ], - [MplTokenMetadataProgramErrorCode.DELEGATE_NOT_FOUND]: [ - 'DelegateNotFound', - `Delegate not found`, - ], - [MplTokenMetadataProgramErrorCode.MISSING_ACCOUNT_IN_BUILDER]: [ - 'MissingAccountInBuilder', - `Required account not set in instruction builder`, - ], - [MplTokenMetadataProgramErrorCode.MISSING_ARGUMENT_IN_BUILDER]: [ - 'MissingArgumentInBuilder', - `Required argument not set in instruction builder`, - ], - [MplTokenMetadataProgramErrorCode.FEATURE_NOT_SUPPORTED]: [ - 'FeatureNotSupported', - `Feature not supported currently`, - ], - [MplTokenMetadataProgramErrorCode.INVALID_SYSTEM_WALLET]: [ - 'InvalidSystemWallet', - `Invalid system wallet`, - ], - [MplTokenMetadataProgramErrorCode.ONLY_SALE_DELEGATE_CAN_TRANSFER]: [ - 'OnlySaleDelegateCanTransfer', - `Only the sale delegate can transfer while its set`, - ], - [MplTokenMetadataProgramErrorCode.MISSING_TOKEN_ACCOUNT]: [ - 'MissingTokenAccount', - `Missing token account`, - ], - [MplTokenMetadataProgramErrorCode.MISSING_SPL_TOKEN_PROGRAM]: [ - 'MissingSplTokenProgram', - `Missing SPL token program`, - ], - [MplTokenMetadataProgramErrorCode.MISSING_AUTHORIZATION_RULES_PROGRAM]: [ - 'MissingAuthorizationRulesProgram', - `Missing SPL token program`, - ], - [MplTokenMetadataProgramErrorCode.INVALID_DELEGATE_ROLE_FOR_TRANSFER]: [ - 'InvalidDelegateRoleForTransfer', - `Invalid delegate role for transfer`, - ], + mplTokenMetadataErrorMessages = { + [MPL_TOKEN_METADATA_ERROR__ADDRESS_NOT_IN_RESERVATION]: `Address not in reservation!`, + [MPL_TOKEN_METADATA_ERROR__ALREADY_INITIALIZED]: `Already initialized`, + [MPL_TOKEN_METADATA_ERROR__ALREADY_UNVERIFIED]: `Item is already unverified.`, + [MPL_TOKEN_METADATA_ERROR__ALREADY_VERIFIED]: `Item is already verified.`, + [MPL_TOKEN_METADATA_ERROR__AUTHORIZATION_TOKEN_ACCOUNT_OWNER_MISMATCH]: `The authorization token account has a different owner than the update authority for the master edition!`, + [MPL_TOKEN_METADATA_ERROR__BEYOND_ALOTTED_ADDRESS_SIZE]: `Beyond alotted address size in reservation!`, + [MPL_TOKEN_METADATA_ERROR__BEYOND_MAX_ADDRESS_SIZE]: `Provided more addresses than max allowed in single reservation`, + [MPL_TOKEN_METADATA_ERROR__BORSH_DESERIALIZATION_ERROR]: `Borsh Deserialization Error`, + [MPL_TOKEN_METADATA_ERROR__BORSH_SERIALIZATION_ERROR]: `Borsh Serialization Error`, + [MPL_TOKEN_METADATA_ERROR__CANNOT_ADJUST_VERIFIED_CREATOR]: `Creator can not be adjusted once they are verified.`, + [MPL_TOKEN_METADATA_ERROR__CANNOT_CHANGE_USE_METHOD_AFTER_FIRST_USE]: `Cannot Change Use Method after the first use`, + [MPL_TOKEN_METADATA_ERROR__CANNOT_CHANGE_USES_AFTER_FIRST_USE]: `Cannot Change Remaining or Available uses after the first use`, + [MPL_TOKEN_METADATA_ERROR__CANNOT_REMOVE_VERIFIED_CREATOR]: `Verified creators cannot be removed.`, + [MPL_TOKEN_METADATA_ERROR__CANNOT_UNVERIFY_ANOTHER_CREATOR]: `You cannot unilaterally unverify another creator`, + [MPL_TOKEN_METADATA_ERROR__CANNOT_UPDATE_VERIFIED_COLLECTION]: `Cannot update a verified collection in this command`, + [MPL_TOKEN_METADATA_ERROR__CANNOT_VERIFY_ANOTHER_CREATOR]: `You cannot unilaterally verify another creator, they must sign`, + [MPL_TOKEN_METADATA_ERROR__CANNOT_WIPE_VERIFIED_CREATORS]: `Can not wipe verified creators.`, + [MPL_TOKEN_METADATA_ERROR__COLLECTION_AUTHORITY_DOES_NOT_EXIST]: `This Collection Authority Record Does Not Exist.`, + [MPL_TOKEN_METADATA_ERROR__COLLECTION_AUTHORITY_RECORD_ALREADY_EXISTS]: `This Collection Authority Record Already Exists.`, + [MPL_TOKEN_METADATA_ERROR__COLLECTION_CANNOT_BE_VERIFIED_IN_THIS_INSTRUCTION]: `Collection cannot be verified in this instruction`, + [MPL_TOKEN_METADATA_ERROR__COLLECTION_MASTER_EDITION_ACCOUNT_INVALID]: `Edition account doesnt match collection `, + [MPL_TOKEN_METADATA_ERROR__COLLECTION_MUST_BE_A_UNIQUE_MASTER_EDITION]: `Collection Must Be a Unique Master Edition v2`, + [MPL_TOKEN_METADATA_ERROR__COLLECTION_NOT_FOUND]: `Collection Not Found on Metadata`, + [MPL_TOKEN_METADATA_ERROR__COULD_NOT_DETERMINE_TOKEN_STANDARD]: `Could not determine a TokenStandard type.`, + [MPL_TOKEN_METADATA_ERROR__CREATOR_NOT_FOUND]: `This creator address was not found`, + [MPL_TOKEN_METADATA_ERROR__CREATORS_MUST_BE_ATLEAST_ONE]: `Creators must be at least one if set`, + [MPL_TOKEN_METADATA_ERROR__CREATORS_TOO_LONG]: `Creators list too long`, + [MPL_TOKEN_METADATA_ERROR__DATA_IS_IMMUTABLE]: `Data is immutable`, + [MPL_TOKEN_METADATA_ERROR__DATA_TYPE_MISMATCH]: `Data type mismatch`, + [MPL_TOKEN_METADATA_ERROR__DELEGATE_ALREADY_EXISTS]: `Delegate already exists`, + [MPL_TOKEN_METADATA_ERROR__DELEGATE_NOT_FOUND]: `Delegate not found`, + [MPL_TOKEN_METADATA_ERROR__DERIVED_KEY_INVALID]: `Derived key invalid`, + [MPL_TOKEN_METADATA_ERROR__DESTINATION_MINT_MISMATCH]: `The destination account does not have the right mint`, + [MPL_TOKEN_METADATA_ERROR__DISABLED]: `This feature is currently disabled.`, + [MPL_TOKEN_METADATA_ERROR__DUPLICATE_CREATOR_ADDRESS]: `No duplicate creator addresses`, + [MPL_TOKEN_METADATA_ERROR__EDITION_ALREADY_MINTED]: `An edition can only mint one of its kind!`, + [MPL_TOKEN_METADATA_ERROR__EDITION_MINT_DECIMALS_SHOULD_BE_ZERO]: `EditionMintDecimalsShouldBeZero`, + [MPL_TOKEN_METADATA_ERROR__EDITION_NUMBER_GREATER_THAN_MAX_SUPPLY]: `Edition Number greater than max supply`, + [MPL_TOKEN_METADATA_ERROR__EDITION_OVERRIDE_CANNOT_BE_ZERO]: `Edition override cannot be zero`, + [MPL_TOKEN_METADATA_ERROR__EDITIONS_MUST_HAVE_EXACTLY_ONE_TOKEN]: `Editions must have exactly one token`, + [MPL_TOKEN_METADATA_ERROR__FEATURE_NOT_SUPPORTED]: `Feature not supported currently`, + [MPL_TOKEN_METADATA_ERROR__INCORRECT_OWNER]: `Incorrect account owner`, + [MPL_TOKEN_METADATA_ERROR__INSTRUCTION_PACK_ERROR]: `Failed to pack instruction data`, + [MPL_TOKEN_METADATA_ERROR__INSTRUCTION_UNPACK_ERROR]: `Failed to unpack instruction data`, + [MPL_TOKEN_METADATA_ERROR__INSUFFICIENT_TOKENS]: `Insufficient tokens for transfer`, + [MPL_TOKEN_METADATA_ERROR__INVALID_AUTHORIZATION_RULES]: `Invalid authorization rules account`, + [MPL_TOKEN_METADATA_ERROR__INVALID_BASIS_POINTS]: `Basis points cannot be more than 10000`, + [MPL_TOKEN_METADATA_ERROR__INVALID_BUBBLEGUM_SIGNER]: `Invalid bubblegum signer`, + [MPL_TOKEN_METADATA_ERROR__INVALID_COLLECTION_AUTHORITY_RECORD]: `This Collection Authority Record is invalid.`, + [MPL_TOKEN_METADATA_ERROR__INVALID_COLLECTION_SIZE_CHANGE]: `Invalid collection size change`, + [MPL_TOKEN_METADATA_ERROR__INVALID_COLLECTION_UPDATE_AUTHORITY]: `Collection Update Authority is invalid`, + [MPL_TOKEN_METADATA_ERROR__INVALID_DELEGATE]: `All tokens in this account have not been delegated to this user.`, + [MPL_TOKEN_METADATA_ERROR__INVALID_DELEGATE_ROLE_FOR_TRANSFER]: `Invalid delegate role for transfer`, + [MPL_TOKEN_METADATA_ERROR__INVALID_EDITION_INDEX]: `You tried to insert one edition too many into an edition mark pda`, + [MPL_TOKEN_METADATA_ERROR__INVALID_EDITION_KEY]: `Edition's key must match seed of ['metadata', program id, name, 'edition'] provided`, + [MPL_TOKEN_METADATA_ERROR__INVALID_EDITION_MARKER]: `Invalid Edition Marker`, + [MPL_TOKEN_METADATA_ERROR__INVALID_ESCROW_BUMP_SEED]: `Invalid Escrow Account Bump Seed`, + [MPL_TOKEN_METADATA_ERROR__INVALID_FREEZE_AUTHORITY]: `Metadata does not match the freeze authority on the mint`, + [MPL_TOKEN_METADATA_ERROR__INVALID_MASTER_EDITION]: `Invalid Master Edition`, + [MPL_TOKEN_METADATA_ERROR__INVALID_METADATA_KEY]: ` Metadata's key must match seed of ['metadata', program id, mint] provided`, + [MPL_TOKEN_METADATA_ERROR__INVALID_MINT_AUTHORITY]: `Mint authority provided does not match the authority on the mint`, + [MPL_TOKEN_METADATA_ERROR__INVALID_MINT_FOR_TOKEN_STANDARD]: `Invalid mint account for specified token standard`, + [MPL_TOKEN_METADATA_ERROR__INVALID_OPERATION]: `Invalid operation`, + [MPL_TOKEN_METADATA_ERROR__INVALID_OWNER]: `Invalid Owner`, + [MPL_TOKEN_METADATA_ERROR__INVALID_PRINT_EDITION]: `Invalid Print Edition`, + [MPL_TOKEN_METADATA_ERROR__INVALID_PROGRAMMABLE_CONFIG]: `Invalid programmable configuration`, + [MPL_TOKEN_METADATA_ERROR__INVALID_SYSTEM_PROGRAM]: `Invalid System Program`, + [MPL_TOKEN_METADATA_ERROR__INVALID_SYSTEM_WALLET]: `Invalid system wallet`, + [MPL_TOKEN_METADATA_ERROR__INVALID_TOKEN_PROGRAM]: `Invalid token program`, + [MPL_TOKEN_METADATA_ERROR__INVALID_TOKEN_STANDARD]: `Invalid token standard`, + [MPL_TOKEN_METADATA_ERROR__INVALID_USE_AUTHORITY_RECORD]: `This Use Authority Record is invalid.`, + [MPL_TOKEN_METADATA_ERROR__INVALID_USE_METHOD]: `This use method is invalid`, + [MPL_TOKEN_METADATA_ERROR__INVALID_USER]: `Invalid User`, + [MPL_TOKEN_METADATA_ERROR__IS_MUTABLE_CAN_ONLY_BE_FLIPPED_TO_FALSE]: `Is Mutable can only be flipped to false`, + [MPL_TOKEN_METADATA_ERROR__MASTER_EDITION_HAS_PRINTS]: `This Master Edition has existing prints`, + [MPL_TOKEN_METADATA_ERROR__MASTER_RECORD_MISMATCH]: `The master edition record passed must match the master record on the edition given`, + [MPL_TOKEN_METADATA_ERROR__MAX_EDITIONS_MINTED_ALREADY]: `Maximum editions printed already`, + [MPL_TOKEN_METADATA_ERROR__MINT_IS_NOT_SIGNER]: `Mint needs to be signer to initialize the account`, + [MPL_TOKEN_METADATA_ERROR__MINT_MISMATCH]: `Mint given does not match mint on Metadata`, + [MPL_TOKEN_METADATA_ERROR__MISSING_ACCOUNT_IN_BUILDER]: `Required account not set in instruction builder`, + [MPL_TOKEN_METADATA_ERROR__MISSING_ARGUMENT_IN_BUILDER]: `Required argument not set in instruction builder`, + [MPL_TOKEN_METADATA_ERROR__MISSING_AUTHORIZATION_RULES]: `Missing authorization rules account`, + [MPL_TOKEN_METADATA_ERROR__MISSING_AUTHORIZATION_RULES_PROGRAM]: `Missing SPL token program`, + [MPL_TOKEN_METADATA_ERROR__MISSING_COLLECTION_METADATA]: `Can't burn a verified member of a collection w/o providing collection metadata account`, + [MPL_TOKEN_METADATA_ERROR__MISSING_EDITION_ACCOUNT]: `This mint account has an edition but none was provided.`, + [MPL_TOKEN_METADATA_ERROR__MISSING_PROGRAMMABLE_CONFIG]: `Missing programmable configuration`, + [MPL_TOKEN_METADATA_ERROR__MISSING_SPL_TOKEN_PROGRAM]: `Missing SPL token program`, + [MPL_TOKEN_METADATA_ERROR__MISSING_TOKEN_ACCOUNT]: `Missing token account`, + [MPL_TOKEN_METADATA_ERROR__MUST_BE_BURNED]: `This token use method is burn and there are no remaining uses, it must be burned`, + [MPL_TOKEN_METADATA_ERROR__MUST_BE_ESCROW_AUTHORITY]: `Must Escrow Authority`, + [MPL_TOKEN_METADATA_ERROR__MUST_BE_NON_FUNGIBLE]: `Must be a Non Fungible Token`, + [MPL_TOKEN_METADATA_ERROR__MUST_BE_ONE_OF_CREATORS]: `If using a creators array, you must be one of the creators listed`, + [MPL_TOKEN_METADATA_ERROR__MUST_UNVERIFY]: `Must unverify before migrating collections.`, + [MPL_TOKEN_METADATA_ERROR__NAME_TOO_LONG]: `Name too long`, + [MPL_TOKEN_METADATA_ERROR__NO_BALANCE_IN_ACCOUNT_FOR_AUTHORIZATION]: `This account has no tokens to be used for authorization`, + [MPL_TOKEN_METADATA_ERROR__NO_CREATORS_PRESENT_ON_METADATA]: `This metadata does not have creators`, + [MPL_TOKEN_METADATA_ERROR__NO_FREEZE_AUTHORITY_SET]: `Cannot create NFT with no Freeze Authority.`, + [MPL_TOKEN_METADATA_ERROR__NOT_A_COLLECTION_PARENT]: `This NFT is not a collection parent NFT.`, + [MPL_TOKEN_METADATA_ERROR__NOT_ALLOWED_TO_CHANGE_SELLER_FEE_BASIS_POINTS]: `Not allowed to change seller fee basis points.`, + [MPL_TOKEN_METADATA_ERROR__NOT_A_MASTER_EDITION]: `This edition is not a Master Edition`, + [MPL_TOKEN_METADATA_ERROR__NOT_A_MEMBER_OF_COLLECTION]: `This NFT is not a member of the specified collection.`, + [MPL_TOKEN_METADATA_ERROR__NOT_A_PRINT_EDITION]: `This edition is not a Print Edition`, + [MPL_TOKEN_METADATA_ERROR__NOT_ENOUGH_TOKENS]: `Not enough tokens to mint a limited edition`, + [MPL_TOKEN_METADATA_ERROR__NOT_ENOUGH_USES]: `There are not enough Uses left on this token.`, + [MPL_TOKEN_METADATA_ERROR__NOT_MINT_AUTHORITY]: `You must be the mint authority and signer on this transaction`, + [MPL_TOKEN_METADATA_ERROR__NOT_RENT_EXEMPT]: `Lamport balance below rent-exempt threshold`, + [MPL_TOKEN_METADATA_ERROR__NOT_VERIFIED_MEMBER_OF_COLLECTION]: `This NFT is not a verified member of the specified collection.`, + [MPL_TOKEN_METADATA_ERROR__NUMERICAL_OVERFLOW_ERROR]: `NumericalOverflowError`, + [MPL_TOKEN_METADATA_ERROR__ONE_TIME_AUTH_MINT_SUPPLY_MUST_BE_ZERO_FOR_CONVERSION]: `One Time Auth mint supply must be zero for conversion`, + [MPL_TOKEN_METADATA_ERROR__ONE_TIME_PRINTING_AUTH_MINT_MISMATCH]: `The One Time Printing Auth mint does not match that on the master edition!`, + [MPL_TOKEN_METADATA_ERROR__ONE_TIME_PRINTING_AUTHORIZATION_MINT_DECIMALS_SHOULD_BE_ZERO]: `OneTimePrintingAuthorization mint decimals should be zero`, + [MPL_TOKEN_METADATA_ERROR__ONLY_SALE_DELEGATE_CAN_TRANSFER]: `Only the sale delegate can transfer while its set`, + [MPL_TOKEN_METADATA_ERROR__OWNER_MISMATCH]: `Owner does not match that on the account given`, + [MPL_TOKEN_METADATA_ERROR__PRIMARY_SALE_CAN_ONLY_BE_FLIPPED_TO_TRUE]: `Primary sale can only be flipped to true and is immutable`, + [MPL_TOKEN_METADATA_ERROR__PRINT_EDITION_DOES_NOT_MATCH_MASTER_EDITION]: `Print Edition does not match Master Edition`, + [MPL_TOKEN_METADATA_ERROR__PRINTING_MINT_AUTHORIZATION_ACCOUNT_MISMATCH]: `The mint on your authorization token holding account does not match your Printing mint!`, + [MPL_TOKEN_METADATA_ERROR__PRINTING_MINT_DECIMALS_SHOULD_BE_ZERO]: `Printing mint decimals should be zero`, + [MPL_TOKEN_METADATA_ERROR__PRINTING_MINT_MISMATCH]: `The Printing mint does not match that on the master edition!`, + [MPL_TOKEN_METADATA_ERROR__PRINTING_MINT_SUPPLY_MUST_BE_ZERO_FOR_CONVERSION]: `Printing mint supply must be zero for conversion`, + [MPL_TOKEN_METADATA_ERROR__PRINTING_WOULD_BREACH_MAXIMUM_SUPPLY]: `printing these tokens would breach the maximum supply limit of the master edition`, + [MPL_TOKEN_METADATA_ERROR__REMOVED]: `This instruction was deprecated in a previous release and is now removed`, + [MPL_TOKEN_METADATA_ERROR__RESERVATION_ALREADY_MADE]: `This reservation list has already been set!`, + [MPL_TOKEN_METADATA_ERROR__RESERVATION_ARRAY_SHOULD_BE_SIZE_ONE]: `In the legacy system the reservation needs to be of size one for cpu limit reasons`, + [MPL_TOKEN_METADATA_ERROR__RESERVATION_BREACHES_MAXIMUM_SUPPLY]: `This reservation would go beyond the maximum supply of the master edition!`, + [MPL_TOKEN_METADATA_ERROR__RESERVATION_DOES_NOT_EXIST]: `This reservation list does not exist!`, + [MPL_TOKEN_METADATA_ERROR__RESERVATION_EXISTS]: `This reservation list already exists!`, + [MPL_TOKEN_METADATA_ERROR__RESERVATION_LIST_DEPRECATED]: `Reservation List is Deprecated`, + [MPL_TOKEN_METADATA_ERROR__RESERVATION_NOT_COMPLETE]: `The reservation has only been partially alotted`, + [MPL_TOKEN_METADATA_ERROR__RESERVATION_NOT_SET]: `This reservation list exists but was never set with reservations`, + [MPL_TOKEN_METADATA_ERROR__RESERVATION_SPOTS_REMAINING_SHOULD_MATCH_TOTAL_SPOTS_AT_START]: `Reservation spots remaining should match total spots when first being created`, + [MPL_TOKEN_METADATA_ERROR__REVOKE_COLLECTION_AUTHORITY_SIGNER_INCORRECT]: `Revoke Collection Authority signer is incorrect`, + [MPL_TOKEN_METADATA_ERROR__SHARE_TOTAL_MUST_BE100]: `Share total must equal 100 for creator array`, + [MPL_TOKEN_METADATA_ERROR__SIZED_COLLECTION]: `Can't use this function on a sized collection`, + [MPL_TOKEN_METADATA_ERROR__SPOT_MISMATCH]: `In initial reservation setting, spots remaining should equal total spots`, + [MPL_TOKEN_METADATA_ERROR__SYMBOL_TOO_LONG]: `Symbol too long`, + [MPL_TOKEN_METADATA_ERROR__TOKEN_ACCOUNT_MINT_MISMATCH]: `The mint of the token account does not match the Printing mint!`, + [MPL_TOKEN_METADATA_ERROR__TOKEN_ACCOUNT_MINT_MISMATCH_V2]: `The mint of the token account does not match the master metadata mint!`, + [MPL_TOKEN_METADATA_ERROR__TOKEN_ACCOUNT_ONE_TIME_AUTH_MINT_MISMATCH]: `The One Time authorization mint does not match that on the token account!`, + [MPL_TOKEN_METADATA_ERROR__TOKEN_BURN_FAILED]: `Token burn failed`, + [MPL_TOKEN_METADATA_ERROR__TOKEN_CLOSE_FAILED]: `Token close failed`, + [MPL_TOKEN_METADATA_ERROR__TOKEN_MINT_TO_FAILED]: `Token mint to failed`, + [MPL_TOKEN_METADATA_ERROR__TRIED_TO_REPLACE_AN_EXISTING_RESERVATION]: `You cannot splice over an existing reservation!`, + [MPL_TOKEN_METADATA_ERROR__UNINITIALIZED]: `Uninitialized`, + [MPL_TOKEN_METADATA_ERROR__UNSIZED_COLLECTION]: `Can't use this function on unsized collection`, + [MPL_TOKEN_METADATA_ERROR__UNUSABLE]: `This token has no uses`, + [MPL_TOKEN_METADATA_ERROR__UPDATE_AUTHORITY_INCORRECT]: `Update Authority given does not match`, + [MPL_TOKEN_METADATA_ERROR__UPDATE_AUTHORITY_IS_NOT_SIGNER]: `Update Authority needs to be signer to update metadata`, + [MPL_TOKEN_METADATA_ERROR__UPDATE_AUTHORITY_MUST_BE_EQUAL_TO_METADATA_AUTHORITY_AND_SIGNER]: `Update authority must be equivalent to the metadata's authority and also signer of this transaction`, + [MPL_TOKEN_METADATA_ERROR__URI_TOO_LONG]: `URI too long`, + [MPL_TOKEN_METADATA_ERROR__USE_AUTHORITY_RECORD_ALREADY_EXISTS]: `The Use Authority Record Already Exists, to modify it Revoke, then Approve`, + [MPL_TOKEN_METADATA_ERROR__USE_AUTHORITY_RECORD_ALREADY_REVOKED]: `The Use Authority Record is empty or already revoked`, }; } -export function getMplTokenMetadataProgramErrorFromCode( - code: MplTokenMetadataProgramErrorCode, - cause?: Error -): MplTokenMetadataProgramError { +export function getMplTokenMetadataErrorMessage( + code: MplTokenMetadataError +): string { if (__DEV__) { - return new MplTokenMetadataProgramError( - code, - ...( - mplTokenMetadataProgramErrorCodeMap as Record< - MplTokenMetadataProgramErrorCode, - [string, string] - > - )[code], - cause - ); + return ( + mplTokenMetadataErrorMessages as Record + )[code]; } - return new MplTokenMetadataProgramError( - code, - 'Unknown', - 'Error message not available in production bundles. Compile with __DEV__ set to true to see more information.', - cause - ); + return 'Error message not available in production bundles. Compile with `__DEV__` set to true to see more information.'; } diff --git a/test/packages/js-experimental/src/generated/programs/mplCandyMachineCore.ts b/test/packages/js-experimental/src/generated/programs/mplCandyMachineCore.ts index a8dcde33d..2b342ed28 100644 --- a/test/packages/js-experimental/src/generated/programs/mplCandyMachineCore.ts +++ b/test/packages/js-experimental/src/generated/programs/mplCandyMachineCore.ts @@ -8,12 +8,6 @@ import { Address } from '@solana/addresses'; import { containsBytes } from '@solana/codecs'; -import { Program, ProgramWithErrors } from '@solana/programs'; -import { - MplCandyMachineCoreProgramError, - MplCandyMachineCoreProgramErrorCode, - getMplCandyMachineCoreProgramErrorFromCode, -} from '../errors'; import { ParsedAddConfigLinesInstruction, ParsedDummyInstruction, @@ -29,23 +23,6 @@ import { export const MPL_CANDY_MACHINE_CORE_PROGRAM_ADDRESS = 'CndyV3LdqHUfDLmE5naZjVN8rBZz4tqhdefbAnjHG3JR' as Address<'CndyV3LdqHUfDLmE5naZjVN8rBZz4tqhdefbAnjHG3JR'>; -export type MplCandyMachineCoreProgram = - Program<'CndyV3LdqHUfDLmE5naZjVN8rBZz4tqhdefbAnjHG3JR'> & - ProgramWithErrors< - MplCandyMachineCoreProgramErrorCode, - MplCandyMachineCoreProgramError - >; - -export function getMplCandyMachineCoreProgram(): MplCandyMachineCoreProgram { - return { - name: 'mplCandyMachineCore', - address: MPL_CANDY_MACHINE_CORE_PROGRAM_ADDRESS, - getErrorFromCode(code: MplCandyMachineCoreProgramErrorCode, cause?: Error) { - return getMplCandyMachineCoreProgramErrorFromCode(code, cause); - }, - }; -} - export enum MplCandyMachineCoreAccount { CandyMachine, } diff --git a/test/packages/js-experimental/src/generated/programs/mplTokenAuthRules.ts b/test/packages/js-experimental/src/generated/programs/mplTokenAuthRules.ts index 8c411441e..8184b4dd7 100644 --- a/test/packages/js-experimental/src/generated/programs/mplTokenAuthRules.ts +++ b/test/packages/js-experimental/src/generated/programs/mplTokenAuthRules.ts @@ -8,12 +8,6 @@ import { Address } from '@solana/addresses'; import { containsBytes, getU64Encoder, getU8Encoder } from '@solana/codecs'; -import { Program, ProgramWithErrors } from '@solana/programs'; -import { - MplTokenAuthRulesProgramError, - MplTokenAuthRulesProgramErrorCode, - getMplTokenAuthRulesProgramErrorFromCode, -} from '../errors'; import { ParsedCreateFrequencyRuleInstruction, ParsedCreateRuleSetInstruction, @@ -24,23 +18,6 @@ import { TaKey } from '../types'; export const MPL_TOKEN_AUTH_RULES_PROGRAM_ADDRESS = 'auth9SigNpDKz4sJJ1DfCTuZrZNSAgh9sFD3rboVmgg' as Address<'auth9SigNpDKz4sJJ1DfCTuZrZNSAgh9sFD3rboVmgg'>; -export type MplTokenAuthRulesProgram = - Program<'auth9SigNpDKz4sJJ1DfCTuZrZNSAgh9sFD3rboVmgg'> & - ProgramWithErrors< - MplTokenAuthRulesProgramErrorCode, - MplTokenAuthRulesProgramError - >; - -export function getMplTokenAuthRulesProgram(): MplTokenAuthRulesProgram { - return { - name: 'mplTokenAuthRules', - address: MPL_TOKEN_AUTH_RULES_PROGRAM_ADDRESS, - getErrorFromCode(code: MplTokenAuthRulesProgramErrorCode, cause?: Error) { - return getMplTokenAuthRulesProgramErrorFromCode(code, cause); - }, - }; -} - export enum MplTokenAuthRulesAccount { FrequencyAccount, } diff --git a/test/packages/js-experimental/src/generated/programs/mplTokenMetadata.ts b/test/packages/js-experimental/src/generated/programs/mplTokenMetadata.ts index 1f3e2f943..0694721cd 100644 --- a/test/packages/js-experimental/src/generated/programs/mplTokenMetadata.ts +++ b/test/packages/js-experimental/src/generated/programs/mplTokenMetadata.ts @@ -8,12 +8,6 @@ import { Address } from '@solana/addresses'; import { containsBytes, getU8Encoder } from '@solana/codecs'; -import { Program, ProgramWithErrors } from '@solana/programs'; -import { - MplTokenMetadataProgramError, - MplTokenMetadataProgramErrorCode, - getMplTokenMetadataProgramErrorFromCode, -} from '../errors'; import { ParsedApproveCollectionAuthorityInstruction, ParsedApproveUseAuthorityInstruction, @@ -73,23 +67,6 @@ import { TmKey, getTmKeyEncoder } from '../types'; export const MPL_TOKEN_METADATA_PROGRAM_ADDRESS = 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' as Address<'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s'>; -export type MplTokenMetadataProgram = - Program<'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s'> & - ProgramWithErrors< - MplTokenMetadataProgramErrorCode, - MplTokenMetadataProgramError - >; - -export function getMplTokenMetadataProgram(): MplTokenMetadataProgram { - return { - name: 'mplTokenMetadata', - address: MPL_TOKEN_METADATA_PROGRAM_ADDRESS, - getErrorFromCode(code: MplTokenMetadataProgramErrorCode, cause?: Error) { - return getMplTokenMetadataProgramErrorFromCode(code, cause); - }, - }; -} - export enum MplTokenMetadataAccount { CollectionAuthorityRecord, DelegateRecord, diff --git a/test/packages/js-experimental/src/generated/programs/splMemo.ts b/test/packages/js-experimental/src/generated/programs/splMemo.ts index 600d7006f..fa7c026f7 100644 --- a/test/packages/js-experimental/src/generated/programs/splMemo.ts +++ b/test/packages/js-experimental/src/generated/programs/splMemo.ts @@ -7,22 +7,11 @@ */ import { Address } from '@solana/addresses'; -import { Program } from '@solana/programs'; import { ParsedAddMemoInstruction } from '../instructions'; export const SPL_MEMO_PROGRAM_ADDRESS = 'MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr' as Address<'MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr'>; -export type SplMemoProgram = - Program<'MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr'>; - -export function getSplMemoProgram(): SplMemoProgram { - return { - name: 'splMemo', - address: SPL_MEMO_PROGRAM_ADDRESS, - }; -} - export enum SplMemoInstruction { AddMemo, } diff --git a/test/packages/js-experimental/src/generated/programs/splSystem.ts b/test/packages/js-experimental/src/generated/programs/splSystem.ts index 2ba254477..9e2a033a4 100644 --- a/test/packages/js-experimental/src/generated/programs/splSystem.ts +++ b/test/packages/js-experimental/src/generated/programs/splSystem.ts @@ -8,7 +8,6 @@ import { Address } from '@solana/addresses'; import { containsBytes, getU32Encoder } from '@solana/codecs'; -import { Program } from '@solana/programs'; import { ParsedCreateAccountInstruction, ParsedTransferSolInstruction, @@ -17,15 +16,6 @@ import { export const SPL_SYSTEM_PROGRAM_ADDRESS = '11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>; -export type SplSystemProgram = Program<'11111111111111111111111111111111'>; - -export function getSplSystemProgram(): SplSystemProgram { - return { - name: 'splSystem', - address: SPL_SYSTEM_PROGRAM_ADDRESS, - }; -} - export enum SplSystemInstruction { CreateAccount, TransferSol,