Add JRuby port

This is actually pending getting documentation for how to get the raw transaction hex from Chain.com.
Probably. This class is currently broken for multi-input transactions for other reasons. Will revisit that

Sent from my iPhone

> On Nov 16, 2014, at 10:31 AM, Gustav Simonsson <notifications@github.com> wrote:
> 
> In lib/chain/transactionj.rb:
> 
> > +    def change
> > +      unspents_amount - outputs_amount - fee
> > +    end
> > +
> > +    # Uses the address specified in the initializer. Otherwise
> > +    # falls back on the first address in the list of @inputs.
> > +    def change_address
> > +      @change_address || @inputs.keys.first
> > +    end
> > +
> > +    # Consumes the unspents of the addresses in the @inputs
> > +    # Creates outputs specifed by @outputs
> > +    # Adds an additional output to the change_address if change is greater than 0.
> > +    def build
> > +
> > +      raise(InsufficientFundsError) if outputs_amount > unspents_amount
> Would it make sense to:
> 
> if (outputs_amount + fee) > unspents_amount
> To ensure input funds cover the fee? Or is that already calculated before this step?
> 
> —
> Reply to this email directly or view it on GitHub.
>