@newos/cli
Version:
Command-line interface for the NewOS
18 lines • 828 B
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const TransactionController_1 = __importDefault(require("../models/network/TransactionController"));
async function transfer({ to, value, unit = 'ether', from, txParams = {}, }) {
if (!to)
throw Error('A recipient address must be specified');
if (!value)
throw Error('An amount to be transferred must be specified');
if (from)
txParams = Object.assign(Object.assign({}, txParams), { from });
const controller = new TransactionController_1.default(txParams);
await controller.transfer(to, value, unit);
}
exports.default = transfer;
//# sourceMappingURL=transfer.js.map