@ellipticltd/aml-utils 0.4.0 → 0.6.0

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.
@@ -9,6 +9,7 @@ const {
9
9
  Transaction,
10
10
  } = require('bitcore-lib');
11
11
  const addressValidator = require('wallet-address-validator');
12
+ const zilUtils = require('@zilliqa-js/util');
12
13
  const web3 = require('web3-utils');
13
14
  const E = require('./errors');
14
15
 
@@ -238,6 +239,14 @@ const validations = {
238
239
  return str.length === 64;
239
240
  },
240
241
  },
242
+ zilliqa: {
243
+ isAddress(str) {
244
+ return zilUtils.validation.isBech32(str);
245
+ },
246
+ isTxHash(str) {
247
+ return str.length === 66 && web3.isHexStrict(str);
248
+ },
249
+ },
241
250
  };
242
251
 
243
252
  Object.keys(V).forEach((k) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ellipticltd/aml-utils",
3
- "version": "0.4.0",
3
+ "version": "0.6.0",
4
4
  "description": "Utilities, helpers, validations, type-checking, etc",
5
5
  "engines": {
6
6
  "node": "10.1.0",
@@ -23,6 +23,7 @@
23
23
  "author": "Adam Joyce <adam@ellipitc.co>",
24
24
  "license": "MIT",
25
25
  "dependencies": {
26
+ "@zilliqa-js/util": "^0.8.8",
26
27
  "bitcore-lib": "^8.10.1",
27
28
  "create-error": "0.3.1",
28
29
  "lodash": "^4.17.15",
@@ -46,4 +47,4 @@
46
47
  "mocha-lcov-reporter": "^1.3.0",
47
48
  "nyc": "^14.1.1"
48
49
  }
49
- }
50
+ }