<commit_before>
var assert = require('assert')
var Spender = require('@tradle/spender')
var bitcoin = require('@tradle/bitcoinjs-lib')
var equal = require('deep-equal')
var typeforce = require('typeforce')
var noop = function() {}

module.exports = Wallet
module.exports.transactor = require('./transactor')

/**
 * primitive one key common blockchain wallet
 * @param  {Object} options
 * @param  {String|ECKey} options.priv
 * @param  {CommonBlockchain impl} options.blockchain common-blockchain api
 */
function Wallet (options) {
  this.priv = typeof options.priv === 'string' ?
    bitcoin.ECKey.fromWIF(options.priv) :
    options.priv

  typeforce('Object', this.priv)
  typeforce({
    blockchain: 'Object',
    networkName: 'String'
  }, options)

  assert(options.networkName in bitcoin.networks, 'unknown network: ' + options.networkName)

  this.txs = []
  this.pub = this.priv.pub
  this.networkName = options.networkName
  this.address = this.pub.getAddress(bitcoin.networks[this.networkName])
  this.addressString = this.address.toString()
  this.blockchain = options.blockchain
}

/**
 * @return {Spender} https://github.com/mvayngrib/spender
 */
Wallet.prototype.send =
Wallet.prototype.transact = function () {
  return new Spender(this.networkName)
    .from(this.priv)<commit_msg>fix: typeforce calls to not rely on Function.prototype.name<commit_after>
var assert = require('assert')
var Spender = require('@tradle/spender')
var bitcoin = require('@tradle/bitcoinjs-lib')
var equal = require('deep-equal')
var typeforce = require('typeforce')
var noop = function() {}

module.exports = Wallet
module.exports.transactor = require('./transactor')

/**
 * primitive one key common blockchain wallet
 * @param  {Object} options
 * @param  {String|ECKey} options.priv
 * @param  {CommonBlockchain impl} options.blockchain common-blockchain api
 */
function Wallet (options) {
  this.priv = typeof options.priv === 'string' ?
    bitcoin.ECKey.fromWIF(options.priv) :
    options.priv

  typeforce(typeforce.Object, this.priv)
  typeforce({
    blockchain: typeforce.Object,
    networkName: typeforce.String
  }, options)

  assert(options.networkName in bitcoin.networks, 'unknown network: ' + options.networkName)

  this.txs = []
  this.pub = this.priv.pub
  this.networkName = options.networkName
  this.address = this.pub.getAddress(bitcoin.networks[this.networkName])
  this.addressString = this.address.toString()
  this.blockchain = options.blockchain
}

/**
 * @return {Spender} https://github.com/mvayngrib/spender
 */
Wallet.prototype.send =
Wallet.prototype.transact = function () {
  return new Spender(this.networkName)
    .from(this.priv)
{'fraction_non_alphanumeric': 0.1355805243445693, 'fraction_numerical': 0.0, 'mean_word_length': 4.507216494845361, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '150480', 'n_tokens_mistral': 844, 'n_tokens_neox': 832, 'n_words': 176}