"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const webBase = require("@gny/web-base");
const transaction = require("./transaction");
function transfer(recipientId, amount, message, secret, secondSecret) {
    return transaction.createTransactionEx({
        type: 0,
        fee: String(0.1 * 1e8),
        args: [amount, recipientId],
        secret,
        secondSecret: secondSecret,
        message,
    });
}
exports.transfer = transfer;
function setUserName(username, secret, secondSecret) {
    return transaction.createTransactionEx({
        type: 1,
        fee: String(5 * 1e8),
        secret: secret,
        secondSecret: secondSecret,
        args: [username],
    });
}
exports.setUserName = setUserName;
function newSignature(secondSecret) {
    const keys = webBase.getKeys(secondSecret);
    const signature = {
        publicKey: keys.publicKey,
    };
    return signature;
}
function setSecondPassphrase(secret, secondSecret) {
    const secondSignature = newSignature(secondSecret);
    return transaction.createTransactionEx({
        type: 2,
        fee: String(5 * 1e8),
        args: [secondSignature.publicKey],
        secret: secret,
    });
}
exports.setSecondPassphrase = setSecondPassphrase;
function lock(height, amount, secret, secondSecret) {
    return transaction.createTransactionEx({
        type: 3,
        fee: String(0.1 * 1e8),
        args: [height, amount],
        secret: secret,
        secondSecret: secondSecret,
    });
}
exports.lock = lock;
function unlock(secret, secondSecret) {
    return transaction.createTransactionEx({
        type: 6,
        fee: String(0),
        args: [],
        secret: secret,
        secondSecret: secondSecret,
    });
}
exports.unlock = unlock;
function vote(keyList, secret, secondSecret) {
    return transaction.createTransactionEx({
        type: 4,
        fee: String(0.1 * 1e8),
        args: [keyList.join(',')],
        secret: secret,
        secondSecret: secondSecret,
    });
}
exports.vote = vote;
function unvote(keyList, secret, secondSecret) {
    return transaction.createTransactionEx({
        type: 5,
        fee: String(0.1 * 1e8),
        args: [keyList.join(',')],
        secret: secret,
        secondSecret: secondSecret,
    });
}
exports.unvote = unvote;
function registerDelegate(secret, secondSecret) {
    return transaction.createTransactionEx({
        type: 10,
        fee: String(100 * 1e8),
        args: [],
        secret: secret,
        secondSecret: secondSecret,
    });
}
exports.registerDelegate = registerDelegate;
//# sourceMappingURL=basic.js.map