<commit_before>'use strict';

var _ = require('lodash');
//var Ripple = require('ripple-lib');
var RippleWallet = require('ripple-wallet');

// Get list of ServerWalletServices
exports.index = function(req, res) {
    return res.json(200, {
        status: 'success'
      });
};

exports.new = function(req, res) {
  wallet = RippleWallet.generate();
  return res.json(200, {
    status: 'success',
    address: wallet.address,
    secret:  wallet.secret
  })
};

// Get a single ServerWalletService
exports.show = function(req, res) {
  /*ServerWalletService.findById(req.params.id, function (err, ServerWalletService) {
    if(err) { return handleError(res, err); }
    if(!ServerWalletService) { return res.send(404); }
    return res.json(ServerWalletService);
  });*/
};

// Creates a new ServerWalletService in the DB.
exports.create = function(req, res) {
  /*ServerWalletService.create(req.body, function(err, ServerWalletService) {
    if(err) { return handleError(res, err); }
    return res.json(201, ServerWalletService);
  });*/
};

// Updates an existing ServerWalletService in the DB.
exports.update = function(req, res) {
  /*if(req.body._id) { delete req.body._id; }
  ServerWalletService.findById(req.params.id, function (err, ServerWalletService) {
    if (err) { return handleError(res, err); }
    if(!ServerWalletService) { return res.send(404); }<commit_msg>Implemented new wallet func. Naive version.<commit_after>'use strict';

var _ = require('lodash');
//var Ripple = require('ripple-lib');
var WalletGenerator = require('ripple-wallet').Generator;

// Get list of ServerWalletServices
exports.index = function(req, res) {
    return res.json(200, {
        status: 'success'
      });
};

exports.new = function(req, res) {
  var walletGenerator = new WalletGenerator();
  var wallet = walletGenerator.generate();

  return res.json(200, {
    status: 'success',
    address: wallet.address,
    secret:  wallet.secret
  })
};

// Get a single ServerWalletService
exports.show = function(req, res) {
  /*ServerWalletService.findById(req.params.id, function (err, ServerWalletService) {
    if(err) { return handleError(res, err); }
    if(!ServerWalletService) { return res.send(404); }
    return res.json(ServerWalletService);
  });*/
};

// Creates a new ServerWalletService in the DB.
exports.create = function(req, res) {
  /*ServerWalletService.create(req.body, function(err, ServerWalletService) {
    if(err) { return handleError(res, err); }
    return res.json(201, ServerWalletService);
  });*/
};

// Updates an existing ServerWalletService in the DB.
exports.update = function(req, res) {
  /*if(req.body._id) { delete req.body._id; }
  ServerWalletService.findById(req.params.id, function (err, ServerWalletService) {
    if (err) { return handleError(res, err); }
    if(!ServerWalletService) { return res.send(404); }
{'fraction_non_alphanumeric': 0.14779874213836477, 'fraction_numerical': 0.010482180293501049, 'mean_word_length': 4.130824372759856, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7487134', 'n_tokens_mistral': 917, 'n_tokens_neox': 920, 'n_words': 208}