Wei Lu
d265b53b03
wallet: processTx -> processConfirmedTx, processPendingTx
2014-06-12 16:47:46 +08:00
Wei Lu
e064e9d29d
wallet.createTx ignores pending utxo
2014-06-12 13:11:28 +08:00
Wei Lu
660c95483d
wallet.processTx accepts isPending flag and passes it on to output
2014-06-12 12:56:50 +08:00
Daniel Cousens
f5005299d1
JSHint: remove defined but never used
2014-06-04 15:46:24 +10:00
Daniel Cousens
6a73bc02f5
HDNode: rename priv/pub to privKey/pubKey
2014-06-03 19:54:58 +10:00
Daniel Cousens
64e307b13f
HDWallet: rename to HDNode
2014-06-03 17:08:42 +10:00
Daniel Cousens
dca284a131
HDWallet: rename derivePrivate to deriveHardened
2014-06-03 17:04:05 +10:00
Daniel Cousens
c0006c299f
HDWallet: use new constructor
2014-05-31 20:40:57 +10:00
Daniel Cousens
3bce535e36
Wallet: use assert for consistency
2014-05-31 14:28:16 +10:00
Daniel Cousens
cde285ccfc
Wallet: enforce operator new
2014-05-30 19:01:03 +10:00
Daniel Cousens
4952c5f4e7
HD/Wallet: use network objects, not strings
2014-05-30 19:01:02 +10:00
Daniel Cousens
2df790e2ab
Wallet: remove use of hashLittleEndian
2014-05-30 18:17:32 +10:00
Daniel Cousens
4afdbc9f68
Wallet: use dustThreshold directly
...
The definition of a dust amount is pretty clear, and I feel it is less
readable when represented as isDust(amount) or !isDust(amount), by
comparison to amount <= dustThreshold or amount > dustThreshold.
Also means I don't have to stray my eyes to understand the
implemention by looking up isDust does.
2014-05-30 18:17:32 +10:00
Daniel Cousens
bd3690bdc0
Wallet: remove async interface
2014-05-30 18:17:32 +10:00
Daniel Cousens
50e9a09a8c
Wallet: cleanup createTx control flow
...
Unknowingly this also revealed a subtle bug in the previous
implementation which allowed the creation of transactions even
when no UTXOs existed.
2014-05-30 18:17:18 +10:00
Daniel Cousens
8514bbfabd
Address: remove Address.Error
...
By removing Address.Error, we remove a code smell.
This part of the code base was also not under any form of test.
Test data and tests have therefore been added verifying its behaviour in
both Wallet and Address tests.
2014-05-28 13:17:07 +10:00
Daniel Cousens
25514d6ac1
HDWallet: remove HmacBytesToBytes
2014-05-10 09:57:16 +10:00
Daniel Cousens
708aa03390
Transaction/Script: bitcoin network no longer implied
...
A Transaction (and its subsequent scripts) do not carry any network
specific information in the Bitcoin protocol.
Therefore they can not (without further context) produce the network
specific constants for the generation of the base58 Addresses.
As TransactionOut.address is used heavily throughout Wallet and other
areas of the library, this could not be entirely removed without a large
number of changes.
For now, TransactionOut.address is only defined in the case of
Tx.addOutput being used directly:
Transaction.addOutput(address, value)
2014-05-08 10:59:58 +10:00
Daniel Cousens
57b8afbdab
Network: rename Network to Networks
...
This change removes the most common ambiguities.
As the network module is not representative of a class, the lower case
has been used.
2014-05-08 10:59:58 +10:00
Daniel Cousens
d65a3c36e2
Merge pull request #159 from williamcotton/master
...
fixed issues with testnet and createTx
2014-05-06 08:04:02 +10:00
Daniel Cousens
a8cf2fdd9e
Changes internal serialization to use Buffers instead
2014-05-04 17:31:22 +10:00
William Cotton
590bb8e1c3
custom changeAddress for wallet.createTx()
2014-04-25 12:49:51 -07:00
William Cotton
a9bc42019a
fixed issues with testnet and createTx
2014-04-25 12:39:30 -07:00
Daniel Cousens
f047afef2d
Updates network.js constant names
2014-04-17 05:50:59 +10:00
lms
b79ccb2c0c
100% coverage of wallet.js
2014-04-01 21:05:46 +02:00
Wei Lu
93fe1b4c78
cosmetic standardization
...
[closes #56 ]
2014-03-31 11:47:47 +08:00
Wei Lu
a1c80b8f51
minor cleanup of wallet.sign
2014-03-28 11:32:15 +08:00
Wei Lu
39c181dce6
allow fee to be set to zero
2014-03-26 20:20:58 +08:00
Wei Lu
4d4388f6bf
make wallet async functions truly async
2014-03-26 20:05:13 +08:00
Wei Lu
68b08b638a
add async version of createTx
2014-03-26 08:43:33 +08:00
Wei Lu
f7d4895b74
add async version of setUnspentOutputs
2014-03-26 08:43:33 +08:00
Wei Lu
83db6483fa
remove unnecessary imports from wallet
2014-03-26 08:43:33 +08:00
Wei Lu
7bfa6ab9d2
remove scriptPubKey from wallet.outputs, set/get unspent outputs as it is unused
2014-03-26 08:43:33 +08:00
Wei Lu
58ab0b631e
getBalance returns total unspent
2014-03-26 08:43:33 +08:00
Wei Lu
9fc5505730
getUnspentOutputs excludes spent outputs
2014-03-26 08:43:33 +08:00
Wei Lu
77b5d1ee21
getCandidateOuputs ignores spent outputs
2014-03-26 08:43:33 +08:00
Wei Lu
2501868f52
remove old methods
2014-03-26 08:43:32 +08:00
Wei Lu
471bc7ed97
skip change if it is not above dust threshold
2014-03-26 08:43:32 +08:00
Wei Lu
90921798cf
throws error on insufficient fund
2014-03-26 08:43:32 +08:00
Wei Lu
7c81bfef72
check for dust before creating transaction
2014-03-26 08:43:32 +08:00
Wei Lu
913b48e87f
sign tx
2014-03-26 08:43:32 +08:00
Wei Lu
8f0413da98
always assume change output exists when estimating fee
2014-03-26 08:43:32 +08:00
Wei Lu
2dc0f69d00
createTX returns tx with expected inputs and outputs
2014-03-26 08:43:32 +08:00
Wei Lu
3d12d3b038
implement and use txOut.scriptPubKey
2014-03-26 08:43:32 +08:00
Wei Lu
5d79b094d4
remove processOutput and processExistingOutput
...
instead of processOutput, use processTx instead
processExistingOutput is time based which is not reliable
2014-03-26 08:43:32 +08:00
Wei Lu
e574693594
wallet.outputs[0].output -> wallet.outputs[0].receive
...
output is overloaded. Considering we have output.spend, output.receive makes sense to me
2014-03-26 08:43:31 +08:00
Wei Lu
dbb5681366
add tests and refactor wallet.processTx
2014-03-26 08:43:31 +08:00
Wei Lu
c39aa6cb07
minor refactoring
2014-03-26 08:42:35 +08:00
Wei Lu
01dc34d720
throw error when unspent output does not have required keys
2014-03-26 08:42:35 +08:00
Wei Lu
26afbccc98
wallet allows setting unspent outputs
2014-03-26 08:42:35 +08:00