@ellipticltd/aml-utils 0.15.4 → 0.15.5-SCR-812
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/.nyc_output/43e358d0-76a0-402c-b32e-26a347513bb4.json +1 -0
- package/.nyc_output/f8c694f5-2b17-4e37-9079-32079e715296.json +1 -0
- package/.nyc_output/processinfo/14c71e42-4ce7-487c-be9f-95228038c7ec.json +1 -0
- package/.nyc_output/processinfo/43e358d0-76a0-402c-b32e-26a347513bb4.json +1 -0
- package/.nyc_output/processinfo/470a2eff-bd46-45ef-bfd6-70c01fe4c9b3.json +1 -0
- package/.nyc_output/processinfo/f8c694f5-2b17-4e37-9079-32079e715296.json +1 -0
- package/.nyc_output/processinfo/index.json +1 -1
- package/coverage/errors/errors.js.html +1 -1
- package/coverage/errors/errors.spec.js.html +15 -15
- package/coverage/errors/index.html +12 -12
- package/coverage/file-parser/__tests/file-parser.spec.js.html +96 -96
- package/coverage/file-parser/__tests/index.html +32 -32
- package/coverage/file-parser/__tests/parse-row.spec.js.html +36 -36
- package/coverage/file-parser/__tests/sanitize-rows.spec.js.html +49 -49
- package/coverage/formatting/formatting.js.html +21 -21
- package/coverage/formatting/formatting.spec.js.html +30 -30
- package/coverage/formatting/index.html +28 -28
- package/coverage/index.html +54 -54
- package/coverage/middleware/index.html +1 -1
- package/coverage/middleware/middleware.js.html +1 -1
- package/coverage/orm-helpers/index.html +26 -26
- package/coverage/orm-helpers/ormHelpers.js.html +24 -24
- package/coverage/orm-helpers/ormHelpers.spec.js.html +9 -9
- package/coverage/types/index.html +1 -1
- package/coverage/types/types.js.html +1 -1
- package/coverage/validations/index.html +30 -30
- package/coverage/validations/validations.js.html +545 -236
- package/coverage/validations/validations.spec.js.html +525 -159
- package/dist/validations/validations.d.ts +6 -0
- package/dist/validations/validations.js +8 -0
- package/dist/validations/validations.spec.js +11 -0
- package/lib/validations/validations.js +8 -0
- package/lib/validations/validations.spec.js +16 -0
- package/package.json +1 -1
- package/.idea/aml-utils.iml +0 -12
- package/.idea/inspectionProfiles/Project_Default.xml +0 -6
- package/.idea/modules.xml +0 -8
- package/.idea/vcs.xml +0 -6
- package/.nyc_output/62fbf615-4746-451c-aa0c-c12cb22b7a9d.json +0 -1
- package/.nyc_output/fd0c5a49-1dee-497a-bd75-dcf009fcab1e.json +0 -1
- package/.nyc_output/processinfo/1aa97f38-9e09-4229-9e02-5f7fa02f213b.json +0 -1
- package/.nyc_output/processinfo/62fbf615-4746-451c-aa0c-c12cb22b7a9d.json +0 -1
- package/.nyc_output/processinfo/b5dcfb1d-3f6e-47a0-89e4-e93e7bcc51d7.json +0 -1
- package/.nyc_output/processinfo/fd0c5a49-1dee-497a-bd75-dcf009fcab1e.json +0 -1
- /package/.nyc_output/{1aa97f38-9e09-4229-9e02-5f7fa02f213b.json → 14c71e42-4ce7-487c-be9f-95228038c7ec.json} +0 -0
- /package/.nyc_output/{b5dcfb1d-3f6e-47a0-89e4-e93e7bcc51d7.json → 470a2eff-bd46-45ef-bfd6-70c01fe4c9b3.json} +0 -0
|
@@ -206,3 +206,9 @@ export namespace arbitrum {
|
|
|
206
206
|
function isTxHash(str: any): any;
|
|
207
207
|
function isTxHash(str: any): any;
|
|
208
208
|
}
|
|
209
|
+
export namespace tron {
|
|
210
|
+
function isAddress(str: any): any;
|
|
211
|
+
function isAddress(str: any): any;
|
|
212
|
+
function isTxHash(str: any): any;
|
|
213
|
+
function isTxHash(str: any): any;
|
|
214
|
+
}
|
|
@@ -418,6 +418,14 @@ const validations = {
|
|
|
418
418
|
return str.length === 66 && web3.isHexStrict(str);
|
|
419
419
|
},
|
|
420
420
|
},
|
|
421
|
+
tron: {
|
|
422
|
+
isAddress(str) {
|
|
423
|
+
return addressValidator.validate(str, 'tron');
|
|
424
|
+
},
|
|
425
|
+
isTxHash(str) {
|
|
426
|
+
return str.length === 64 && web3.isHex(str);
|
|
427
|
+
},
|
|
428
|
+
},
|
|
421
429
|
};
|
|
422
430
|
Object.keys(V).forEach((k) => {
|
|
423
431
|
const v = V[k];
|
|
@@ -417,4 +417,15 @@ describe('Validations', () => {
|
|
|
417
417
|
});
|
|
418
418
|
});
|
|
419
419
|
});
|
|
420
|
+
describe('Tron', () => {
|
|
421
|
+
describe('isAddress', () => {
|
|
422
|
+
it('should correctly validate a valid Tron address', () => validations_1.default.tron.isAddress('TPCCPf13PDPp5nEGCiMrE7WXKstpZhmfDw').should.be.true);
|
|
423
|
+
it('should correctly validate an invalid Tron address', () => validations_1.default.tron.isAddress('TPCCPf13PDPp5nEGCiMrE7WXKstpZhmfDwZ').should.be.false);
|
|
424
|
+
});
|
|
425
|
+
describe('isTxHash', () => {
|
|
426
|
+
it('should correctly validate a valid Tron hash', () => validations_1.default.tron.isTxHash('2f63fad2b3f8ccce75490545c8a0dacbb0730ebd7d551a89b015d8ca4ab458f2').should.be.true);
|
|
427
|
+
it('should correctly validate an invalid Tron hash', () => validations_1.default.tron.isTxHash('2f63fad2b3f8ccce75490545c8a0dacbb0730ebd7d551a89b015d8ca4ab458fz').should.be.false);
|
|
428
|
+
it('should correctly validate an invalid Tron hash', () => validations_1.default.tron.isTxHash('2f63fad2b3f8ccce75490545c8a0dacbb0730ebd7d551a89b015d8ca4ab458f21').should.be.false);
|
|
429
|
+
});
|
|
430
|
+
});
|
|
420
431
|
});
|
|
@@ -423,6 +423,14 @@ const validations = {
|
|
|
423
423
|
return str.length === 66 && web3.isHexStrict(str);
|
|
424
424
|
},
|
|
425
425
|
},
|
|
426
|
+
tron: {
|
|
427
|
+
isAddress(str) {
|
|
428
|
+
return addressValidator.validate(str, 'tron');
|
|
429
|
+
},
|
|
430
|
+
isTxHash(str) {
|
|
431
|
+
return str.length === 64 && web3.isHex(str);
|
|
432
|
+
},
|
|
433
|
+
},
|
|
426
434
|
};
|
|
427
435
|
|
|
428
436
|
Object.keys(V).forEach((k) => {
|
|
@@ -544,4 +544,20 @@ describe('Validations', () => {
|
|
|
544
544
|
});
|
|
545
545
|
});
|
|
546
546
|
});
|
|
547
|
+
|
|
548
|
+
describe('Tron', () => {
|
|
549
|
+
describe('isAddress', () => {
|
|
550
|
+
it('should correctly validate a valid Tron address', () => validations.tron.isAddress('TPCCPf13PDPp5nEGCiMrE7WXKstpZhmfDw').should.be.true);
|
|
551
|
+
|
|
552
|
+
it('should correctly validate an invalid Tron address', () => validations.tron.isAddress('TPCCPf13PDPp5nEGCiMrE7WXKstpZhmfDwZ').should.be.false);
|
|
553
|
+
});
|
|
554
|
+
|
|
555
|
+
describe('isTxHash', () => {
|
|
556
|
+
it('should correctly validate a valid Tron hash', () => validations.tron.isTxHash('2f63fad2b3f8ccce75490545c8a0dacbb0730ebd7d551a89b015d8ca4ab458f2').should.be.true);
|
|
557
|
+
|
|
558
|
+
it('should correctly validate an invalid Tron hash', () => validations.tron.isTxHash('2f63fad2b3f8ccce75490545c8a0dacbb0730ebd7d551a89b015d8ca4ab458fz').should.be.false);
|
|
559
|
+
|
|
560
|
+
it('should correctly validate an invalid Tron hash', () => validations.tron.isTxHash('2f63fad2b3f8ccce75490545c8a0dacbb0730ebd7d551a89b015d8ca4ab458f21').should.be.false);
|
|
561
|
+
});
|
|
562
|
+
});
|
|
547
563
|
});
|
package/package.json
CHANGED
package/.idea/aml-utils.iml
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<module type="WEB_MODULE" version="4">
|
|
3
|
-
<component name="NewModuleRootManager">
|
|
4
|
-
<content url="file://$MODULE_DIR$">
|
|
5
|
-
<excludeFolder url="file://$MODULE_DIR$/temp" />
|
|
6
|
-
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
|
|
7
|
-
<excludeFolder url="file://$MODULE_DIR$/tmp" />
|
|
8
|
-
</content>
|
|
9
|
-
<orderEntry type="inheritedJdk" />
|
|
10
|
-
<orderEntry type="sourceFolder" forTests="false" />
|
|
11
|
-
</component>
|
|
12
|
-
</module>
|
package/.idea/modules.xml
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<project version="4">
|
|
3
|
-
<component name="ProjectModuleManager">
|
|
4
|
-
<modules>
|
|
5
|
-
<module fileurl="file://$PROJECT_DIR$/.idea/aml-utils.iml" filepath="$PROJECT_DIR$/.idea/aml-utils.iml" />
|
|
6
|
-
</modules>
|
|
7
|
-
</component>
|
|
8
|
-
</project>
|