import { PROGRAM_ID as PROGRAM_ID$1, cusper as cusper$1 } from '@metaplex-foundation/mpl-candy-guard';
import { PROGRAM_ID, cusper } from '@metaplex-foundation/mpl-candy-machine-core';
import assert from '../../utils/assert.mjs';
import { defaultCandyGuardNames } from './guards/default.mjs';
import { PublicKey } from '@solarti/web3.js';

/** @group Programs */
const candyMachineProgram = {
  name: 'CandyMachineProgram',
  address: PROGRAM_ID,
  errorResolver: error => cusper.errorFromProgramLogs(error.logs, false)
};

/** @group Programs */

const isCandyGuardProgram = value => typeof value === 'object' && 'availableGuards' in value;
function assertCandyGuardProgram(value) {
  assert(isCandyGuardProgram(value), `Expected CandyGuardProgram model`);
}

/** @group Programs */
const defaultCandyGuardProgram = {
  name: 'CandyGuardProgram',
  address: PROGRAM_ID$1,
  errorResolver: error => cusper$1.errorFromProgramLogs(error.logs, false),
  availableGuards: defaultCandyGuardNames
};

/** @group Programs */
const gatewayProgram = {
  name: 'GatewayProgram',
  address: new PublicKey('gatem74V238djXdzWnJf94Wo1DcnuGkfijbf3AuBhfs')
};

export { assertCandyGuardProgram, candyMachineProgram, defaultCandyGuardProgram, gatewayProgram, isCandyGuardProgram };
//# sourceMappingURL=programs.mjs.map
