@ellipticltd/aml-utils 0.2.0 → 0.2.2
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/.idea/workspace.xml +52 -19
- package/.npmignore +4 -0
- package/lib/validations.js +3 -3
- package/package.json +1 -1
package/.idea/workspace.xml
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<project version="4">
|
|
3
3
|
<component name="ChangeListManager">
|
|
4
|
-
<list default="true" id="beae4972-1969-4895-bbc9-d79f09bb9811" name="Default" comment=""
|
|
5
|
-
<change beforePath="$PROJECT_DIR$/package.json" beforeDir="false" afterPath="$PROJECT_DIR$/package.json" afterDir="false" />
|
|
6
|
-
</list>
|
|
4
|
+
<list default="true" id="beae4972-1969-4895-bbc9-d79f09bb9811" name="Default" comment="" />
|
|
7
5
|
<ignored path="$PROJECT_DIR$/.tmp/" />
|
|
8
6
|
<ignored path="$PROJECT_DIR$/temp/" />
|
|
9
7
|
<ignored path="$PROJECT_DIR$/tmp/" />
|
|
@@ -15,18 +13,32 @@
|
|
|
15
13
|
<option name="LAST_RESOLUTION" value="IGNORE" />
|
|
16
14
|
</component>
|
|
17
15
|
<component name="FileEditorManager">
|
|
18
|
-
<leaf>
|
|
19
|
-
<file leaf-file-name="package.json" pinned="false" current-in-tab="
|
|
16
|
+
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
|
|
17
|
+
<file leaf-file-name="package.json" pinned="false" current-in-tab="false">
|
|
20
18
|
<entry file="file://$PROJECT_DIR$/package.json">
|
|
21
19
|
<provider selected="true" editor-type-id="text-editor">
|
|
22
20
|
<state relative-caret-position="364">
|
|
23
|
-
<caret line="28" column="
|
|
21
|
+
<caret line="28" column="32" selection-start-line="28" selection-start-column="32" selection-end-line="28" selection-end-column="32" />
|
|
22
|
+
</state>
|
|
23
|
+
</provider>
|
|
24
|
+
</entry>
|
|
25
|
+
</file>
|
|
26
|
+
<file leaf-file-name="validations.js" pinned="false" current-in-tab="true">
|
|
27
|
+
<entry file="file://$PROJECT_DIR$/lib/validations.js">
|
|
28
|
+
<provider selected="true" editor-type-id="text-editor">
|
|
29
|
+
<state relative-caret-position="399">
|
|
30
|
+
<caret line="148" column="7" lean-forward="true" selection-start-line="148" selection-start-column="7" selection-end-line="148" selection-end-column="7" />
|
|
24
31
|
</state>
|
|
25
32
|
</provider>
|
|
26
33
|
</entry>
|
|
27
34
|
</file>
|
|
28
35
|
</leaf>
|
|
29
36
|
</component>
|
|
37
|
+
<component name="FindInProjectRecents">
|
|
38
|
+
<findStrings>
|
|
39
|
+
<find>addressVal</find>
|
|
40
|
+
</findStrings>
|
|
41
|
+
</component>
|
|
30
42
|
<component name="Git.Settings">
|
|
31
43
|
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
|
32
44
|
</component>
|
|
@@ -34,6 +46,7 @@
|
|
|
34
46
|
<option name="CHANGED_PATHS">
|
|
35
47
|
<list>
|
|
36
48
|
<option value="$PROJECT_DIR$/package.json" />
|
|
49
|
+
<option value="$PROJECT_DIR$/lib/validations.js" />
|
|
37
50
|
</list>
|
|
38
51
|
</option>
|
|
39
52
|
</component>
|
|
@@ -71,6 +84,11 @@
|
|
|
71
84
|
<item name="aml-utils" type="b2602c69:ProjectViewProjectNode" />
|
|
72
85
|
<item name="aml-utils" type="462c0819:PsiDirectoryNode" />
|
|
73
86
|
</path>
|
|
87
|
+
<path>
|
|
88
|
+
<item name="aml-utils" type="b2602c69:ProjectViewProjectNode" />
|
|
89
|
+
<item name="aml-utils" type="462c0819:PsiDirectoryNode" />
|
|
90
|
+
<item name="lib" type="462c0819:PsiDirectoryNode" />
|
|
91
|
+
</path>
|
|
74
92
|
</expand>
|
|
75
93
|
<select />
|
|
76
94
|
</subPane>
|
|
@@ -109,35 +127,36 @@
|
|
|
109
127
|
<option name="number" value="Default" />
|
|
110
128
|
<option name="presentableId" value="Default" />
|
|
111
129
|
<updated>1563360614655</updated>
|
|
112
|
-
<workItem from="1563360615721" duration="
|
|
130
|
+
<workItem from="1563360615721" duration="151000" />
|
|
131
|
+
<workItem from="1567667753338" duration="597000" />
|
|
113
132
|
</task>
|
|
114
133
|
<servers />
|
|
115
134
|
</component>
|
|
116
135
|
<component name="TimeTrackingManager">
|
|
117
|
-
<option name="totallyTimeSpent" value="
|
|
136
|
+
<option name="totallyTimeSpent" value="748000" />
|
|
118
137
|
</component>
|
|
119
138
|
<component name="ToolWindowManager">
|
|
120
|
-
<frame x="0" y="23" width="
|
|
139
|
+
<frame x="0" y="23" width="1920" height="1057" extended-state="6" />
|
|
121
140
|
<editor active="true" />
|
|
122
141
|
<layout>
|
|
123
|
-
<window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.
|
|
142
|
+
<window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.24907847" />
|
|
124
143
|
<window_info anchor="bottom" id="TODO" order="6" />
|
|
125
|
-
<window_info anchor="bottom" id="Docker" show_stripe_button="false" />
|
|
126
|
-
<window_info anchor="bottom" id="Event Log" side_tool="true" />
|
|
144
|
+
<window_info anchor="bottom" id="Docker" order="7" show_stripe_button="false" />
|
|
145
|
+
<window_info anchor="bottom" id="Event Log" order="7" side_tool="true" />
|
|
146
|
+
<window_info id="npm" order="2" side_tool="true" />
|
|
147
|
+
<window_info anchor="bottom" id="Version Control" order="7" />
|
|
127
148
|
<window_info anchor="bottom" id="Run" order="2" />
|
|
128
|
-
<window_info anchor="bottom" id="Version Control" />
|
|
129
|
-
<window_info id="npm" side_tool="true" />
|
|
130
149
|
<window_info id="Structure" order="1" side_tool="true" weight="0.25" />
|
|
131
|
-
<window_info anchor="bottom" id="Terminal" />
|
|
150
|
+
<window_info anchor="bottom" id="Terminal" order="7" />
|
|
151
|
+
<window_info id="Favorites" order="2" side_tool="true" />
|
|
132
152
|
<window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
|
|
133
|
-
<window_info id="Favorites" side_tool="true" />
|
|
134
|
-
<window_info anchor="bottom" id="Find" order="1" />
|
|
135
|
-
<window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
|
|
136
|
-
<window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
|
|
137
153
|
<window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
|
|
154
|
+
<window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
|
|
155
|
+
<window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
|
|
138
156
|
<window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
|
|
139
157
|
<window_info anchor="bottom" id="Message" order="0" />
|
|
140
158
|
<window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
|
|
159
|
+
<window_info anchor="bottom" id="Find" order="1" />
|
|
141
160
|
</layout>
|
|
142
161
|
</component>
|
|
143
162
|
<component name="TypeScriptGeneratedFilesManager">
|
|
@@ -154,5 +173,19 @@
|
|
|
154
173
|
</state>
|
|
155
174
|
</provider>
|
|
156
175
|
</entry>
|
|
176
|
+
<entry file="file://$PROJECT_DIR$/package.json">
|
|
177
|
+
<provider selected="true" editor-type-id="text-editor">
|
|
178
|
+
<state relative-caret-position="364">
|
|
179
|
+
<caret line="28" column="32" selection-start-line="28" selection-start-column="32" selection-end-line="28" selection-end-column="32" />
|
|
180
|
+
</state>
|
|
181
|
+
</provider>
|
|
182
|
+
</entry>
|
|
183
|
+
<entry file="file://$PROJECT_DIR$/lib/validations.js">
|
|
184
|
+
<provider selected="true" editor-type-id="text-editor">
|
|
185
|
+
<state relative-caret-position="399">
|
|
186
|
+
<caret line="148" column="7" lean-forward="true" selection-start-line="148" selection-start-column="7" selection-end-line="148" selection-end-column="7" />
|
|
187
|
+
</state>
|
|
188
|
+
</provider>
|
|
189
|
+
</entry>
|
|
157
190
|
</component>
|
|
158
191
|
</project>
|
package/.npmignore
ADDED
package/lib/validations.js
CHANGED
|
@@ -137,7 +137,7 @@ const validations = {
|
|
|
137
137
|
bitcoin: {
|
|
138
138
|
isAddress(str) {
|
|
139
139
|
const network =
|
|
140
|
-
process.env.BITCOIN_NETWORK === 'testnet' ? 'testnet' : '
|
|
140
|
+
process.env.BITCOIN_NETWORK === 'testnet' ? 'testnet' : 'prod';
|
|
141
141
|
return typeof str === 'string' && addressValidator.validate(str.trim(), 'BTC', network);
|
|
142
142
|
},
|
|
143
143
|
isBech32Address(str) {
|
|
@@ -208,7 +208,7 @@ const validations = {
|
|
|
208
208
|
},
|
|
209
209
|
bitcoinCash: {
|
|
210
210
|
isAddress(str) {
|
|
211
|
-
return /^[13][a-km-zA-HJ-NP-Z1-9]{25,34}
|
|
211
|
+
return /^[13][a-km-zA-HJ-NP-Z1-9]{25,34}$|^(bitcoincash:)?[q|p][a-z0-9]{41}$|^(BITCOINCASH:)?[Q|P][A-Z0-9]{41}$/.test(str);
|
|
212
212
|
},
|
|
213
213
|
isTxHash(str) {
|
|
214
214
|
if (!V.isHexadecimal(`${str}`)) {
|
|
@@ -219,7 +219,7 @@ const validations = {
|
|
|
219
219
|
},
|
|
220
220
|
litecoin: {
|
|
221
221
|
isAddress(str) {
|
|
222
|
-
return /^[3LM][a-km-zA-HJ-NP-Z1-9]{24,33}
|
|
222
|
+
return /^[3LM][a-km-zA-HJ-NP-Z1-9]{24,33}$|^ltc1[ac-hj-np-z02-9]{6,86}$|^LTC1[AC-HJ-NP-Z02-9]{6,86}$/.test(str);
|
|
223
223
|
},
|
|
224
224
|
isTxHash(str) {
|
|
225
225
|
if (!V.isHexadecimal(`${str}`)) {
|