"use strict";
// Copyright 2017-2020 @polkadot/api authors & contributors
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const createClass_1 = __importDefault(require("./createClass"));
let Submittable;
function createSubmittable(apiType, api, decorateMethod) {
    return (extrinsic) => {
        // This is not great, but basically what we do here is to only require the
        // class right at the point it is actually needed - delaying initialization
        if (!Submittable) {
            Submittable = createClass_1.default({ api, apiType, decorateMethod });
        }
        return new Submittable(api.registry, extrinsic);
    };
}
exports.default = createSubmittable;
