Skip to content

Commit

Permalink
Merge branch 'mcuelenaere-neo-support'
Browse files Browse the repository at this point in the history
  • Loading branch information
ognus committed Apr 4, 2018
2 parents 3cf5f37 + b8ec797 commit 8d9710c
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ npm install wallet-address-validator
* Megacoin/MEC, `'megacoin'` or `'MEC'`

* Namecoin/NMC, `'namecoin'` or `'NMC'`
* NEO/NEO, `'NEO'` or `'NEO'`

* Peercoin/PPCoin/PPC, `'peercoin'` or `'PPC'`
* Primecoin/XPM, `'primecoin'` or `'XPM'`
Expand Down
4 changes: 4 additions & 0 deletions dist/wallet-address-validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -3344,6 +3344,10 @@ var CURRENCIES = [{
name: 'dash',
symbol: 'dash',
addressTypes: {prod: ['4c', '10'], testnet: ['8c', '13']}
},{
name: 'neo',
symbol: 'neo',
addressTypes: {prod: ['17'], testnet: []}
}];


Expand Down
2 changes: 1 addition & 1 deletion dist/wallet-address-validator.min.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions src/currencies.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ var CURRENCIES = [{
name: 'dash',
symbol: 'dash',
addressTypes: {prod: ['4c', '10'], testnet: ['8c', '13']}
},{
name: 'neo',
symbol: 'neo',
addressTypes: {prod: ['17'], testnet: []}
}];


Expand Down
11 changes: 11 additions & 0 deletions test/wallet_address_validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,11 @@ describe('WAValidator.validate()', function () {
valid('XqMkVUZnqe3w4xvgdZRtZoe7gMitDudGs4', 'dash');
valid('yPv7h2i8v3dJjfSH4L3x91JSJszjdbsJJA', 'dash', 'testnet');
});

it('should return true for correct neo addresses', function () {
valid('AR4QmqYENiZAD6oXe7ftm6eDcwtHk7rVTT', 'neo');
valid('AKDVzYGLczmykdtRaejgvWeZrvdkVEvQ1X', 'NEO');
});
});

describe('invalid results', function () {
Expand Down Expand Up @@ -366,5 +371,11 @@ describe('WAValidator.validate()', function () {
it('should return false for incorrect dash addresses', function () {
commonTests('dash');
});

it('should return false for incorrect neo addresses', function () {
commonTests('neo');
invalid('AR4QmqYENiZAD6oXe7ftm6eDcwtHk7rVTa', 'neo');
invalid('AKDVzYGLczmykdtRaejgvWeZrvdkVEvQ10', 'NEO');
});
});
});

0 comments on commit 8d9710c

Please sign in to comment.