'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var mplCandyGuard = require('@metaplex-foundation/mpl-candy-guard');
var mplCandyMachineCore = require('@metaplex-foundation/mpl-candy-machine-core');
var assert = require('../../utils/assert.cjs');
var _default = require('./guards/default.cjs');
var web3_js = require('@solarti/web3.js');

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

/** @group Programs */

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

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

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

exports.assertCandyGuardProgram = assertCandyGuardProgram;
exports.candyMachineProgram = candyMachineProgram;
exports.defaultCandyGuardProgram = defaultCandyGuardProgram;
exports.gatewayProgram = gatewayProgram;
exports.isCandyGuardProgram = isCandyGuardProgram;
//# sourceMappingURL=programs.cjs.map
