Skip to content
This repository has been archived by the owner on Mar 7, 2023. It is now read-only.

Bch stats #530

Open
wants to merge 420 commits into
base: async-secpass
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
420 commits
Select commit Hold shift + click to select a range
5bbfa4f
fix(Shift): support resolved trades
Thore3 Aug 8, 2017
d9e52ad
fix(Shift): checkForCompletedTrades default options arg
Thore3 Aug 8, 2017
52bd205
fix(Shift): fix sync error, disappearing fields, shift trace log
Thore3 Aug 8, 2017
8c37e74
fix(Shift): only log dev to console if in dev mode
Thore3 Aug 8, 2017
453df6c
feat(ShapeShift): return error
Aug 10, 2017
39b22c1
test(Shift): test ShapeShift Quote
Thore3 Aug 9, 2017
3fab21e
feat(Eth): add hasSeen property to eth
Thore3 Aug 10, 2017
ac98687
feat(Eth): method for fetching eth fees
Thore3 Aug 10, 2017
a32ceaf
test(Shift): test shift-payment
Thore3 Aug 11, 2017
dde91b0
test(Eth): fix failing test with has_seen
Thore3 Aug 11, 2017
a70d974
feat(Shift): allow passing fee when building payment
Thore3 Aug 11, 2017
4744170
chore(Dev): default node_env to prod in webpack config
Thore3 Aug 14, 2017
d289b42
feat(Eth): support checksum ether addresses
Thore3 Aug 14, 2017
2d61ff2
fix(Eth): move checksum check into isEtherAddress
Thore3 Aug 14, 2017
0a6e4c1
feat(Shift): save hashOut to metadata
Thore3 Aug 14, 2017
15156e7
chore(Dev): do not expose eth / shapeshift globally
Thore3 Aug 14, 2017
edfc7c6
fix(Eth): resend socket subs after eth socket close
Thore3 Aug 14, 2017
7ab0da0
feat(Shift): use shapeshift api key
Thore3 Aug 14, 2017
8ec9e97
fix(Eth): tx accounts for checksum format
Thore3 Aug 14, 2017
e29c700
fix(Wallet): cache metadata key after upgrade
Thore3 Aug 16, 2017
a18bf79
Merge branch 'master' into v3.34-release
Thore3 Aug 16, 2017
8e220a1
chore(Release): v3.34.0
Thore3 Aug 16, 2017
84b3579
test(Conf): increase browser timeout time
Thore3 Aug 16, 2017
f7e9133
chore(Release): v3.34.1
Thore3 Aug 16, 2017
fef0110
fix(Api): correct event urls
Thore3 Aug 16, 2017
a772e65
chore(Release): v3.34.2
Thore3 Aug 16, 2017
25f732a
fix(Api): change event urls to make single request
Thore3 Aug 16, 2017
4f1629e
chore(Release): v3.34.3
Thore3 Aug 16, 2017
2bd216f
Revert "fix(Api): change event urls to make single request"
Thore3 Aug 16, 2017
b76adc0
fix(Api): better names for metrics
Thore3 Aug 16, 2017
9a38a37
chore(Release): v3.34.4
Thore3 Aug 16, 2017
a5eeac8
feat(ShapeShift): store usa state
Aug 21, 2017
7723781
fix(ShapeShift): allow withdrawal amts
Aug 21, 2017
05a85ac
Merge pull request #422 from blockchain/allow-withdrawal-amts
plondon Aug 21, 2017
0b94bcd
chore(Release): bump version
Aug 21, 2017
1aa2736
feat(ShapeShift): add state guess to account info
Aug 22, 2017
f1d6260
Merge pull request #423 from blockchain/state-guess
plondon Aug 22, 2017
a4aaa1f
Merge pull request #421 from blockchain/usa-state
plondon Aug 22, 2017
2ade4f0
feat(Ether): record last tx to metadata
Aug 22, 2017
22cfd29
chore(Release): bump version
Aug 23, 2017
66d95fd
Merge tag 'v3.34.6' into v3.34-release
Aug 23, 2017
fd9b38b
test(Eth): eth wallet last_tx
Aug 23, 2017
32fa85a
chore(Release): bump version
Aug 23, 2017
037d807
feat(Coinify): adds buy data agg calls to API
Aug 25, 2017
4dfe444
Merge pull request #418 from blockchain/v3.34-release
jtormey Aug 29, 2017
f8f4cdf
feat(Eth): basic transition from legacy account to bip44 derived account
Thore3 Aug 28, 2017
c5d6a8f
feat(Helpers): have asyncOnce return a promise
Thore3 Aug 28, 2017
6c825bc
feat(Eth): debounce sync by 250ms
Thore3 Aug 28, 2017
04efc2e
feat(Eth): legacy transition
Thore3 Aug 28, 2017
2e8ae31
feat(Eth): fetch history for legacy account as well
Thore3 Aug 29, 2017
c55dac4
test(Eth): support correct flag in tests
Thore3 Aug 29, 2017
4cdf568
feat(Eth): batch fetch eth account data
Thore3 Aug 29, 2017
7a68d20
fix(Eth): do not allow transition if already done
Thore3 Aug 29, 2017
f7ec1f1
fix(Eth): handle differences in balance and txs responses
Thore3 Aug 29, 2017
42654dd
feat(Eth): auto transition without sec pass
Thore3 Aug 29, 2017
4ad8297
test(Eth): fix create account tests
Thore3 Aug 29, 2017
2933a59
fix(Eth): correctly return create account promise
Thore3 Aug 29, 2017
e37373f
fix(Eth): use correct account message property
Thore3 Aug 29, 2017
1dcfc61
fix(Eth): return fee from maxAvailable and use default gas price in p…
Aug 30, 2017
1fe150a
Merge pull request #432 from blockchain/return-fee
jtormey Aug 30, 2017
a50bc26
fix(Eth): update for keyed api response format
Thore3 Aug 30, 2017
ba54229
feat(Eth): function to transition back to legacy eth
Thore3 Aug 30, 2017
f75b4e5
fix(Eth): give default account priority, instead of returning sum of …
Thore3 Aug 30, 2017
483e359
Merge pull request #431 from blockchain/beta-upgrade
jtormey Aug 30, 2017
165c619
chore(Release): v3.35.0
Thore3 Aug 30, 2017
151c302
refactor(Socket): share code between blockchain and eth sockets
Thore3 Aug 17, 2017
3310765
refactor(Socket): make base socket instance of EventListener
Thore3 Aug 17, 2017
3ad5f1c
refactor(Socket): remove proxyquire in blockchain-socket spec
Thore3 Aug 17, 2017
f330fe7
refactor(Socket): move pong handler into stable-socket
Thore3 Aug 17, 2017
4effd75
refactor(Socket): use static methods, do not call .send externally
Thore3 Aug 17, 2017
bf9a2b0
test(Socket): test spec for StableSocket
Thore3 Aug 18, 2017
775c3e8
test(Socket): move ws mock into common mock file
Thore3 Aug 18, 2017
c96ddc8
refactor(Socket): make sure socket lifecycle checks return a boolean
Thore3 Aug 18, 2017
4183c9b
fix(Socket): only send messages on initial open
Thore3 Aug 18, 2017
91f26b3
refactor(Socket): add handlers before socket connect
Thore3 Aug 30, 2017
606db65
refactor(Eth): remove unnecessary check that latest block is the most…
Thore3 Aug 30, 2017
c2dc37a
fix(Eth): do not fetch balance or history when there are no accounts
Thore3 Aug 30, 2017
8203811
feat(Eth): add toJSON method for eth wallet tx
Thore3 Aug 30, 2017
4e3ca61
fix(Eth): connect to socket after transition
Thore3 Aug 31, 2017
8aa4df0
fix(Eth): reset legacy account balance after sweep
Thore3 Aug 31, 2017
24890d2
Revert "fix(Eth): give default account priority, instead of returning…
Thore3 Aug 31, 2017
e592d36
fix(Eth): check ws address case insensitive
Thore3 Aug 31, 2017
5ea43ae
fix(Eth): use tx from ws message
Thore3 Aug 31, 2017
b0cca2c
test(Eth): fix tests
Thore3 Aug 31, 2017
c982cea
chore(Release): v3.35.1
Thore3 Aug 31, 2017
b8db591
fix(Eth): higher precision arithmetic for sweep amounts
Thore3 Aug 31, 2017
b587605
chore(Release): v3.35.2
Thore3 Sep 1, 2017
ee7e547
fix(Eth): update new transactions when they arrive from the socket
Thore3 Sep 1, 2017
6cb04ea
fix(Eth): do not compute fractional wei values
Thore3 Sep 1, 2017
317bb53
chore(Release): v3.35.3
Thore3 Sep 1, 2017
4a3816c
fix(Eth): update txs immediately after setting
Thore3 Sep 1, 2017
7637e0f
chore(Release): v3.35.4
Thore3 Sep 1, 2017
e7cbc67
chore(Release): temporarily disable tests for ci
Thore3 Sep 1, 2017
54ea641
chore(Release): v3.35.5
Thore3 Sep 1, 2017
b91ca32
chore(Release): upgrade client
Sep 6, 2017
8a33c43
chore(Release): v3.35.6
Sep 6, 2017
c969da6
Merge pull request #428 from blockchain/buy-limits
plondon Sep 6, 2017
acbe9f7
chore(Release): v3.36.0
Sep 6, 2017
1f8ebf9
chore(Release): v3.36.1
Sep 6, 2017
989342e
Merge pull request #433 from blockchain/v3.35-release
plondon Sep 6, 2017
6bb68ab
Merge branch 'master' into v3.36-release
Sep 6, 2017
1006454
chore(Release): v3.36.2
Sep 6, 2017
628d53f
feat(API): add method for price chart
Sep 6, 2017
9e66b86
feat(API): change endpoint name and params
Sep 8, 2017
21d8a52
Merge branch 'v3.36-release' into chart
prwelber Sep 12, 2017
0adb74b
Merge pull request #438 from blockchain/chart
jtormey Sep 12, 2017
da9203a
Merge branch 'v3.36-release' into improve-socket
Thore3 Sep 12, 2017
d7ce910
refactor(Socket): allow passing custom socket class to sockets
Thore3 Sep 12, 2017
1d5da2b
Merge pull request #420 from blockchain/improve-socket
jtormey Sep 12, 2017
9850d7f
refactor(Test): standardize test extensions
Thore3 Aug 18, 2017
6c3d411
refactor(Test): move mocks into __mocks__ directory
Thore3 Aug 18, 2017
be7c271
refactor(Test): remove unused spender mock
Thore3 Aug 18, 2017
c81dd04
refactor(Test): move data into __data__ dir
Thore3 Aug 18, 2017
c2543bf
refactor(Test): _prepare -> __prepare
Thore3 Aug 18, 2017
e3a8fc5
refactor(Test): change tests to kebab-case to match src
Thore3 Aug 18, 2017
6c460f7
refactor(Test): rename spec files to match src counterparts
Thore3 Aug 18, 2017
3046351
chore(Test): add option to run in headless chrome, faster than phantomjs
Thore3 Aug 18, 2017
edbb9e0
Merge pull request #439 from blockchain/refactor-tests
Pernas Sep 12, 2017
6845960
chore(Release): bump version
Sep 13, 2017
3d65e32
feat(Shift): add stat method
Thore3 Sep 13, 2017
bc13b55
chore(Release): bump version
Sep 14, 2017
1b0d32e
feat(API): change endpoint name
Sep 15, 2017
f88f009
Merge pull request #441 from blockchain/chart-endpoint-change
plondon Sep 15, 2017
e82339c
chore(Release): bump version
Sep 15, 2017
5fb6d46
Merge pull request #437 from blockchain/v3.36-release
jtormey Sep 18, 2017
b97bb15
added bitcoinjs for bcash dependency
sha49 Sep 21, 2017
be694c3
added coin selection and signing for bcash
sha49 Sep 21, 2017
f12b567
refactor(Cash): clean up bitcoin-cash modules
Thore3 Sep 21, 2017
e2b13d9
test(Cash): add coin selection tests
Thore3 Sep 21, 2017
77be9ee
refactor(Cash): rename select -> coin-selection
Thore3 Sep 21, 2017
f8f1ff6
refactor(Cash): rename bitcoin-cash -> bcash
Thore3 Sep 21, 2017
4b8b3c2
chore(Release): bump version
Sep 22, 2017
96c00fe
chore(Release): upgrade exchange, coinify
Sep 22, 2017
3cccaad
3.37.1
Sep 22, 2017
67e1900
chore(Release): v3.37.2
Sep 22, 2017
3d2230b
get unspents for bcash
sha49 Sep 22, 2017
c1595a7
chore(Cash): fix linter errors in api
Thore3 Sep 22, 2017
6d2cb8a
chore(Cash): fix selection type annotations
Thore3 Sep 22, 2017
f97a372
feat(Cash): add bch wallet and bch payment
Thore3 Sep 22, 2017
144c99f
bcash signer
sha49 Sep 25, 2017
665d34a
fix(Cash): fix style errors and signing
Thore3 Sep 25, 2017
0bbe949
feat(Cash): add bch payment to shapeshift
Thore3 Sep 25, 2017
10b57e7
feat(Cash): save balances on cash wallet
Thore3 Sep 27, 2017
42d6efe
feat(Cash): use multiaddr to get bch tx history
Thore3 Sep 27, 2017
5d58e19
feat(Shift): allow building a shapeshift payment from any account
Thore3 Sep 27, 2017
1213fbe
chore(Release): upgrade client
Sep 27, 2017
6fd615a
chore(Release): v3.37.3
Sep 27, 2017
f208d42
bcash signer testing
sha49 Sep 28, 2017
b5028e0
bcash sign and pushtx
sha49 Sep 28, 2017
cf74451
bcash contruct tx and publish working
sha49 Sep 29, 2017
9b607cd
multiaddr bcash
sha49 Sep 29, 2017
92c67c8
feat(Cash): improve payment api, add bch accounts
Thore3 Sep 29, 2017
df22ec0
fix(Cash): use bitcoin cash receive address for shift return addresses
Thore3 Sep 29, 2017
65231ac
feat(Cash): add bch imported, create spendable super class
Thore3 Oct 2, 2017
1445528
refactor(Cash): get indexes from bch wallet, rather than setting them…
Thore3 Oct 2, 2017
62e77d4
feat(Shift): allow building a shapeshift payment from any account
Thore3 Sep 27, 2017
c68c130
feat(Cash): support shifting from any bch account
Thore3 Oct 2, 2017
264747b
refactor(Cash): bcash -> bch
Thore3 Oct 2, 2017
bf41736
fix(Cash): initialize only if wallet is v3
Thore3 Oct 2, 2017
69ded45
refactor(Cash): cash-payment -> bch-payment
Thore3 Oct 2, 2017
afeb011
refactor(Cash): api -> bch-api
Thore3 Oct 2, 2017
a36e5b3
fix(Cash): return null for imported.balance if all are null
Thore3 Oct 2, 2017
b29ad0e
fix(Cash): correct response type from Spendable.getAvailableBalance
Thore3 Oct 2, 2017
89ddc37
refactor(Cash): remove unused constructor param
Thore3 Oct 2, 2017
0af37bc
feat(Cash): improved payment api semantics, better error handling and…
Thore3 Oct 2, 2017
4ff9d65
feat(Tx): add coinCode to wallet tx classes
Thore3 Oct 2, 2017
0ca2e7a
fix(Tx): correctly assign coinCode
Thore3 Oct 2, 2017
019f984
refactor(Shift): move btc shift label setting out of payment class
Thore3 Oct 2, 2017
ce190e6
fix(Tx): get coinCode property from correct object
Thore3 Oct 2, 2017
9ed8aac
feat(Cash): include tx hash in publish response
Thore3 Oct 2, 2017
89c2527
refactor(Cash): avoid unnecessary request to fetch change index
Thore3 Oct 2, 2017
93b95b5
fix(Cash): set importedAddresses to null if wallet has no addresses
Thore3 Oct 2, 2017
d30469b
fix(Cash): use correct ramda function
Thore3 Oct 2, 2017
bb32499
fix(Cash): pass latest block object rather than height
Thore3 Oct 3, 2017
e438529
fix(Bitcoin Cash): include unconfirmed txs
Oct 3, 2017
4cdba8c
Merge pull request #445 from blockchain/bcash-txs
jtormey Oct 3, 2017
9e29f10
Merge pull request #444 from blockchain/v3.37-release
jtormey Oct 3, 2017
d53da6a
Merge branch 'bcash' into v3.38-release
Thore3 Oct 3, 2017
463c0f3
chore(Release): v3.38.0
Thore3 Oct 3, 2017
77836b3
chore(Style): fix linter errors
Thore3 Oct 3, 2017
b8c9441
chore(Release): v3.38.1
Thore3 Oct 3, 2017
d96be75
refactor(Test): move mocks to __mocks__
Thore3 Oct 3, 2017
9375a4b
test(Cash): add tests for bch
Thore3 Oct 3, 2017
0cf813f
Merge branch 'bch-test' into v3.38-release
Thore3 Oct 3, 2017
135b6e1
feat(Cash): use hdaccount label for bch accounts
Thore3 Oct 4, 2017
918e3e5
fix(Cash): do not deal with watch only addresses for bch
Thore3 Oct 5, 2017
0f9f8a1
fix(Cash): bch account label prefix
Thore3 Oct 5, 2017
ecf020c
fix(Cash): exclude archived addresses from bch
Thore3 Oct 5, 2017
df6889b
Merge branch 'bch-fix' into v3.38-release
Thore3 Oct 5, 2017
06cc706
test(Cash): remove extra mock data
Thore3 Oct 5, 2017
30f9f62
chore(Release): v3.38.2
Thore3 Oct 5, 2017
265194f
chore(Package): remove unused deps
Thore3 Oct 6, 2017
0b6dbb7
chore(Package): remove unused deps
Thore3 Oct 6, 2017
abbdec9
chore(Api): remove unused api method
Thore3 Oct 6, 2017
ceafaa4
chore(Cash): remove commented module import
Thore3 Oct 6, 2017
e85bf57
chore(Cash): default to bitcoinjs-lib in KeyRing
Thore3 Oct 6, 2017
26551fc
fix(Shift): protect against passing invalid account types
Thore3 Oct 6, 2017
f00fd02
chore(Release): v3.38.3
Thore3 Oct 6, 2017
df7f53e
Merge branch 'master' into v3.38-release
Thore3 Oct 6, 2017
f7fd165
chore(Release): v3.38.4
Thore3 Oct 6, 2017
3d881ee
chore(Cash): remove bch window access
Thore3 Oct 10, 2017
cebbf92
fix(Cash): mark bch.imported as having bch coinCode
Thore3 Oct 10, 2017
6653c7e
chore(Release): v3.38.5
Thore3 Oct 10, 2017
eda1257
Merge pull request #446 from blockchain/v3.38-release
jtormey Oct 11, 2017
da3dfb7
test(Shift): test shapeshift trade
Thore3 Oct 12, 2017
1c05820
fix(Shift): save trade in metadata with unix timestamp
Thore3 Oct 12, 2017
5c3fec8
chore(Release): upgrade bitcoin-coinify-client
Oct 15, 2017
4242c23
chore(Release): v3.39.0
Oct 15, 2017
6ecb9d6
fix(Shift): preserve time property
Thore3 Oct 16, 2017
f4406ae
Merge pull request #450 from blockchain/ss-timestamp
Pernas Oct 16, 2017
1feebfb
chore(Release): v3.39.1
Oct 16, 2017
85d99fe
chore(Release): bump coinify client version
Oct 16, 2017
cf37be8
chore(Release): v3.39.2
Oct 16, 2017
2d8a636
test(Cash): test bch signing function
Thore3 Oct 19, 2017
a3eac77
feat(Signer): sign for btc as well
Thore3 Oct 19, 2017
4992093
refactor(Cash): move coin selection and signing to src folder
Thore3 Oct 19, 2017
bdf6d50
feat(HDWallet): add hd account consolidation method
Thore3 Oct 19, 2017
5a57957
Merge pull request #451 from blockchain/consolidate
jtormey Oct 20, 2017
25dd404
feat(ShapeShift): ability to receive to multiple btc accounts
Oct 23, 2017
d41cff4
feat(ShapeShift): pass from, to to getQuote and getApproximateQuote, …
Oct 23, 2017
88fe9c8
Merge pull request #452 from blockchain/ss-improvements
jtormey Oct 23, 2017
01998a4
refactor(Shift): more generic creation of shift payments
Thore3 Oct 23, 2017
1115cba
Merge pull request #453 from blockchain/ss-generic
plondon Oct 23, 2017
cfbfdee
chore(Release): upgrade bitcoin-sfox-client
Oct 24, 2017
76bc8f8
chore(Release): v3.39.3
Oct 24, 2017
99ea4ba
chore(Release): upgrade bitcoin-sfox-client
Oct 24, 2017
b64bede
chore(Release): v3.39.4
Oct 24, 2017
3c57c7e
chore(Release): upgrade bitcoin-sfox-client
Oct 24, 2017
e0a9e24
chore(Release): v3.39.5
Oct 24, 2017
0abe116
chore(Release): upgrade sfox/coinify clients
Oct 29, 2017
8cf977c
chore(Release): v3.39.6
Oct 29, 2017
966939b
feat(Cash): treat archived imported addresses as active for bch
Thore3 Oct 31, 2017
873be81
Merge pull request #455 from blockchain/bch-archived
Oct 31, 2017
890e492
chore(Release): v3.39.7
Thore3 Nov 2, 2017
bf2f43c
feat(External): return partner name from hasExchangeAccount
Nov 3, 2017
dc19a03
Merge branch 'v3.39-release' into sfox-sell
Nov 7, 2017
e3cf536
Merge pull request #448 from blockchain/v3.39-release
plondon Nov 7, 2017
85a1834
chore(Release): update bitcoin-coinify-client dependency
Nov 9, 2017
ba59a39
chore(Release): v3.40.0
Nov 9, 2017
2a3f1d7
Merge branch 'v3.40-release' into sfox-sell
Nov 9, 2017
e0330c5
feat(Recurring Buy): if recurring exists change addr label
Nov 16, 2017
6f5cd8c
chore(Release): upgrade clients
Nov 16, 2017
bf23e64
chore(Release): v3.40.1
Nov 16, 2017
2ae7e8a
Merge branch 'v3.40-release' into sfox-sell
Nov 17, 2017
0e49b1e
Merge pull request #459 from blockchain/sfox-sell
plondon Nov 17, 2017
5258d70
chore(Release): upgrade coinify/unocoin clients
Nov 21, 2017
c458ddb
chore(Release): v3.40.2
Nov 21, 2017
673328c
fix(BCH): ability to exchange from imported
Nov 21, 2017
cfdec32
chore(Release): v3.40.3
Nov 28, 2017
5ace69a
feat(BCH): add bch to currency balance stats
Thore3 Nov 29, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ npm-debug.log
# Generated js files
build
dist
lib

# Generated coverage reports
coverage
Expand Down
11 changes: 11 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
node_modules
build
coverage
coverage-lcov
npm-debug.log
tests
.travis.yml
Changelog.md
karma.conf.js
Makefile
webpack.config.js
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ build: node_modules
npm run build

test: build
./node_modules/karma/bin/karma start karma.conf.js --single-run
# ./node_modules/karma/bin/karma start karma.conf.js --single-run

dist/my-wallet.js: build

Expand Down
31 changes: 2 additions & 29 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module.exports = function (config) {
basePath: './',
frameworks: ['jasmine', 'browserify'],
browsers: ['PhantomJS'],
browserNoActivityTimeout: 60000,
browserNoActivityTimeout: 180000,
// reportSlowerThan: 50,
logLevel: config.LOG_WARN,
client: {
Expand Down Expand Up @@ -48,34 +48,7 @@ module.exports = function (config) {
files: [
'node_modules/babel-polyfill/dist/polyfill.js',
'node_modules/jasmine-es6-promise-matchers/jasmine-es6-promise-matchers.js',
'tests/mocks/*.js',
'tests/wallet_token_endpoints.js',
'tests/wallet_network_spec.js',
'tests/api_spec.js',
'tests/helpers_spec.js',
'tests/blockchain_socket.js',
'tests/transaction_spend_spec.js',
'tests/wallet_spec.js',
'tests/bip38_spec.js',
'tests/address_spec.js',
'tests/external_spec.js',
'tests/keychain_spec.js',
'tests/keyring_spec.js',
'tests/hdaccount_spec.js',
'tests/hdwallet_spec.js',
'tests/blockchain_wallet_spec.js',
'tests/rng_spec.js',
'tests/payment_spec.js',
'tests/wallet_transaction_spec.js',
'tests/transaction_list_spec.js',
'tests/wallet_crypto_spec.js',
'tests/wallet_signup_spec.js',
'tests/blockchain_settings_api_spec.js',
'tests/account_info_spec.js',
'tests/metadata_spec.js',
'tests/exchange_delegate_spec.js',
'tests/labels_spec.js',
'tests/address_hd_spec.js'
'tests/**/*.spec.js'
]
};

Expand Down
27 changes: 22 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "blockchain-wallet-client",
"version": "3.32.0",
"version": "3.40.3",
"description": "Blockchain.info JavaScript Wallet",
"homepage": "https://github.com/blockchain/my-wallet-v3",
"bugs": {
Expand All @@ -21,37 +21,53 @@
"Kevin Woudini",
"Justin Tormey"
],
"main": "index.js",
"main": "lib/index.js",
"module": "src/index.js",
"repository": {
"type": "git",
"url": "https://github.com/blockchain/my-wallet-v3.git"
},
"scripts": {
"prepublish": "node_modules/.bin/babel src --presets babel-preset-es2015 --out-dir lib",
"dist": "NODE_ENV=\"prod\" ./node_modules/.bin/webpack",
"build": "./node_modules/.bin/webpack --progress",
"build:watch": "./node_modules/.bin/webpack -w",
"clean": "rm -rf dist/ coverage/ coverage-lcov/",
"test": "./node_modules/karma/bin/karma start karma.conf.js"
"test": "./node_modules/.bin/karma start karma.conf.js",
"test:chrome": "./node_modules/.bin/karma start karma.conf.js --browsers ChromeHeadless"
},
"browser": {
"ws": "./src/ws-browser.js"
},
"dependencies": {
"babel-plugin-transform-es3-member-expression-literals": "^6.22.0",
"babel-plugin-transform-es3-property-literals": "^6.22.0",
"babel-plugin-transform-object-rest-spread": "^6.23.0",
"babel-preset-stage-0": "^6.24.1",
"bigi": "1.4.*",
"bignumber.js": "^4.0.2",
"bip39": "2.1.*",
"bitcoin-coinify-client": "^0.6.2",
"bitcoin-sfox-client": "^0.1.11",
"bitcoin-coinify-client": "^0.7.5",
"bitcoin-sfox-client": "^0.2.1",
"bitcoin-unocoin-client": "^0.3.6",
"bitcoincashjs-lib": "https://github.com/bitcoinjs/bitcoinjs-lib#9ac221c80dbc3462d7a2392cec2045ae2b590461",
"bitcoinjs-lib": "2.1.*",
"bs58": "2.0.*",
"core-js": "^2.4.1",
"es6-promise": "^3.0.2",
"ethereumjs-tx": "^1.3.1",
"ethereumjs-util": "^5.1.2",
"ethereumjs-wallet": "^0.6.0",
"isomorphic-fetch": "^2.2.1",
"pbkdf2": "^3.0.12",
"ramda": "^0.22.1",
"ramda-lens": "^0.1.2",
"randombytes": "^2.0.1",
"unorm": "^1.4.1",
"ws": "2.0.*"
},
"devDependencies": {
"babel-cli": "~6.24.0",
"babel-loader": "6.2.10",
"babel-plugin-transform-object-assign": "~6.22.0",
"babel-polyfill": "6.16.*",
Expand All @@ -69,6 +85,7 @@
"jasmine-es6-promise-matchers": "^2.0.1",
"karma": "1.7.*",
"karma-browserify": "5.1.*",
"karma-chrome-launcher": "^2.2.0",
"karma-coverage": "1.1.*",
"karma-jasmine": "1.1.*",
"karma-osx-reporter": "0.2.*",
Expand Down
5 changes: 5 additions & 0 deletions src/account-info.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ function AccountInfo (object) {
this.mobile = object.sms_number;

this._countryCodeGuess = object.country_code; // Country guess by the backend
this._stateCodeGuess = object.state; // State guess by the backend
this._dialCode = object.dial_code; // Dialcode guess by the backend

this._isEmailVerified = Boolean(object.email_verified);
Expand Down Expand Up @@ -67,6 +68,10 @@ Object.defineProperties(AccountInfo.prototype, {
configurable: false,
get: function () { return this._countryCodeGuess; }
},
'stateCodeGuess': {
configurable: false,
get: function () { return this._stateCodeGuess; }
},
'dialCode': {
configurable: false,
get: function () { return this._dialCode; }
Expand Down
2 changes: 1 addition & 1 deletion src/address.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
module.exports = Address;

var Base58 = require('bs58');
var RNG = require('./rng');
var RNG = require('./rng.js');
var API = require('./api');
var Bitcoin = require('bitcoinjs-lib');
var Helpers = require('./helpers');
Expand Down
64 changes: 55 additions & 9 deletions src/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ var MyWallet = require('./wallet');
function API () {
// private members
this.ROOT_URL = 'https://blockchain.info/';
this.API_ROOT_URL = 'https://api.blockchain.info/';
this.AJAX_RETRY_DEFAULT = 2;
this.API_CODE = '1770d5d9-bcea-4d28-ad21-6cbd5be018a8';
this.SERVER_TIME_OFFSET = null;
Expand Down Expand Up @@ -241,22 +242,29 @@ API.prototype.pushTx = function (txHex, note) {
return this.request('POST', 'pushtx', data).then(responseTXHASH);
};

API.prototype.getFees = function () {
API.prototype.requestApi = function (endpoint, data) {
var handleNetworkError = function () {
return Promise.reject({ initial_error: 'Connectivity error, failed to send network request' });
};

var checkStatus = function (response) {
if (response.status >= 200 && response.status < 300) {
return response.json();
} else {
return response.text().then(Promise.reject.bind(Promise));
}
return response.status >= 200 && response.status < 300
? response.json()
: response.text().then(Promise.reject.bind(Promise));
};

return fetch(this.API_ROOT_URL + 'mempool/fees')
.then(checkStatus)
.catch(handleNetworkError);
var url = data ? `${endpoint}?${this.encodeFormData(data)}` : endpoint;

return fetch(this.API_ROOT_URL + url)
.then(checkStatus, handleNetworkError);
};

API.prototype.getFees = function () {
return this.requestApi('mempool/fees');
};

API.prototype.getExchangeRate = function (currency, base) {
return this.requestApi('ticker', { currency, base });
};

API.prototype.exportHistory = function (active, currency, options) {
Expand All @@ -270,6 +278,17 @@ API.prototype.exportHistory = function (active, currency, options) {
return this.request('POST', 'v2/export-history', data);
};

// id :: 0 | 1 | 2
API.prototype.createExperiment = function (id) {
let recordA = this.recordExperimentResult.bind(this, id, 'a');
let recordB = this.recordExperimentResult.bind(this, id, 'b');
return { recordA, recordB };
};

API.prototype.recordExperimentResult = function (experiment, ab) {
return fetch(`${this.ROOT_URL}event?name=wallet_experiment_${experiment}_${ab}`);
};

API.prototype.incrementSecPassStats = function (activeBool) {
var active = activeBool ? 1 : 0;
return fetch(this.ROOT_URL + 'event?name=wallet_login_second_password_' + active);
Expand All @@ -285,6 +304,33 @@ API.prototype.pushTxStats = function (guid, advanced) {
return fetch(this.ROOT_URL + 'event?name=wallet_fee_experiment_' + group + '_pushed_tx' + (advanced ? '_advanced' : ''));
};

API.prototype.incrementLoginViaQrStats = function () {
return fetch(this.ROOT_URL + 'event?name=wallet_web_login_via_qr');
};

API.prototype.incrementCurrencyUsageStats = function (btcBalance, ethBalance, bchBalance) {
let base = this.ROOT_URL + 'event?name=wallet_login_balance';
let makeEventUrl = (btc, eth, bch) => `${base}_btc_${btc ? 1 : 0}_eth_${eth ? 1 : 0}_bch_${bch ? 1 : 0}`;
fetch(makeEventUrl(btcBalance > 0, ethBalance > 0, bchBalance > 0));
};

API.prototype.getPriceChartData = function (params) {
return this.requestApi(`price/index-series?base=${params.base}&quote=${params.quote}&start=${params.start}&scale=${params.scale}`);
};

API.prototype.incrementBuyLimitCounter = function (amount) {
return fetch(`${this.ROOT_URL}event?name=wallet_buy_${amount === 'over' ? 'over' : 'under'}_limit`);
};

API.prototype.incrementBuyDropoff = function (step) {
return fetch(`${this.ROOT_URL}event?name=wallet_buy_dropoff_${step}`);
};

API.prototype.incrementShapeshiftStat = function (options = {}) {
let base = `${this.ROOT_URL}event?name=wallet_shapeshift_viewed`;
return fetch(base + (options.maxLimitError ? '_max_limit_error' : ''));
};

API.prototype.getBlockchainAddress = function () {
return this.request('GET', 'charge_address');
};
60 changes: 60 additions & 0 deletions src/bch/bch-account.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/* eslint-disable semi */
const BchSpendable = require('./bch-spendable')
const BchShiftPayment = require('../shift/bch-payment');

const ACCOUNT_LABEL_PREFIX = 'Bitcoin Cash - '

class BchAccount extends BchSpendable {
constructor (bchWallet, wallet, btcAccount) {
super(bchWallet, wallet)
this._btcAccount = btcAccount
}

get index () {
return this._btcAccount.index
}

get xpub () {
return this._btcAccount.extendedPublicKey
}

get archived () {
return this._btcAccount.archived
}

get label () {
return ACCOUNT_LABEL_PREFIX + this._btcAccount.label
}

get balance () {
return super.getAddressBalance(this.xpub)
}

get receiveAddress () {
let { receive } = this._bchWallet.getAccountIndexes(this.xpub)
return this._btcAccount.receiveAddressAtIndex(receive)
}

get changeAddress () {
let { change } = this._bchWallet.getAccountIndexes(this.xpub)
return this._btcAccount.changeAddressAtIndex(change)
}

get coinCode () {
return 'bch'
}

getAvailableBalance (feePerByte) {
return super.getAvailableBalance(this.index, feePerByte)
}

createPayment () {
return super.createPayment().from(this.index, this.changeAddress)
}

createShiftPayment (wallet) {
return BchShiftPayment.fromWallet(wallet, this)
}
}

module.exports = BchAccount
Loading