Skip to content
This repository has been archived by the owner on Oct 8, 2024. It is now read-only.

Commit

Permalink
chore: CELO validator and BASECHAIN validator added
Browse files Browse the repository at this point in the history
  • Loading branch information
Bereket-G committed Jul 3, 2024
1 parent 4622d80 commit dd4d2b7
Show file tree
Hide file tree
Showing 7 changed files with 4,680 additions and 721 deletions.
11 changes: 11 additions & 0 deletions dist/wallet-address-validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -12423,6 +12423,17 @@ var CURRENCIES = [{
symbol: 'cusd',
validator: ETHValidator
},
{
name: 'CELO',
symbol: 'celo',
validator: ETHValidator
},

{
name: 'BASECHAIN',
symbol: 'BASECHAIN',
validator: ETHValidator
},
{
name: 'Algorand',
symbol: 'algo',
Expand Down
2 changes: 1 addition & 1 deletion dist/wallet-address-validator.min.js

Large diffs are not rendered by default.

4,054 changes: 4,054 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "multicoin-address-validator",
"name": "validate-wallet",
"description": "Multicoin address validator for Bitcoin and other Altcoins.",
"keywords": [
"0x","zrx",
Expand Down Expand Up @@ -32,6 +32,7 @@
"Cred","lba",
"Crypto.com Coin","cro",
"CUSD","cusd",
"CELO","celo",
"Dash","dash",
"Decentraland","mana",
"Decred","dcr",
Expand Down Expand Up @@ -126,13 +127,13 @@
"ZClassic","zcl",
"ZenCash","zen"
],
"version": "0.5.13",
"author": "Chris <chris.tsim@gmail.com>",
"homepage": "https://github.com/christsim/multicoin-address-validator",
"version": "0.5.14",
"author": "Bereket <bereketgebredingle@gmail.com>",
"homepage": "https://github.com/Bereket-G/validate-wallet",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/christsim/multicoin-address-validator.git"
"url": "https://github.com/Bereket-G/validate-wallet.git"
},
"main": "src/wallet_address_validator",
"engines": {
Expand Down
11 changes: 11 additions & 0 deletions src/currencies.js
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,17 @@ var CURRENCIES = [{
symbol: 'cusd',
validator: ETHValidator
},
{
name: 'CELO',
symbol: 'celo',
validator: ETHValidator
},

{
name: 'BASECHAIN',
symbol: 'BASECHAIN',
validator: ETHValidator
},
{
name: 'Algorand',
symbol: 'algo',
Expand Down
21 changes: 21 additions & 0 deletions test/wallet_address_validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -1492,6 +1492,27 @@ describe('invalid results', function () {
invalid('CxDDSH8gS7jecsxaRL8Txf8H5kqesLXAEAEgp76Yz632J9M', 'dot');
});

it('should return false for incorrect celo addresses', function () {
commonTests('celo');
invalid('1jQPKJmghHbrRhUiMt2cNEuxYbR6S9vYtJKqYvE4PNR9WDB', 'dot');
});

it('should return true for correct celo addresses', function () {
commonTests('celo');
valid('0x866a0052df398d3cbc5828038083cc04eb0f1e0f', 'celo');
});


// BASECHAIN
it('should return TRUE for correct BASECHAIN addresses', function () {
commonTests('BASECHAIN');
valid('0x866a0052df398d3cbc5828038083cc04eb0f1e0f', 'BASECHAIN');
});

it('should return FALSE for in correct BASECHAIN addresses', function () {
commonTests('BASECHAIN');
invalid('1jQPKJmghHbrRhUiMt2cNEuxYbR6S9vYtJKqYvE4PNR9WDB', 'BASECHAIN');
});

});

Expand Down
Loading

0 comments on commit dd4d2b7

Please sign in to comment.