/**
 * This code was AUTOGENERATED using the kinobi library.
 * Please DO NOT EDIT THIS FILE, instead use visitors
 * to add features, then rerun kinobi to update it.
 *
 * @see https://github.com/metaplex-foundation/kinobi
 */

/** InvalidOwner: Associated token account owner does not match address derivation */
export const ASSOCIATED_TOKEN_ERROR__INVALID_OWNER = 0x0; // 0

export type AssociatedTokenError = typeof ASSOCIATED_TOKEN_ERROR__INVALID_OWNER;

let associatedTokenErrorMessages:
  | Record<AssociatedTokenError, string>
  | undefined;
if (__DEV__) {
  associatedTokenErrorMessages = {
    [ASSOCIATED_TOKEN_ERROR__INVALID_OWNER]: `Associated token account owner does not match address derivation`,
  };
}

export function getAssociatedTokenErrorMessage(
  code: AssociatedTokenError
): string {
  if (__DEV__) {
    return (
      associatedTokenErrorMessages as Record<AssociatedTokenError, string>
    )[code];
  }

  return 'Error message not available in production bundles. Compile with `__DEV__` set to true to see more information.';
}
