import { SystemProgram } from '@solarti/web3.js';
import { createAccountOperation, createAccountOperationHandler, transferSolOperation, transferSolOperationHandler, } from './operations';
import { SystemClient } from './SystemClient';
/**
 * @group Plugins
 */
/** @group Plugins */
export const systemModule = () => ({
    install(metaplex) {
        // Program.
        const systemProgram = {
            name: 'SystemProgram',
            address: SystemProgram.programId,
        };
        metaplex.programs().register(systemProgram);
        metaplex.programs().getSystem = function (programs) {
            return this.get(systemProgram.name, programs);
        };
        // Operations.
        const op = metaplex.operations();
        op.register(createAccountOperation, createAccountOperationHandler);
        op.register(transferSolOperation, transferSolOperationHandler);
        metaplex.system = function () {
            return new SystemClient(this);
        };
    },
});
//# sourceMappingURL=plugin.js.map