/** * This code was GENERATED using the solita package. * Please DO NOT EDIT THIS FILE, instead rerun solita to update it or write a wrapper to add functionality. * * See: https://github.com/metaplex-foundation/solita */ type ErrorWithCode = Error & { code: number } type MaybeErrorWithCode = ErrorWithCode | null | undefined const createErrorFromCodeLookup: Map ErrorWithCode> = new Map() const createErrorFromNameLookup: Map ErrorWithCode> = new Map() /** * InvalidDataSize: 'Invalid data size' * * @category Errors * @category generated */ export class InvalidDataSizeError extends Error { readonly code: number = 0x1770 readonly name: string = 'InvalidDataSize' constructor() { super('Invalid data size') if (typeof Error.captureStackTrace === 'function') { Error.captureStackTrace(this, InvalidDataSizeError) } } } createErrorFromCodeLookup.set(0x1770, () => new InvalidDataSizeError()) createErrorFromNameLookup.set( 'InvalidDataSize', () => new InvalidDataSizeError() ) /** * PassedMintDoesNotMatch: 'Passed mint account does not match' * * @category Errors * @category generated */ export class PassedMintDoesNotMatchError extends Error { readonly code: number = 0x1771 readonly name: string = 'PassedMintDoesNotMatch' constructor() { super('Passed mint account does not match') if (typeof Error.captureStackTrace === 'function') { Error.captureStackTrace(this, PassedMintDoesNotMatchError) } } } createErrorFromCodeLookup.set(0x1771, () => new PassedMintDoesNotMatchError()) createErrorFromNameLookup.set( 'PassedMintDoesNotMatch', () => new PassedMintDoesNotMatchError() ) /** * InvalidReceiver: 'Passed account is not an associated token account of a receiver' * * @category Errors * @category generated */ export class InvalidReceiverError extends Error { readonly code: number = 0x1772 readonly name: string = 'InvalidReceiver' constructor() { super('Passed account is not an associated token account of a receiver') if (typeof Error.captureStackTrace === 'function') { Error.captureStackTrace(this, InvalidReceiverError) } } } createErrorFromCodeLookup.set(0x1772, () => new InvalidReceiverError()) createErrorFromNameLookup.set( 'InvalidReceiver', () => new InvalidReceiverError() ) /** * NotFirstToPrepare: 'Passed address is not of a party first to prepare for settlement' * * @category Errors * @category generated */ export class NotFirstToPrepareError extends Error { readonly code: number = 0x1773 readonly name: string = 'NotFirstToPrepare' constructor() { super('Passed address is not of a party first to prepare for settlement') if (typeof Error.captureStackTrace === 'function') { Error.captureStackTrace(this, NotFirstToPrepareError) } } } createErrorFromCodeLookup.set(0x1773, () => new NotFirstToPrepareError()) createErrorFromNameLookup.set( 'NotFirstToPrepare', () => new NotFirstToPrepareError() ) /** * PassedAmericanMetaDoesNotMatch: 'Passed metadata account does not match' * * @category Errors * @category generated */ export class PassedAmericanMetaDoesNotMatchError extends Error { readonly code: number = 0x1774 readonly name: string = 'PassedAmericanMetaDoesNotMatch' constructor() { super('Passed metadata account does not match') if (typeof Error.captureStackTrace === 'function') { Error.captureStackTrace(this, PassedAmericanMetaDoesNotMatchError) } } } createErrorFromCodeLookup.set( 0x1774, () => new PassedAmericanMetaDoesNotMatchError() ) createErrorFromNameLookup.set( 'PassedAmericanMetaDoesNotMatch', () => new PassedAmericanMetaDoesNotMatchError() ) /** * PassedUnderlyingAmountPerContractDoesNotMatch: 'Passed underlying amount per contract does not match' * * @category Errors * @category generated */ export class PassedUnderlyingAmountPerContractDoesNotMatchError extends Error { readonly code: number = 0x1775 readonly name: string = 'PassedUnderlyingAmountPerContractDoesNotMatch' constructor() { super('Passed underlying amount per contract does not match') if (typeof Error.captureStackTrace === 'function') { Error.captureStackTrace( this, PassedUnderlyingAmountPerContractDoesNotMatchError ) } } } createErrorFromCodeLookup.set( 0x1775, () => new PassedUnderlyingAmountPerContractDoesNotMatchError() ) createErrorFromNameLookup.set( 'PassedUnderlyingAmountPerContractDoesNotMatch', () => new PassedUnderlyingAmountPerContractDoesNotMatchError() ) /** * PassedUnderlyingAmountPerContractDecimalsDoesNotMatch: 'Passed underlying amount per contract decimals does not match' * * @category Errors * @category generated */ export class PassedUnderlyingAmountPerContractDecimalsDoesNotMatchError extends Error { readonly code: number = 0x1776 readonly name: string = 'PassedUnderlyingAmountPerContractDecimalsDoesNotMatch' constructor() { super('Passed underlying amount per contract decimals does not match') if (typeof Error.captureStackTrace === 'function') { Error.captureStackTrace( this, PassedUnderlyingAmountPerContractDecimalsDoesNotMatchError ) } } } createErrorFromCodeLookup.set( 0x1776, () => new PassedUnderlyingAmountPerContractDecimalsDoesNotMatchError() ) createErrorFromNameLookup.set( 'PassedUnderlyingAmountPerContractDecimalsDoesNotMatch', () => new PassedUnderlyingAmountPerContractDecimalsDoesNotMatchError() ) /** * PassedStrikePriceDoesNotMatch: 'Passed strike price does not match' * * @category Errors * @category generated */ export class PassedStrikePriceDoesNotMatchError extends Error { readonly code: number = 0x1777 readonly name: string = 'PassedStrikePriceDoesNotMatch' constructor() { super('Passed strike price does not match') if (typeof Error.captureStackTrace === 'function') { Error.captureStackTrace(this, PassedStrikePriceDoesNotMatchError) } } } createErrorFromCodeLookup.set( 0x1777, () => new PassedStrikePriceDoesNotMatchError() ) createErrorFromNameLookup.set( 'PassedStrikePriceDoesNotMatch', () => new PassedStrikePriceDoesNotMatchError() ) /** * PassedStrikePriceDecimalsDoesNotMatch: 'Passed strike price decimals does not match' * * @category Errors * @category generated */ export class PassedStrikePriceDecimalsDoesNotMatchError extends Error { readonly code: number = 0x1778 readonly name: string = 'PassedStrikePriceDecimalsDoesNotMatch' constructor() { super('Passed strike price decimals does not match') if (typeof Error.captureStackTrace === 'function') { Error.captureStackTrace(this, PassedStrikePriceDecimalsDoesNotMatchError) } } } createErrorFromCodeLookup.set( 0x1778, () => new PassedStrikePriceDecimalsDoesNotMatchError() ) createErrorFromNameLookup.set( 'PassedStrikePriceDecimalsDoesNotMatch', () => new PassedStrikePriceDecimalsDoesNotMatchError() ) /** * PassedExpirationTimestampDoesNotMatch: 'Passed expiration timestamp does not match' * * @category Errors * @category generated */ export class PassedExpirationTimestampDoesNotMatchError extends Error { readonly code: number = 0x1779 readonly name: string = 'PassedExpirationTimestampDoesNotMatch' constructor() { super('Passed expiration timestamp does not match') if (typeof Error.captureStackTrace === 'function') { Error.captureStackTrace(this, PassedExpirationTimestampDoesNotMatchError) } } } createErrorFromCodeLookup.set( 0x1779, () => new PassedExpirationTimestampDoesNotMatchError() ) createErrorFromNameLookup.set( 'PassedExpirationTimestampDoesNotMatch', () => new PassedExpirationTimestampDoesNotMatchError() ) /** * StablecoinAsBaseAssetIsNotSupported: 'Stablecoin as base asset is not supported' * * @category Errors * @category generated */ export class StablecoinAsBaseAssetIsNotSupportedError extends Error { readonly code: number = 0x177a readonly name: string = 'StablecoinAsBaseAssetIsNotSupported' constructor() { super('Stablecoin as base asset is not supported') if (typeof Error.captureStackTrace === 'function') { Error.captureStackTrace(this, StablecoinAsBaseAssetIsNotSupportedError) } } } createErrorFromCodeLookup.set( 0x177a, () => new StablecoinAsBaseAssetIsNotSupportedError() ) createErrorFromNameLookup.set( 'StablecoinAsBaseAssetIsNotSupported', () => new StablecoinAsBaseAssetIsNotSupportedError() ) /** * DecimalsAmountDoesNotMatch: 'Passed decimals does not match' * * @category Errors * @category generated */ export class DecimalsAmountDoesNotMatchError extends Error { readonly code: number = 0x177b readonly name: string = 'DecimalsAmountDoesNotMatch' constructor() { super('Passed decimals does not match') if (typeof Error.captureStackTrace === 'function') { Error.captureStackTrace(this, DecimalsAmountDoesNotMatchError) } } } createErrorFromCodeLookup.set( 0x177b, () => new DecimalsAmountDoesNotMatchError() ) createErrorFromNameLookup.set( 'DecimalsAmountDoesNotMatch', () => new DecimalsAmountDoesNotMatchError() ) /** * BaseAssetDoesNotMatch: 'Base Asset doesnt match' * * @category Errors * @category generated */ export class BaseAssetDoesNotMatchError extends Error { readonly code: number = 0x177c readonly name: string = 'BaseAssetDoesNotMatch' constructor() { super('Base Asset doesnt match') if (typeof Error.captureStackTrace === 'function') { Error.captureStackTrace(this, BaseAssetDoesNotMatchError) } } } createErrorFromCodeLookup.set(0x177c, () => new BaseAssetDoesNotMatchError()) createErrorFromNameLookup.set( 'BaseAssetDoesNotMatch', () => new BaseAssetDoesNotMatchError() ) /** * Attempts to resolve a custom program error from the provided error code. * @category Errors * @category generated */ export function errorFromCode(code: number): MaybeErrorWithCode { const createError = createErrorFromCodeLookup.get(code) return createError != null ? createError() : null } /** * Attempts to resolve a custom program error from the provided error name, i.e. 'Unauthorized'. * @category Errors * @category generated */ export function errorFromName(name: string): MaybeErrorWithCode { const createError = createErrorFromNameLookup.get(name) return createError != null ? createError() : null }