"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
Object.defineProperty(exports, "__esModule", { value: true });
const base_1 = require("../api/base");
const __1 = require("../");
class Basic {
    constructor(connection) {
        this.base = new base_1.Base(connection);
    }
    setUserName(username, secret, secondSecret) {
        return __awaiter(this, void 0, void 0, function* () {
            const trs = __1.basic.setUserName(username, secret, secondSecret);
            const params = {
                transaction: trs,
            };
            const res = yield this.base.post('/peer/transactions', params);
            const result = res.data;
            return result;
        });
    }
    lockAccount(height, amount, secret, secondSecret) {
        return __awaiter(this, void 0, void 0, function* () {
            const trs = __1.basic.lock(height, amount, secret, secondSecret);
            const params = {
                transaction: trs,
            };
            const res = yield this.base.post('/peer/transactions', params);
            const result = res.data;
            return result;
        });
    }
    unlockAccount(secret, secondSecret) {
        return __awaiter(this, void 0, void 0, function* () {
            const trs = __1.basic.unlock(secret, secondSecret);
            const params = {
                transaction: trs,
            };
            const res = yield this.base.post('/peer/transactions', params);
            const result = res.data;
            return result;
        });
    }
    registerDelegate(secret, secondSecret) {
        return __awaiter(this, void 0, void 0, function* () {
            const trs = __1.basic.registerDelegate(secret, secondSecret);
            const params = {
                transaction: trs,
            };
            const res = yield this.base.post('/peer/transactions', params);
            const result = res.data;
            return result;
        });
    }
    send(recipient, amount, secret, message, secondeSecret) {
        return __awaiter(this, void 0, void 0, function* () {
            const trs = __1.basic.transfer(recipient, amount, message, secret, secondeSecret);
            const params = {
                transaction: trs,
            };
            const res = yield this.base.post('/peer/transactions', params);
            const result = res.data;
            return result;
        });
    }
    vote(keyList, secret, secondSecret) {
        return __awaiter(this, void 0, void 0, function* () {
            const trs = __1.basic.vote(keyList, secret, secondSecret);
            const params = {
                transaction: trs,
            };
            const res = yield this.base.post('/peer/transactions', params);
            const result = res.data;
            return result;
        });
    }
    unvote(keyList, secret, secondSecret) {
        return __awaiter(this, void 0, void 0, function* () {
            const trs = __1.basic.unvote(keyList, secret, secondSecret);
            const params = {
                transaction: trs,
            };
            const res = yield this.base.post('/peer/transactions', params);
            const result = res.data;
            return result;
        });
    }
    setSecondPassphrase(secret, secondSecret) {
        return __awaiter(this, void 0, void 0, function* () {
            const trs = __1.basic.setSecondPassphrase(secret, secondSecret);
            const params = {
                transaction: trs,
            };
            const res = yield this.base.post('/peer/transactions', params);
            const result = res.data;
            return result;
        });
    }
}
exports.Basic = Basic;
//# sourceMappingURL=basic.js.map