"use strict";
exports.__esModule = true;
var addon = require('../native');
var EmeraldVaultNative = /** @class */ (function () {
    function EmeraldVaultNative(conf) {
        this.conf = conf || {};
    }
    EmeraldVaultNative.prototype.vaultVersion = function () {
        return "0.26.0";
    };
    EmeraldVaultNative.prototype.listAccounts = function (chain) {
        var opts = Object.assign({}, this.conf, { chain: chain });
        return addon.listAccounts(opts);
    };
    EmeraldVaultNative.prototype.importAccount = function (chain, data) {
        var opts = Object.assign({}, this.conf, { chain: chain });
        return addon.importAccount(opts, JSON.stringify(data)).address;
    };
    EmeraldVaultNative.prototype.importPk = function (chain, data) {
        var opts = Object.assign({}, this.conf, { chain: chain });
        return addon.importPk(opts, JSON.stringify(data)).address;
    };
    EmeraldVaultNative.prototype.exportPk = function (chain, address, password) {
        var opts = Object.assign({}, this.conf, { chain: chain });
        return addon.exportPk(opts, address, password);
    };
    EmeraldVaultNative.prototype.exportAccount = function (chain, address) {
        var opts = Object.assign({}, this.conf, { chain: chain });
        return JSON.parse(addon.exportAccount(opts, address));
    };
    EmeraldVaultNative.prototype.updateAccount = function (chain, address, update) {
        var opts = Object.assign({}, this.conf, { chain: chain });
        return addon.updateAccount(opts, address, JSON.stringify(update));
    };
    EmeraldVaultNative.prototype.removeAccount = function (chain, address) {
        var opts = Object.assign({}, this.conf, { chain: chain });
        return addon.removeAccount(opts, address);
    };
    EmeraldVaultNative.prototype.signTx = function (chain, tx, password) {
        var opts = Object.assign({}, this.conf, { chain: chain });
        return addon.signTx(opts, JSON.stringify(tx), password);
    };
    EmeraldVaultNative.prototype.importMnemonic = function (chain, mnemonic) {
        var opts = Object.assign({}, this.conf, { chain: chain });
        return addon.importMnemonic(opts, JSON.stringify(mnemonic)).address;
    };
    EmeraldVaultNative.prototype.generateMnemonic = function (size) {
        return addon.generateMnemonic(size);
    };
    EmeraldVaultNative.prototype.listAddressBook = function (chain) {
        var opts = Object.assign({}, this.conf, { chain: chain });
        return addon.listAddressBook(opts);
    };
    EmeraldVaultNative.prototype.addToAddressBook = function (chain, item) {
        var opts = Object.assign({}, this.conf, { chain: chain });
        return addon.addToAddressBook(opts, JSON.stringify(item));
    };
    EmeraldVaultNative.prototype.removeFromAddressBook = function (chain, address) {
        var opts = Object.assign({}, this.conf, { chain: chain });
        return addon.removeFromAddressBook(opts, address);
    };
    return EmeraldVaultNative;
}());
exports.EmeraldVaultNative = EmeraldVaultNative;
