From c694cde7a32b9a46e5f9cadab2db586274ee2876 Mon Sep 17 00:00:00 2001 From: Michael Danenberg <56533526+danenbm@users.noreply.github.com> Date: Wed, 31 Aug 2022 13:29:02 -0700 Subject: [PATCH] Regenerating API --- bubblegum/js/idl/bubblegum.json | 52 +++++-- bubblegum/js/src/generated/errors/index.ts | 166 ++++++++++++++++----- 2 files changed, 168 insertions(+), 50 deletions(-) diff --git a/bubblegum/js/idl/bubblegum.json b/bubblegum/js/idl/bubblegum.json index 04b0772210..ccc81a55d0 100644 --- a/bubblegum/js/idl/bubblegum.json +++ b/bubblegum/js/idl/bubblegum.json @@ -1835,88 +1835,108 @@ }, { "code": 6009, + "name": "CreatorHashMismatch", + "msg": "User-provided creator Vec must result in same user-provided creator hash" + }, + { + "code": 6010, + "name": "DataHashMismatch", + "msg": "User-provided metadata must result in same user-provided data hash" + }, + { + "code": 6011, "name": "CreatorsTooLong", "msg": "Creators list too long" }, { - "code": 6010, + "code": 6012, "name": "MetadataNameTooLong", "msg": "Name in metadata is too long" }, { - "code": 6011, + "code": 6013, "name": "MetadataSymbolTooLong", "msg": "Symbol in metadata is too long" }, { - "code": 6012, + "code": 6014, "name": "MetadataUriTooLong", "msg": "Uri in metadata is too long" }, { - "code": 6013, + "code": 6015, "name": "MetadataBasisPointsTooHigh", "msg": "Basis points in metadata cannot exceed 10000" }, { - "code": 6014, + "code": 6016, "name": "InsufficientMintCapacity", "msg": "Not enough unapproved mints left" }, { - "code": 6015, + "code": 6017, "name": "MintRequestNotApproved", "msg": "Mint request not approved" }, { - "code": 6016, + "code": 6018, "name": "MintRequestKeyMismatch", "msg": "Mint authority key does not match request" }, { - "code": 6017, + "code": 6019, "name": "MintRequestDiscriminatorMismatch", "msg": "Mint request data has incorrect disciminator" }, { - "code": 6018, + "code": 6020, "name": "CloseMintRequestError", "msg": "Something went wrong closing mint request" }, { - "code": 6019, + "code": 6021, + "name": "MintAuthorityMustSign", + "msg": "The mint authority must sign if it is not equal to the tree authority" + }, + { + "code": 6022, "name": "NumericalOverflowError", "msg": "NumericalOverflowError" }, { - "code": 6020, + "code": 6023, "name": "IncorrectOwner", "msg": "Incorrect account owner" }, { - "code": 6021, + "code": 6024, "name": "CollectionCannotBeVerifiedInThisInstruction", "msg": "Cannot Verify Collection in this Instruction" }, { - "code": 6022, + "code": 6025, "name": "CollectionNotFound", "msg": "Collection Not Found on Metadata" }, { - "code": 6023, + "code": 6026, "name": "AlreadyVerified", "msg": "Collection item is already verified." }, { - "code": 6024, + "code": 6027, "name": "AlreadyUnverified", "msg": "Collection item is already unverified." }, { - "code": 6025, + "code": 6028, "name": "UpdateAuthorityIncorrect", "msg": "Incorrect leaf metadata update authority." + }, + { + "code": 6029, + "name": "LeafAuthorityMustSign", + "msg": "This transaction must be signed by either the leaf owner or leaf delegate" } ], "metadata": { diff --git a/bubblegum/js/src/generated/errors/index.ts b/bubblegum/js/src/generated/errors/index.ts index 8e76588aec..e09f2649e1 100644 --- a/bubblegum/js/src/generated/errors/index.ts +++ b/bubblegum/js/src/generated/errors/index.ts @@ -221,6 +221,54 @@ createErrorFromNameLookup.set( () => new NoCreatorsPresentError() ) +/** + * CreatorHashMismatch: 'User-provided creator Vec must result in same user-provided creator hash' + * + * @category Errors + * @category generated + */ +export class CreatorHashMismatchError extends Error { + readonly code: number = 0x1779 + readonly name: string = 'CreatorHashMismatch' + constructor() { + super( + 'User-provided creator Vec must result in same user-provided creator hash' + ) + if (typeof Error.captureStackTrace === 'function') { + Error.captureStackTrace(this, CreatorHashMismatchError) + } + } +} + +createErrorFromCodeLookup.set(0x1779, () => new CreatorHashMismatchError()) +createErrorFromNameLookup.set( + 'CreatorHashMismatch', + () => new CreatorHashMismatchError() +) + +/** + * DataHashMismatch: 'User-provided metadata must result in same user-provided data hash' + * + * @category Errors + * @category generated + */ +export class DataHashMismatchError extends Error { + readonly code: number = 0x177a + readonly name: string = 'DataHashMismatch' + constructor() { + super('User-provided metadata must result in same user-provided data hash') + if (typeof Error.captureStackTrace === 'function') { + Error.captureStackTrace(this, DataHashMismatchError) + } + } +} + +createErrorFromCodeLookup.set(0x177a, () => new DataHashMismatchError()) +createErrorFromNameLookup.set( + 'DataHashMismatch', + () => new DataHashMismatchError() +) + /** * CreatorsTooLong: 'Creators list too long' * @@ -228,7 +276,7 @@ createErrorFromNameLookup.set( * @category generated */ export class CreatorsTooLongError extends Error { - readonly code: number = 0x1779 + readonly code: number = 0x177b readonly name: string = 'CreatorsTooLong' constructor() { super('Creators list too long') @@ -238,7 +286,7 @@ export class CreatorsTooLongError extends Error { } } -createErrorFromCodeLookup.set(0x1779, () => new CreatorsTooLongError()) +createErrorFromCodeLookup.set(0x177b, () => new CreatorsTooLongError()) createErrorFromNameLookup.set( 'CreatorsTooLong', () => new CreatorsTooLongError() @@ -251,7 +299,7 @@ createErrorFromNameLookup.set( * @category generated */ export class MetadataNameTooLongError extends Error { - readonly code: number = 0x177a + readonly code: number = 0x177c readonly name: string = 'MetadataNameTooLong' constructor() { super('Name in metadata is too long') @@ -261,7 +309,7 @@ export class MetadataNameTooLongError extends Error { } } -createErrorFromCodeLookup.set(0x177a, () => new MetadataNameTooLongError()) +createErrorFromCodeLookup.set(0x177c, () => new MetadataNameTooLongError()) createErrorFromNameLookup.set( 'MetadataNameTooLong', () => new MetadataNameTooLongError() @@ -274,7 +322,7 @@ createErrorFromNameLookup.set( * @category generated */ export class MetadataSymbolTooLongError extends Error { - readonly code: number = 0x177b + readonly code: number = 0x177d readonly name: string = 'MetadataSymbolTooLong' constructor() { super('Symbol in metadata is too long') @@ -284,7 +332,7 @@ export class MetadataSymbolTooLongError extends Error { } } -createErrorFromCodeLookup.set(0x177b, () => new MetadataSymbolTooLongError()) +createErrorFromCodeLookup.set(0x177d, () => new MetadataSymbolTooLongError()) createErrorFromNameLookup.set( 'MetadataSymbolTooLong', () => new MetadataSymbolTooLongError() @@ -297,7 +345,7 @@ createErrorFromNameLookup.set( * @category generated */ export class MetadataUriTooLongError extends Error { - readonly code: number = 0x177c + readonly code: number = 0x177e readonly name: string = 'MetadataUriTooLong' constructor() { super('Uri in metadata is too long') @@ -307,7 +355,7 @@ export class MetadataUriTooLongError extends Error { } } -createErrorFromCodeLookup.set(0x177c, () => new MetadataUriTooLongError()) +createErrorFromCodeLookup.set(0x177e, () => new MetadataUriTooLongError()) createErrorFromNameLookup.set( 'MetadataUriTooLong', () => new MetadataUriTooLongError() @@ -320,7 +368,7 @@ createErrorFromNameLookup.set( * @category generated */ export class MetadataBasisPointsTooHighError extends Error { - readonly code: number = 0x177d + readonly code: number = 0x177f readonly name: string = 'MetadataBasisPointsTooHigh' constructor() { super('Basis points in metadata cannot exceed 10000') @@ -331,7 +379,7 @@ export class MetadataBasisPointsTooHighError extends Error { } createErrorFromCodeLookup.set( - 0x177d, + 0x177f, () => new MetadataBasisPointsTooHighError() ) createErrorFromNameLookup.set( @@ -346,7 +394,7 @@ createErrorFromNameLookup.set( * @category generated */ export class InsufficientMintCapacityError extends Error { - readonly code: number = 0x177e + readonly code: number = 0x1780 readonly name: string = 'InsufficientMintCapacity' constructor() { super('Not enough unapproved mints left') @@ -356,7 +404,7 @@ export class InsufficientMintCapacityError extends Error { } } -createErrorFromCodeLookup.set(0x177e, () => new InsufficientMintCapacityError()) +createErrorFromCodeLookup.set(0x1780, () => new InsufficientMintCapacityError()) createErrorFromNameLookup.set( 'InsufficientMintCapacity', () => new InsufficientMintCapacityError() @@ -369,7 +417,7 @@ createErrorFromNameLookup.set( * @category generated */ export class MintRequestNotApprovedError extends Error { - readonly code: number = 0x177f + readonly code: number = 0x1781 readonly name: string = 'MintRequestNotApproved' constructor() { super('Mint request not approved') @@ -379,7 +427,7 @@ export class MintRequestNotApprovedError extends Error { } } -createErrorFromCodeLookup.set(0x177f, () => new MintRequestNotApprovedError()) +createErrorFromCodeLookup.set(0x1781, () => new MintRequestNotApprovedError()) createErrorFromNameLookup.set( 'MintRequestNotApproved', () => new MintRequestNotApprovedError() @@ -392,7 +440,7 @@ createErrorFromNameLookup.set( * @category generated */ export class MintRequestKeyMismatchError extends Error { - readonly code: number = 0x1780 + readonly code: number = 0x1782 readonly name: string = 'MintRequestKeyMismatch' constructor() { super('Mint authority key does not match request') @@ -402,7 +450,7 @@ export class MintRequestKeyMismatchError extends Error { } } -createErrorFromCodeLookup.set(0x1780, () => new MintRequestKeyMismatchError()) +createErrorFromCodeLookup.set(0x1782, () => new MintRequestKeyMismatchError()) createErrorFromNameLookup.set( 'MintRequestKeyMismatch', () => new MintRequestKeyMismatchError() @@ -415,7 +463,7 @@ createErrorFromNameLookup.set( * @category generated */ export class MintRequestDiscriminatorMismatchError extends Error { - readonly code: number = 0x1781 + readonly code: number = 0x1783 readonly name: string = 'MintRequestDiscriminatorMismatch' constructor() { super('Mint request data has incorrect disciminator') @@ -426,7 +474,7 @@ export class MintRequestDiscriminatorMismatchError extends Error { } createErrorFromCodeLookup.set( - 0x1781, + 0x1783, () => new MintRequestDiscriminatorMismatchError() ) createErrorFromNameLookup.set( @@ -441,7 +489,7 @@ createErrorFromNameLookup.set( * @category generated */ export class CloseMintRequestErrorError extends Error { - readonly code: number = 0x1782 + readonly code: number = 0x1784 readonly name: string = 'CloseMintRequestError' constructor() { super('Something went wrong closing mint request') @@ -451,12 +499,37 @@ export class CloseMintRequestErrorError extends Error { } } -createErrorFromCodeLookup.set(0x1782, () => new CloseMintRequestErrorError()) +createErrorFromCodeLookup.set(0x1784, () => new CloseMintRequestErrorError()) createErrorFromNameLookup.set( 'CloseMintRequestError', () => new CloseMintRequestErrorError() ) +/** + * MintAuthorityMustSign: 'The mint authority must sign if it is not equal to the tree authority' + * + * @category Errors + * @category generated + */ +export class MintAuthorityMustSignError extends Error { + readonly code: number = 0x1785 + readonly name: string = 'MintAuthorityMustSign' + constructor() { + super( + 'The mint authority must sign if it is not equal to the tree authority' + ) + if (typeof Error.captureStackTrace === 'function') { + Error.captureStackTrace(this, MintAuthorityMustSignError) + } + } +} + +createErrorFromCodeLookup.set(0x1785, () => new MintAuthorityMustSignError()) +createErrorFromNameLookup.set( + 'MintAuthorityMustSign', + () => new MintAuthorityMustSignError() +) + /** * NumericalOverflowError: 'NumericalOverflowError' * @@ -464,7 +537,7 @@ createErrorFromNameLookup.set( * @category generated */ export class NumericalOverflowErrorError extends Error { - readonly code: number = 0x1783 + readonly code: number = 0x1786 readonly name: string = 'NumericalOverflowError' constructor() { super('NumericalOverflowError') @@ -474,7 +547,7 @@ export class NumericalOverflowErrorError extends Error { } } -createErrorFromCodeLookup.set(0x1783, () => new NumericalOverflowErrorError()) +createErrorFromCodeLookup.set(0x1786, () => new NumericalOverflowErrorError()) createErrorFromNameLookup.set( 'NumericalOverflowError', () => new NumericalOverflowErrorError() @@ -487,7 +560,7 @@ createErrorFromNameLookup.set( * @category generated */ export class IncorrectOwnerError extends Error { - readonly code: number = 0x1784 + readonly code: number = 0x1787 readonly name: string = 'IncorrectOwner' constructor() { super('Incorrect account owner') @@ -497,7 +570,7 @@ export class IncorrectOwnerError extends Error { } } -createErrorFromCodeLookup.set(0x1784, () => new IncorrectOwnerError()) +createErrorFromCodeLookup.set(0x1787, () => new IncorrectOwnerError()) createErrorFromNameLookup.set('IncorrectOwner', () => new IncorrectOwnerError()) /** @@ -507,7 +580,7 @@ createErrorFromNameLookup.set('IncorrectOwner', () => new IncorrectOwnerError()) * @category generated */ export class CollectionCannotBeVerifiedInThisInstructionError extends Error { - readonly code: number = 0x1785 + readonly code: number = 0x1788 readonly name: string = 'CollectionCannotBeVerifiedInThisInstruction' constructor() { super('Cannot Verify Collection in this Instruction') @@ -521,7 +594,7 @@ export class CollectionCannotBeVerifiedInThisInstructionError extends Error { } createErrorFromCodeLookup.set( - 0x1785, + 0x1788, () => new CollectionCannotBeVerifiedInThisInstructionError() ) createErrorFromNameLookup.set( @@ -536,7 +609,7 @@ createErrorFromNameLookup.set( * @category generated */ export class CollectionNotFoundError extends Error { - readonly code: number = 0x1786 + readonly code: number = 0x1789 readonly name: string = 'CollectionNotFound' constructor() { super('Collection Not Found on Metadata') @@ -546,7 +619,7 @@ export class CollectionNotFoundError extends Error { } } -createErrorFromCodeLookup.set(0x1786, () => new CollectionNotFoundError()) +createErrorFromCodeLookup.set(0x1789, () => new CollectionNotFoundError()) createErrorFromNameLookup.set( 'CollectionNotFound', () => new CollectionNotFoundError() @@ -559,7 +632,7 @@ createErrorFromNameLookup.set( * @category generated */ export class AlreadyVerifiedError extends Error { - readonly code: number = 0x1787 + readonly code: number = 0x178a readonly name: string = 'AlreadyVerified' constructor() { super('Collection item is already verified.') @@ -569,7 +642,7 @@ export class AlreadyVerifiedError extends Error { } } -createErrorFromCodeLookup.set(0x1787, () => new AlreadyVerifiedError()) +createErrorFromCodeLookup.set(0x178a, () => new AlreadyVerifiedError()) createErrorFromNameLookup.set( 'AlreadyVerified', () => new AlreadyVerifiedError() @@ -582,7 +655,7 @@ createErrorFromNameLookup.set( * @category generated */ export class AlreadyUnverifiedError extends Error { - readonly code: number = 0x1788 + readonly code: number = 0x178b readonly name: string = 'AlreadyUnverified' constructor() { super('Collection item is already unverified.') @@ -592,7 +665,7 @@ export class AlreadyUnverifiedError extends Error { } } -createErrorFromCodeLookup.set(0x1788, () => new AlreadyUnverifiedError()) +createErrorFromCodeLookup.set(0x178b, () => new AlreadyUnverifiedError()) createErrorFromNameLookup.set( 'AlreadyUnverified', () => new AlreadyUnverifiedError() @@ -605,7 +678,7 @@ createErrorFromNameLookup.set( * @category generated */ export class UpdateAuthorityIncorrectError extends Error { - readonly code: number = 0x1789 + readonly code: number = 0x178c readonly name: string = 'UpdateAuthorityIncorrect' constructor() { super('Incorrect leaf metadata update authority.') @@ -615,12 +688,37 @@ export class UpdateAuthorityIncorrectError extends Error { } } -createErrorFromCodeLookup.set(0x1789, () => new UpdateAuthorityIncorrectError()) +createErrorFromCodeLookup.set(0x178c, () => new UpdateAuthorityIncorrectError()) createErrorFromNameLookup.set( 'UpdateAuthorityIncorrect', () => new UpdateAuthorityIncorrectError() ) +/** + * LeafAuthorityMustSign: 'This transaction must be signed by either the leaf owner or leaf delegate' + * + * @category Errors + * @category generated + */ +export class LeafAuthorityMustSignError extends Error { + readonly code: number = 0x178d + readonly name: string = 'LeafAuthorityMustSign' + constructor() { + super( + 'This transaction must be signed by either the leaf owner or leaf delegate' + ) + if (typeof Error.captureStackTrace === 'function') { + Error.captureStackTrace(this, LeafAuthorityMustSignError) + } + } +} + +createErrorFromCodeLookup.set(0x178d, () => new LeafAuthorityMustSignError()) +createErrorFromNameLookup.set( + 'LeafAuthorityMustSign', + () => new LeafAuthorityMustSignError() +) + /** * Attempts to resolve a custom program error from the provided error code. * @category Errors