@xylabs/eth-address 2.6.14

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.
Files changed (41) hide show
  1. package/LICENSE +165 -0
  2. package/README.md +71 -0
  3. package/dist/cjs/EthAddress.d.ts +21 -0
  4. package/dist/cjs/EthAddress.d.ts.map +1 -0
  5. package/dist/cjs/EthAddress.js +60 -0
  6. package/dist/cjs/EthAddress.js.map +1 -0
  7. package/dist/cjs/ellipsize.d.ts +2 -0
  8. package/dist/cjs/ellipsize.d.ts.map +1 -0
  9. package/dist/cjs/ellipsize.js +10 -0
  10. package/dist/cjs/ellipsize.js.map +1 -0
  11. package/dist/cjs/index.d.ts +4 -0
  12. package/dist/cjs/index.d.ts.map +1 -0
  13. package/dist/cjs/index.js +7 -0
  14. package/dist/cjs/index.js.map +1 -0
  15. package/dist/cjs/padHex.d.ts +3 -0
  16. package/dist/cjs/padHex.d.ts.map +1 -0
  17. package/dist/cjs/padHex.js +17 -0
  18. package/dist/cjs/padHex.js.map +1 -0
  19. package/dist/docs.json +773 -0
  20. package/dist/esm/EthAddress.d.ts +21 -0
  21. package/dist/esm/EthAddress.d.ts.map +1 -0
  22. package/dist/esm/EthAddress.js +56 -0
  23. package/dist/esm/EthAddress.js.map +1 -0
  24. package/dist/esm/ellipsize.d.ts +2 -0
  25. package/dist/esm/ellipsize.d.ts.map +1 -0
  26. package/dist/esm/ellipsize.js +6 -0
  27. package/dist/esm/ellipsize.js.map +1 -0
  28. package/dist/esm/index.d.ts +4 -0
  29. package/dist/esm/index.d.ts.map +1 -0
  30. package/dist/esm/index.js +4 -0
  31. package/dist/esm/index.js.map +1 -0
  32. package/dist/esm/padHex.d.ts +3 -0
  33. package/dist/esm/padHex.d.ts.map +1 -0
  34. package/dist/esm/padHex.js +14 -0
  35. package/dist/esm/padHex.js.map +1 -0
  36. package/package.json +65 -0
  37. package/src/EthAddress.spec.ts +10 -0
  38. package/src/EthAddress.ts +69 -0
  39. package/src/ellipsize.ts +5 -0
  40. package/src/index.ts +3 -0
  41. package/src/padHex.ts +14 -0
package/dist/docs.json ADDED
@@ -0,0 +1,773 @@
1
+ {
2
+ "id": 0,
3
+ "name": "@xylabs/eth-address",
4
+ "kind": 1,
5
+ "kindString": "Project",
6
+ "flags": {},
7
+ "originalName": "",
8
+ "children": [
9
+ {
10
+ "id": 10,
11
+ "name": "EthAddress",
12
+ "kind": 128,
13
+ "kindString": "Class",
14
+ "flags": {},
15
+ "children": [
16
+ {
17
+ "id": 20,
18
+ "name": "constructor",
19
+ "kind": 512,
20
+ "kindString": "Constructor",
21
+ "flags": {
22
+ "isPrivate": true
23
+ },
24
+ "sources": [
25
+ {
26
+ "fileName": "EthAddress.ts",
27
+ "line": 16,
28
+ "character": 2,
29
+ "url": "https://github.com/xylabs/sdk-js/blob/d374ec6/packages/eth-address/src/EthAddress.ts#L16"
30
+ }
31
+ ],
32
+ "signatures": [
33
+ {
34
+ "id": 21,
35
+ "name": "new EthAddress",
36
+ "kind": 16384,
37
+ "kindString": "Constructor signature",
38
+ "flags": {},
39
+ "parameters": [
40
+ {
41
+ "id": 22,
42
+ "name": "address",
43
+ "kind": 32768,
44
+ "kindString": "Parameter",
45
+ "flags": {},
46
+ "type": {
47
+ "type": "reference",
48
+ "name": "BN",
49
+ "qualifiedName": "BN",
50
+ "package": "@types/bn.js"
51
+ }
52
+ }
53
+ ],
54
+ "type": {
55
+ "type": "reference",
56
+ "id": 10,
57
+ "name": "EthAddress"
58
+ }
59
+ }
60
+ ]
61
+ },
62
+ {
63
+ "id": 24,
64
+ "name": "address",
65
+ "kind": 1024,
66
+ "kindString": "Property",
67
+ "flags": {
68
+ "isPrivate": true
69
+ },
70
+ "sources": [
71
+ {
72
+ "fileName": "EthAddress.ts",
73
+ "line": 12,
74
+ "character": 10,
75
+ "url": "https://github.com/xylabs/sdk-js/blob/d374ec6/packages/eth-address/src/EthAddress.ts#L12"
76
+ }
77
+ ],
78
+ "type": {
79
+ "type": "reference",
80
+ "name": "BN",
81
+ "qualifiedName": "BN",
82
+ "package": "@types/bn.js"
83
+ }
84
+ },
85
+ {
86
+ "id": 23,
87
+ "name": "type",
88
+ "kind": 1024,
89
+ "kindString": "Property",
90
+ "flags": {
91
+ "isPublic": true
92
+ },
93
+ "sources": [
94
+ {
95
+ "fileName": "EthAddress.ts",
96
+ "line": 10,
97
+ "character": 9,
98
+ "url": "https://github.com/xylabs/sdk-js/blob/d374ec6/packages/eth-address/src/EthAddress.ts#L10"
99
+ }
100
+ ],
101
+ "type": {
102
+ "type": "intrinsic",
103
+ "name": "string"
104
+ },
105
+ "defaultValue": "EthAddress.type"
106
+ },
107
+ {
108
+ "id": 11,
109
+ "name": "type",
110
+ "kind": 1024,
111
+ "kindString": "Property",
112
+ "flags": {
113
+ "isStatic": true
114
+ },
115
+ "sources": [
116
+ {
117
+ "fileName": "EthAddress.ts",
118
+ "line": 14,
119
+ "character": 9,
120
+ "url": "https://github.com/xylabs/sdk-js/blob/d374ec6/packages/eth-address/src/EthAddress.ts#L14"
121
+ }
122
+ ],
123
+ "type": {
124
+ "type": "intrinsic",
125
+ "name": "string"
126
+ },
127
+ "defaultValue": "'EthAddress'"
128
+ },
129
+ {
130
+ "id": 25,
131
+ "name": "equals",
132
+ "kind": 2048,
133
+ "kindString": "Method",
134
+ "flags": {
135
+ "isPublic": true
136
+ },
137
+ "sources": [
138
+ {
139
+ "fileName": "EthAddress.ts",
140
+ "line": 20,
141
+ "character": 9,
142
+ "url": "https://github.com/xylabs/sdk-js/blob/d374ec6/packages/eth-address/src/EthAddress.ts#L20"
143
+ }
144
+ ],
145
+ "signatures": [
146
+ {
147
+ "id": 26,
148
+ "name": "equals",
149
+ "kind": 4096,
150
+ "kindString": "Call signature",
151
+ "flags": {},
152
+ "parameters": [
153
+ {
154
+ "id": 27,
155
+ "name": "address",
156
+ "kind": 32768,
157
+ "kindString": "Parameter",
158
+ "flags": {
159
+ "isOptional": true
160
+ },
161
+ "type": {
162
+ "type": "union",
163
+ "types": [
164
+ {
165
+ "type": "literal",
166
+ "value": null
167
+ },
168
+ {
169
+ "type": "intrinsic",
170
+ "name": "string"
171
+ },
172
+ {
173
+ "type": "reference",
174
+ "id": 10,
175
+ "name": "EthAddress"
176
+ }
177
+ ]
178
+ }
179
+ }
180
+ ],
181
+ "type": {
182
+ "type": "intrinsic",
183
+ "name": "boolean"
184
+ }
185
+ }
186
+ ]
187
+ },
188
+ {
189
+ "id": 28,
190
+ "name": "toBigNumber",
191
+ "kind": 2048,
192
+ "kindString": "Method",
193
+ "flags": {
194
+ "isPublic": true
195
+ },
196
+ "sources": [
197
+ {
198
+ "fileName": "EthAddress.ts",
199
+ "line": 46,
200
+ "character": 9,
201
+ "url": "https://github.com/xylabs/sdk-js/blob/d374ec6/packages/eth-address/src/EthAddress.ts#L46"
202
+ }
203
+ ],
204
+ "signatures": [
205
+ {
206
+ "id": 29,
207
+ "name": "toBigNumber",
208
+ "kind": 4096,
209
+ "kindString": "Call signature",
210
+ "flags": {},
211
+ "type": {
212
+ "type": "reference",
213
+ "name": "BN",
214
+ "qualifiedName": "BN",
215
+ "package": "@types/bn.js"
216
+ }
217
+ }
218
+ ]
219
+ },
220
+ {
221
+ "id": 36,
222
+ "name": "toHex",
223
+ "kind": 2048,
224
+ "kindString": "Method",
225
+ "flags": {
226
+ "isPublic": true
227
+ },
228
+ "sources": [
229
+ {
230
+ "fileName": "EthAddress.ts",
231
+ "line": 62,
232
+ "character": 9,
233
+ "url": "https://github.com/xylabs/sdk-js/blob/d374ec6/packages/eth-address/src/EthAddress.ts#L62"
234
+ }
235
+ ],
236
+ "signatures": [
237
+ {
238
+ "id": 37,
239
+ "name": "toHex",
240
+ "kind": 4096,
241
+ "kindString": "Call signature",
242
+ "flags": {},
243
+ "type": {
244
+ "type": "intrinsic",
245
+ "name": "string"
246
+ }
247
+ }
248
+ ]
249
+ },
250
+ {
251
+ "id": 34,
252
+ "name": "toJSON",
253
+ "kind": 2048,
254
+ "kindString": "Method",
255
+ "flags": {
256
+ "isPublic": true
257
+ },
258
+ "sources": [
259
+ {
260
+ "fileName": "EthAddress.ts",
261
+ "line": 58,
262
+ "character": 9,
263
+ "url": "https://github.com/xylabs/sdk-js/blob/d374ec6/packages/eth-address/src/EthAddress.ts#L58"
264
+ }
265
+ ],
266
+ "signatures": [
267
+ {
268
+ "id": 35,
269
+ "name": "toJSON",
270
+ "kind": 4096,
271
+ "kindString": "Call signature",
272
+ "flags": {},
273
+ "type": {
274
+ "type": "intrinsic",
275
+ "name": "string"
276
+ }
277
+ }
278
+ ]
279
+ },
280
+ {
281
+ "id": 32,
282
+ "name": "toLowerCaseString",
283
+ "kind": 2048,
284
+ "kindString": "Method",
285
+ "flags": {
286
+ "isPublic": true
287
+ },
288
+ "sources": [
289
+ {
290
+ "fileName": "EthAddress.ts",
291
+ "line": 54,
292
+ "character": 9,
293
+ "url": "https://github.com/xylabs/sdk-js/blob/d374ec6/packages/eth-address/src/EthAddress.ts#L54"
294
+ }
295
+ ],
296
+ "signatures": [
297
+ {
298
+ "id": 33,
299
+ "name": "toLowerCaseString",
300
+ "kind": 4096,
301
+ "kindString": "Call signature",
302
+ "flags": {},
303
+ "type": {
304
+ "type": "intrinsic",
305
+ "name": "string"
306
+ }
307
+ }
308
+ ]
309
+ },
310
+ {
311
+ "id": 38,
312
+ "name": "toShortString",
313
+ "kind": 2048,
314
+ "kindString": "Method",
315
+ "flags": {
316
+ "isPublic": true
317
+ },
318
+ "sources": [
319
+ {
320
+ "fileName": "EthAddress.ts",
321
+ "line": 66,
322
+ "character": 9,
323
+ "url": "https://github.com/xylabs/sdk-js/blob/d374ec6/packages/eth-address/src/EthAddress.ts#L66"
324
+ }
325
+ ],
326
+ "signatures": [
327
+ {
328
+ "id": 39,
329
+ "name": "toShortString",
330
+ "kind": 4096,
331
+ "kindString": "Call signature",
332
+ "flags": {},
333
+ "parameters": [
334
+ {
335
+ "id": 40,
336
+ "name": "length",
337
+ "kind": 32768,
338
+ "kindString": "Parameter",
339
+ "flags": {},
340
+ "type": {
341
+ "type": "intrinsic",
342
+ "name": "number"
343
+ },
344
+ "defaultValue": "2"
345
+ }
346
+ ],
347
+ "type": {
348
+ "type": "intrinsic",
349
+ "name": "string"
350
+ }
351
+ }
352
+ ]
353
+ },
354
+ {
355
+ "id": 30,
356
+ "name": "toString",
357
+ "kind": 2048,
358
+ "kindString": "Method",
359
+ "flags": {
360
+ "isPublic": true
361
+ },
362
+ "sources": [
363
+ {
364
+ "fileName": "EthAddress.ts",
365
+ "line": 50,
366
+ "character": 9,
367
+ "url": "https://github.com/xylabs/sdk-js/blob/d374ec6/packages/eth-address/src/EthAddress.ts#L50"
368
+ }
369
+ ],
370
+ "signatures": [
371
+ {
372
+ "id": 31,
373
+ "name": "toString",
374
+ "kind": 4096,
375
+ "kindString": "Call signature",
376
+ "flags": {},
377
+ "type": {
378
+ "type": "intrinsic",
379
+ "name": "string"
380
+ }
381
+ }
382
+ ]
383
+ },
384
+ {
385
+ "id": 12,
386
+ "name": "fromString",
387
+ "kind": 2048,
388
+ "kindString": "Method",
389
+ "flags": {
390
+ "isStatic": true
391
+ },
392
+ "sources": [
393
+ {
394
+ "fileName": "EthAddress.ts",
395
+ "line": 33,
396
+ "character": 9,
397
+ "url": "https://github.com/xylabs/sdk-js/blob/d374ec6/packages/eth-address/src/EthAddress.ts#L33"
398
+ }
399
+ ],
400
+ "signatures": [
401
+ {
402
+ "id": 13,
403
+ "name": "fromString",
404
+ "kind": 4096,
405
+ "kindString": "Call signature",
406
+ "flags": {},
407
+ "parameters": [
408
+ {
409
+ "id": 14,
410
+ "name": "value",
411
+ "kind": 32768,
412
+ "kindString": "Parameter",
413
+ "flags": {
414
+ "isOptional": true
415
+ },
416
+ "type": {
417
+ "type": "intrinsic",
418
+ "name": "string"
419
+ }
420
+ },
421
+ {
422
+ "id": 15,
423
+ "name": "base",
424
+ "kind": 32768,
425
+ "kindString": "Parameter",
426
+ "flags": {},
427
+ "type": {
428
+ "type": "intrinsic",
429
+ "name": "number"
430
+ },
431
+ "defaultValue": "16"
432
+ }
433
+ ],
434
+ "type": {
435
+ "type": "union",
436
+ "types": [
437
+ {
438
+ "type": "intrinsic",
439
+ "name": "undefined"
440
+ },
441
+ {
442
+ "type": "reference",
443
+ "id": 10,
444
+ "name": "EthAddress"
445
+ }
446
+ ]
447
+ }
448
+ }
449
+ ]
450
+ },
451
+ {
452
+ "id": 16,
453
+ "name": "parse",
454
+ "kind": 2048,
455
+ "kindString": "Method",
456
+ "flags": {
457
+ "isStatic": true
458
+ },
459
+ "sources": [
460
+ {
461
+ "fileName": "EthAddress.ts",
462
+ "line": 40,
463
+ "character": 9,
464
+ "url": "https://github.com/xylabs/sdk-js/blob/d374ec6/packages/eth-address/src/EthAddress.ts#L40"
465
+ }
466
+ ],
467
+ "signatures": [
468
+ {
469
+ "id": 17,
470
+ "name": "parse",
471
+ "kind": 4096,
472
+ "kindString": "Call signature",
473
+ "flags": {},
474
+ "parameters": [
475
+ {
476
+ "id": 18,
477
+ "name": "value",
478
+ "kind": 32768,
479
+ "kindString": "Parameter",
480
+ "flags": {},
481
+ "type": {
482
+ "type": "intrinsic",
483
+ "name": "unknown"
484
+ }
485
+ },
486
+ {
487
+ "id": 19,
488
+ "name": "base",
489
+ "kind": 32768,
490
+ "kindString": "Parameter",
491
+ "flags": {
492
+ "isOptional": true
493
+ },
494
+ "type": {
495
+ "type": "intrinsic",
496
+ "name": "number"
497
+ }
498
+ }
499
+ ],
500
+ "type": {
501
+ "type": "union",
502
+ "types": [
503
+ {
504
+ "type": "intrinsic",
505
+ "name": "undefined"
506
+ },
507
+ {
508
+ "type": "reference",
509
+ "id": 10,
510
+ "name": "EthAddress"
511
+ }
512
+ ]
513
+ }
514
+ }
515
+ ]
516
+ }
517
+ ],
518
+ "groups": [
519
+ {
520
+ "title": "Constructors",
521
+ "children": [
522
+ 20
523
+ ]
524
+ },
525
+ {
526
+ "title": "Properties",
527
+ "children": [
528
+ 24,
529
+ 23,
530
+ 11
531
+ ]
532
+ },
533
+ {
534
+ "title": "Methods",
535
+ "children": [
536
+ 25,
537
+ 28,
538
+ 36,
539
+ 34,
540
+ 32,
541
+ 38,
542
+ 30,
543
+ 12,
544
+ 16
545
+ ]
546
+ }
547
+ ],
548
+ "sources": [
549
+ {
550
+ "fileName": "EthAddress.ts",
551
+ "line": 9,
552
+ "character": 13,
553
+ "url": "https://github.com/xylabs/sdk-js/blob/d374ec6/packages/eth-address/src/EthAddress.ts#L9"
554
+ }
555
+ ]
556
+ },
557
+ {
558
+ "id": 1,
559
+ "name": "ellipsize",
560
+ "kind": 64,
561
+ "kindString": "Function",
562
+ "flags": {},
563
+ "sources": [
564
+ {
565
+ "fileName": "ellipsize.ts",
566
+ "line": 1,
567
+ "character": 13,
568
+ "url": "https://github.com/xylabs/sdk-js/blob/d374ec6/packages/eth-address/src/ellipsize.ts#L1"
569
+ }
570
+ ],
571
+ "signatures": [
572
+ {
573
+ "id": 2,
574
+ "name": "ellipsize",
575
+ "kind": 4096,
576
+ "kindString": "Call signature",
577
+ "flags": {},
578
+ "parameters": [
579
+ {
580
+ "id": 3,
581
+ "name": "value",
582
+ "kind": 32768,
583
+ "kindString": "Parameter",
584
+ "flags": {},
585
+ "type": {
586
+ "type": "intrinsic",
587
+ "name": "string"
588
+ }
589
+ },
590
+ {
591
+ "id": 4,
592
+ "name": "length",
593
+ "kind": 32768,
594
+ "kindString": "Parameter",
595
+ "flags": {},
596
+ "type": {
597
+ "type": "intrinsic",
598
+ "name": "number"
599
+ },
600
+ "defaultValue": "2"
601
+ }
602
+ ],
603
+ "type": {
604
+ "type": "intrinsic",
605
+ "name": "string"
606
+ }
607
+ }
608
+ ]
609
+ },
610
+ {
611
+ "id": 5,
612
+ "name": "isEthAddress",
613
+ "kind": 64,
614
+ "kindString": "Function",
615
+ "flags": {},
616
+ "sources": [
617
+ {
618
+ "fileName": "EthAddress.ts",
619
+ "line": 7,
620
+ "character": 13,
621
+ "url": "https://github.com/xylabs/sdk-js/blob/d374ec6/packages/eth-address/src/EthAddress.ts#L7"
622
+ }
623
+ ],
624
+ "signatures": [
625
+ {
626
+ "id": 6,
627
+ "name": "isEthAddress",
628
+ "kind": 4096,
629
+ "kindString": "Call signature",
630
+ "flags": {},
631
+ "parameters": [
632
+ {
633
+ "id": 7,
634
+ "name": "obj",
635
+ "kind": 32768,
636
+ "kindString": "Parameter",
637
+ "flags": {},
638
+ "type": {
639
+ "type": "reflection",
640
+ "declaration": {
641
+ "id": 8,
642
+ "name": "__type",
643
+ "kind": 65536,
644
+ "kindString": "Type literal",
645
+ "flags": {},
646
+ "children": [
647
+ {
648
+ "id": 9,
649
+ "name": "type",
650
+ "kind": 1024,
651
+ "kindString": "Property",
652
+ "flags": {},
653
+ "sources": [
654
+ {
655
+ "fileName": "EthAddress.ts",
656
+ "line": 7,
657
+ "character": 36,
658
+ "url": "https://github.com/xylabs/sdk-js/blob/d374ec6/packages/eth-address/src/EthAddress.ts#L7"
659
+ }
660
+ ],
661
+ "type": {
662
+ "type": "intrinsic",
663
+ "name": "string"
664
+ }
665
+ }
666
+ ],
667
+ "groups": [
668
+ {
669
+ "title": "Properties",
670
+ "children": [
671
+ 9
672
+ ]
673
+ }
674
+ ],
675
+ "sources": [
676
+ {
677
+ "fileName": "EthAddress.ts",
678
+ "line": 7,
679
+ "character": 34,
680
+ "url": "https://github.com/xylabs/sdk-js/blob/d374ec6/packages/eth-address/src/EthAddress.ts#L7"
681
+ }
682
+ ]
683
+ }
684
+ }
685
+ }
686
+ ],
687
+ "type": {
688
+ "type": "intrinsic",
689
+ "name": "boolean"
690
+ }
691
+ }
692
+ ]
693
+ },
694
+ {
695
+ "id": 41,
696
+ "name": "padHex",
697
+ "kind": 64,
698
+ "kindString": "Function",
699
+ "flags": {},
700
+ "sources": [
701
+ {
702
+ "fileName": "padHex.ts",
703
+ "line": 1,
704
+ "character": 6,
705
+ "url": "https://github.com/xylabs/sdk-js/blob/d374ec6/packages/eth-address/src/padHex.ts#L1"
706
+ }
707
+ ],
708
+ "signatures": [
709
+ {
710
+ "id": 42,
711
+ "name": "padHex",
712
+ "kind": 4096,
713
+ "kindString": "Call signature",
714
+ "flags": {},
715
+ "parameters": [
716
+ {
717
+ "id": 43,
718
+ "name": "hex",
719
+ "kind": 32768,
720
+ "kindString": "Parameter",
721
+ "flags": {},
722
+ "type": {
723
+ "type": "intrinsic",
724
+ "name": "string"
725
+ }
726
+ },
727
+ {
728
+ "id": 44,
729
+ "name": "byteCount",
730
+ "kind": 32768,
731
+ "kindString": "Parameter",
732
+ "flags": {
733
+ "isOptional": true
734
+ },
735
+ "type": {
736
+ "type": "intrinsic",
737
+ "name": "number"
738
+ }
739
+ }
740
+ ],
741
+ "type": {
742
+ "type": "intrinsic",
743
+ "name": "string"
744
+ }
745
+ }
746
+ ]
747
+ }
748
+ ],
749
+ "groups": [
750
+ {
751
+ "title": "Classes",
752
+ "children": [
753
+ 10
754
+ ]
755
+ },
756
+ {
757
+ "title": "Functions",
758
+ "children": [
759
+ 1,
760
+ 5,
761
+ 41
762
+ ]
763
+ }
764
+ ],
765
+ "sources": [
766
+ {
767
+ "fileName": "index.ts",
768
+ "line": 1,
769
+ "character": 0,
770
+ "url": "https://github.com/xylabs/sdk-js/blob/d374ec6/packages/eth-address/src/index.ts#L1"
771
+ }
772
+ ]
773
+ }