"use strict";
// Copyright 2017-2020 @polkadot/types authors & contributors
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
Object.defineProperty(exports, "__esModule", { value: true });
const util_crypto_1 = require("@polkadot/util-crypto");
// a helper function for both types of payloads, Raw and metadata-known
function sign(signerPair, u8a, options) {
    const encoded = u8a.length > 256
        ? util_crypto_1.blake2AsU8a(u8a)
        : u8a;
    return signerPair.sign(encoded, options);
}
exports.sign = sign;
