"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.sr25519PairFromSeed = sr25519PairFromSeed;
const tslib_1 = require("tslib");
const sr25519 = tslib_1.__importStar(require("@pezkuwi/scure-sr25519"));
const util_1 = require("@pezkuwi/util");
/**
 * @name sr25519PairFromSeed
 * @description Returns a object containing a `publicKey` & `secretKey` generated from the supplied seed.
 */
function sr25519PairFromSeed(seed) {
    const seedU8a = (0, util_1.u8aToU8a)(seed);
    if (seedU8a.length !== 32) {
        throw new Error(`Expected a seed matching 32 bytes, found ${seedU8a.length}`);
    }
    const sec = sr25519.secretFromSeed(seedU8a);
    const pub = sr25519.getPublicKey(sec);
    return {
        publicKey: pub,
        secretKey: sec
    };
}
