Skip to content

Commit

Permalink
feat: add support for syscoin
Browse files Browse the repository at this point in the history
  • Loading branch information
deefactorial committed Dec 10, 2021
1 parent c5b3ed0 commit 71b50e1
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ npm install multicoin-address-validator
* StormX/stmx `'StormX'` or `'stmx'`
* Swarm City/swt `'Swarm City'` or `'swt'`
* Synthetix Network/snx `'Synthetix Network'` or `'snx'`
* Syscoin `'Syscoin'` or `'sys'`
* Tap/xtp `'Tap'` or `'xtp'`
* TEMCO/temco `'TEMCO'` or `'temco'`
* TenX/pay `'TenX'` or `'pay'`
Expand Down
7 changes: 7 additions & 0 deletions dist/wallet-address-validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -12464,6 +12464,13 @@ var CURRENCIES = [{
validator: Base58Validator,
maxLength: 44,
minLength: 43
},
{
name: 'Syscoin',
symbol: 'sys',
addressTypes: { prod: ['3f'], testnet: ['41'] },
bech32Hrp: { prod: ['sys'], testnet: ['tsys'] },
validator: BTCValidator
}
];

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

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
"StormX","stmx",
"Swarm City","swt",
"Synthetix Network","snx",
"Syscoin","sys",
"Tap","xtp",
"TEMCO","temco",
"TenX","pay",
Expand Down
7 changes: 7 additions & 0 deletions src/currencies.js
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,13 @@ var CURRENCIES = [{
validator: Base58Validator,
maxLength: 44,
minLength: 43
},
{
name: 'Syscoin',
symbol: 'sys',
addressTypes: { prod: ['3f'], testnet: ['41'] },
bech32Hrp: { prod: ['sys'], testnet: ['tsys'] },
validator: BTCValidator
}
];

Expand Down
6 changes: 6 additions & 0 deletions test/wallet_address_validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -819,6 +819,12 @@ describe('WAValidator.validate()', function () {
valid('G4qGCGF4vWGPzYi2pxc2Djvgv3j8NiWaHQMgTVebCX6W', 'sol');
});

it('should return true for correct sys addresses', function () {
valid('SdzKyvhD2Y3xJvGVSfx96NXszq6x9BZX34', 'sys');
valid('sys1qmrp4z288583kjcj2f4cy5gyauv026ppsrzu2h0', 'sys');
valid('tsys1quuu4ach5npjp3vpmaezzctc9r33405p39khz67', 'sys', 'testnet');
valid('TP81Y6pnybiw93vwHugV5zvKizg2rLQBGE', 'sys', 'testnet')
})
});

describe('invalid results', function () {
Expand Down

0 comments on commit 71b50e1

Please sign in to comment.