@ellipticltd/aml-utils 0.15.3 → 0.15.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -37,6 +37,10 @@ with
37
37
  Commiting
38
38
  -----------
39
39
 
40
+ **N.B. The semantic release process described below currently does not work, meaning this package has to be deployed manually using npm publish.**
41
+
42
+ **If a permissions error is encountered when authenticating with an npm token, remove .npmrc and authenticate using npm login.**
43
+
40
44
  This repository uses [Semantic release](https://semantic-release.gitbook.io/) for version publishing. To create a new version of the package simply push to bitbucket and CircleCI will create a new version. No change to this repo's package.json is required.
41
45
 
42
46
  To work out what the next version of package should be a git commit linter is used. This is enforced by Husky and only commits with the following syntax can be [used](https://github.com/conventional-changelog/commitlint/tree/master/@commitlint/config-angular).
@@ -200,3 +200,9 @@ export namespace avalanche {
200
200
  function isTxHash(str: any): any;
201
201
  function isTxHash(str: any): any;
202
202
  }
203
+ export namespace arbitrum {
204
+ function isAddress(str: any): any;
205
+ function isAddress(str: any): any;
206
+ function isTxHash(str: any): any;
207
+ function isTxHash(str: any): any;
208
+ }
@@ -410,6 +410,14 @@ const validations = {
410
410
  return str.length === 66 && web3.isHexStrict(str);
411
411
  },
412
412
  },
413
+ arbitrum: {
414
+ isAddress(str) {
415
+ return web3.isAddress(str);
416
+ },
417
+ isTxHash(str) {
418
+ return str.length === 66 && web3.isHexStrict(str);
419
+ },
420
+ },
413
421
  };
414
422
  Object.keys(V).forEach((k) => {
415
423
  const v = V[k];
@@ -405,4 +405,16 @@ describe('Validations', () => {
405
405
  });
406
406
  });
407
407
  });
408
+ describe('Arbitrum', () => {
409
+ describe('isAddress', () => {
410
+ describe('isAddress', () => {
411
+ it('should return true if the address evaluates as a web3 address', () => validations_1.default.arbitrum.isAddress('0xa6Bc4b3fe7F2756124d30D896Fe4457711e9d214').should.be.true);
412
+ it('should return false if the address does not evaluate to a web3 address', () => validations_1.default.arbitrum.isAddress('Bc4b3fe7F2756124d30D896Fe4457711e9d214').should.be.false);
413
+ });
414
+ describe('isTxHash', () => {
415
+ it('should correctly validate a valid Arbitrum hash', () => validations_1.default.arbitrum.isTxHash('0xec6491abd46a1a9a71b78f4b84d96fd49525aa4f66c8d8c3588c489f2f88eb0e').should.be.true);
416
+ it('should correctly validate an incorrect Arbitrum hash', () => validations_1.default.arbitrum.isTxHash('0xec6491abd46a1a9a71b7896fd49525aa4f66c8d8c3588c489f2f88eb0e').should.be.false);
417
+ });
418
+ });
419
+ });
408
420
  });
@@ -415,6 +415,14 @@ const validations = {
415
415
  return str.length === 66 && web3.isHexStrict(str);
416
416
  },
417
417
  },
418
+ arbitrum: {
419
+ isAddress(str) {
420
+ return web3.isAddress(str);
421
+ },
422
+ isTxHash(str) {
423
+ return str.length === 66 && web3.isHexStrict(str);
424
+ },
425
+ },
418
426
  };
419
427
 
420
428
  Object.keys(V).forEach((k) => {
@@ -531,4 +531,17 @@ describe('Validations', () => {
531
531
  });
532
532
  });
533
533
  });
534
+ describe('Arbitrum', () => {
535
+ describe('isAddress', () => {
536
+ describe('isAddress', () => {
537
+ it('should return true if the address evaluates as a web3 address', () => validations.arbitrum.isAddress('0xa6Bc4b3fe7F2756124d30D896Fe4457711e9d214').should.be.true);
538
+ it('should return false if the address does not evaluate to a web3 address', () => validations.arbitrum.isAddress('Bc4b3fe7F2756124d30D896Fe4457711e9d214').should.be.false);
539
+ });
540
+ describe('isTxHash', () => {
541
+ it('should correctly validate a valid Arbitrum hash', () => validations.arbitrum.isTxHash('0xec6491abd46a1a9a71b78f4b84d96fd49525aa4f66c8d8c3588c489f2f88eb0e').should.be.true);
542
+
543
+ it('should correctly validate an incorrect Arbitrum hash', () => validations.arbitrum.isTxHash('0xec6491abd46a1a9a71b7896fd49525aa4f66c8d8c3588c489f2f88eb0e').should.be.false);
544
+ });
545
+ });
546
+ });
534
547
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ellipticltd/aml-utils",
3
- "version": "0.15.3",
3
+ "version": "0.15.4",
4
4
  "description": "Utilities, helpers, validations, type-checking, etc",
5
5
  "engines": {
6
6
  "node": "10.1.0",