'use strict';

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

var web3_js = require('@solarti/web3.js');
var SystemClient = require('./SystemClient.cjs');
var createAccount = require('./operations/createAccount.cjs');
var transferSol = require('./operations/transferSol.cjs');

/**
 * @group Plugins
 */
/** @group Plugins */
const systemModule = () => ({
  install(metaplex) {
    // Program.
    const systemProgram = {
      name: 'SystemProgram',
      address: web3_js.SystemProgram.programId
    };
    metaplex.programs().register(systemProgram);
    metaplex.programs().getSystem = function (programs) {
      return this.get(systemProgram.name, programs);
    };

    // Operations.
    const op = metaplex.operations();
    op.register(createAccount.createAccountOperation, createAccount.createAccountOperationHandler);
    op.register(transferSol.transferSolOperation, transferSol.transferSolOperationHandler);
    metaplex.system = function () {
      return new SystemClient.SystemClient(this);
    };
  }
});

exports.systemModule = systemModule;
//# sourceMappingURL=plugin.cjs.map
