"use strict";
exports.__esModule = true;
var addon = require('../native');
function isReference(seed) {
    return seed.id !== undefined;
}
var Seed = /** @class */ (function () {
    function Seed() {
    }
    Seed.prototype.list = function () {
        return Promise.reject("NOT IMPLEMENTED");
    };
    Seed.prototype["import"] = function (seed) {
        return Promise.reject("NOT IMPLEMENTED");
    };
    Seed.prototype.isAvailable = function (seed) {
        if (isReference(seed)) {
            return addon.ledger_isConnected(seed);
        }
        else {
            if (seed.type === "raw") {
                return seed.raw && seed.raw.value && seed.raw.value.length > 0;
            }
            if (seed.type === "mnemonic") {
                return seed.mnemonic && seed.mnemonic.value && seed.mnemonic.value.length > 0;
            }
            if (seed.type === "ledger") {
                return addon.ledger_isConnected(seed);
            }
        }
        return false;
    };
    Seed.prototype.listAddresses = function (seed, blockchain, hdpath) {
        return addon.ledger_listAddresses(seed, blockchain, hdpath);
    };
    return Seed;
}());
exports.Seed = Seed;
