UNPKG

25.2 kBHTMLView Raw
1<!DOCTYPE html>
2<html lang="en">
3<head>
4 <meta charset="utf-8">
5 <title>JSDoc: Module: bchaddr</title>
6
7 <script src="scripts/prettify/prettify.js"> </script>
8 <script src="scripts/prettify/lang-css.js"> </script>
9 <!--[if lt IE 9]>
10 <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
11 <![endif]-->
12 <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
13 <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
14</head>
15
16<body>
17
18<div id="main">
19
20 <h1 class="page-title">Module: bchaddr</h1>
21
22
23
24
25
26
27<section>
28
29<header>
30
31
32
33
34
35</header>
36
37<article>
38 <div class="container-overview">
39
40
41 <div class="description">General purpose Bitcoin Cash address detection and translation.<br />
42Supports all major Bitcoin Cash address formats.<br />
43Currently:
44<ul>
45 <li> Legacy format </li>
46 <li> Bitpay format </li>
47 <li> Cashaddr format </li>
48</ul></div>
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68<dl class="details">
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95 <dt class="tag-source">Source:</dt>
96 <dd class="tag-source"><ul class="dummy"><li>
97 <a href="bchaddr.js.html">bchaddr.js</a>, <a href="bchaddr.js.html#line12">line 12</a>
98 </li></ul></dd>
99
100
101
102
103
104
105
106</dl>
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127 </div>
128
129
130
131
132
133
134 <h3 class="subsection-title">Classes</h3>
135
136 <dl>
137 <dt><a href="module-bchaddr-InvalidAddressError.html">InvalidAddressError</a></dt>
138 <dd></dd>
139 </dl>
140
141
142
143
144
145
146
147
148
149 <h3 class="subsection-title">Members</h3>
150
151
152
153<h4 class="name" id=".Format"><span class="type-signature">(static) </span>Format<span class="type-signature"></span></h4>
154
155
156
157
158
159
160
161
162
163
164<dl class="details">
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191 <dt class="tag-source">Source:</dt>
192 <dd class="tag-source"><ul class="dummy"><li>
193 <a href="bchaddr.js.html">bchaddr.js</a>, <a href="bchaddr.js.html#line28">line 28</a>
194 </li></ul></dd>
195
196
197
198
199
200
201
202</dl>
203
204
205
206
207
208
209
210
211<h4 class="name" id=".Network"><span class="type-signature">(static) </span>Network<span class="type-signature"></span></h4>
212
213
214
215
216
217
218
219
220
221
222<dl class="details">
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249 <dt class="tag-source">Source:</dt>
250 <dd class="tag-source"><ul class="dummy"><li>
251 <a href="bchaddr.js.html">bchaddr.js</a>, <a href="bchaddr.js.html#line37">line 37</a>
252 </li></ul></dd>
253
254
255
256
257
258
259
260</dl>
261
262
263
264
265
266
267
268
269<h4 class="name" id=".Type"><span class="type-signature">(static) </span>Type<span class="type-signature"></span></h4>
270
271
272
273
274
275
276
277
278
279
280<dl class="details">
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307 <dt class="tag-source">Source:</dt>
308 <dd class="tag-source"><ul class="dummy"><li>
309 <a href="bchaddr.js.html">bchaddr.js</a>, <a href="bchaddr.js.html#line45">line 45</a>
310 </li></ul></dd>
311
312
313
314
315
316
317
318</dl>
319
320
321
322
323
324
325
326
327
328
329 <h3 class="subsection-title">Methods</h3>
330
331
332
333
334
335
336
337 <h4 class="name" id=".detectAddressFormat"><span class="type-signature">(static) </span>detectAddressFormat<span class="signature">(address)</span><span class="type-signature"> &rarr; {string}</span></h4>
338
339
340
341
342
343
344<div class="description">
345 Detects what is the given address' format.
346</div>
347
348
349
350
351
352
353
354
355
356 <h5>Parameters:</h5>
357
358
359<table class="params">
360 <thead>
361 <tr>
362
363 <th>Name</th>
364
365
366 <th>Type</th>
367
368
369
370
371
372 <th class="last">Description</th>
373 </tr>
374 </thead>
375
376 <tbody>
377
378
379 <tr>
380
381 <td class="name"><code>address</code></td>
382
383
384 <td class="type">
385
386
387<span class="param-type">string</span>
388
389
390
391 </td>
392
393
394
395
396
397 <td class="description last">A valid Bitcoin Cash address in any format.</td>
398 </tr>
399
400
401 </tbody>
402</table>
403
404
405
406
407
408
409<dl class="details">
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436 <dt class="tag-source">Source:</dt>
437 <dd class="tag-source"><ul class="dummy"><li>
438 <a href="bchaddr.js.html">bchaddr.js</a>, <a href="bchaddr.js.html#line56">line 56</a>
439 </li></ul></dd>
440
441
442
443
444
445
446
447</dl>
448
449
450
451
452
453
454
455
456
457
458
459<h5>Throws:</h5>
460
461
462
463 <div class="param-desc">
464
465
466<span class="param-type">InvalidAddressError</span>
467
468
469
470 </div>
471
472
473
474
475
476<h5>Returns:</h5>
477
478
479
480
481<dl>
482 <dt>
483 Type
484 </dt>
485 <dd>
486
487<span class="param-type">string</span>
488
489
490 </dd>
491</dl>
492
493
494
495
496
497
498
499
500
501
502
503
504
505 <h4 class="name" id=".detectAddressNetwork"><span class="type-signature">(static) </span>detectAddressNetwork<span class="signature">(address)</span><span class="type-signature"> &rarr; {string}</span></h4>
506
507
508
509
510
511
512<div class="description">
513 Detects what is the given address' network.
514</div>
515
516
517
518
519
520
521
522
523
524 <h5>Parameters:</h5>
525
526
527<table class="params">
528 <thead>
529 <tr>
530
531 <th>Name</th>
532
533
534 <th>Type</th>
535
536
537
538
539
540 <th class="last">Description</th>
541 </tr>
542 </thead>
543
544 <tbody>
545
546
547 <tr>
548
549 <td class="name"><code>address</code></td>
550
551
552 <td class="type">
553
554
555<span class="param-type">string</span>
556
557
558
559 </td>
560
561
562
563
564
565 <td class="description last">A valid Bitcoin Cash address in any format.</td>
566 </tr>
567
568
569 </tbody>
570</table>
571
572
573
574
575
576
577<dl class="details">
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604 <dt class="tag-source">Source:</dt>
605 <dd class="tag-source"><ul class="dummy"><li>
606 <a href="bchaddr.js.html">bchaddr.js</a>, <a href="bchaddr.js.html#line67">line 67</a>
607 </li></ul></dd>
608
609
610
611
612
613
614
615</dl>
616
617
618
619
620
621
622
623
624
625
626
627<h5>Throws:</h5>
628
629
630
631 <div class="param-desc">
632
633
634<span class="param-type">InvalidAddressError</span>
635
636
637
638 </div>
639
640
641
642
643
644<h5>Returns:</h5>
645
646
647
648
649<dl>
650 <dt>
651 Type
652 </dt>
653 <dd>
654
655<span class="param-type">string</span>
656
657
658 </dd>
659</dl>
660
661
662
663
664
665
666
667
668
669
670
671
672
673 <h4 class="name" id=".detectAddressType"><span class="type-signature">(static) </span>detectAddressType<span class="signature">(address)</span><span class="type-signature"> &rarr; {string}</span></h4>
674
675
676
677
678
679
680<div class="description">
681 Detects what is the given address' type.
682</div>
683
684
685
686
687
688
689
690
691
692 <h5>Parameters:</h5>
693
694
695<table class="params">
696 <thead>
697 <tr>
698
699 <th>Name</th>
700
701
702 <th>Type</th>
703
704
705
706
707
708 <th class="last">Description</th>
709 </tr>
710 </thead>
711
712 <tbody>
713
714
715 <tr>
716
717 <td class="name"><code>address</code></td>
718
719
720 <td class="type">
721
722
723<span class="param-type">string</span>
724
725
726
727 </td>
728
729
730
731
732
733 <td class="description last">A valid Bitcoin Cash address in any format.</td>
734 </tr>
735
736
737 </tbody>
738</table>
739
740
741
742
743
744
745<dl class="details">
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772 <dt class="tag-source">Source:</dt>
773 <dd class="tag-source"><ul class="dummy"><li>
774 <a href="bchaddr.js.html">bchaddr.js</a>, <a href="bchaddr.js.html#line78">line 78</a>
775 </li></ul></dd>
776
777
778
779
780
781
782
783</dl>
784
785
786
787
788
789
790
791
792
793
794
795<h5>Throws:</h5>
796
797
798
799 <div class="param-desc">
800
801
802<span class="param-type">InvalidAddressError</span>
803
804
805
806 </div>
807
808
809
810
811
812<h5>Returns:</h5>
813
814
815
816
817<dl>
818 <dt>
819 Type
820 </dt>
821 <dd>
822
823<span class="param-type">string</span>
824
825
826 </dd>
827</dl>
828
829
830
831
832
833
834
835
836
837
838
839
840
841 <h4 class="name" id=".isBitpayAddress"><span class="type-signature">(static) </span>isBitpayAddress<span class="signature">(address)</span><span class="type-signature"> &rarr; {boolean}</span></h4>
842
843
844
845
846
847
848<div class="description">
849 Returns a boolean indicating whether the address is in bitpay format.
850</div>
851
852
853
854
855
856
857
858
859
860 <h5>Parameters:</h5>
861
862
863<table class="params">
864 <thead>
865 <tr>
866
867 <th>Name</th>
868
869
870 <th>Type</th>
871
872
873
874
875
876 <th class="last">Description</th>
877 </tr>
878 </thead>
879
880 <tbody>
881
882
883 <tr>
884
885 <td class="name"><code>address</code></td>
886
887
888 <td class="type">
889
890
891<span class="param-type">string</span>
892
893
894
895 </td>
896
897
898
899
900
901 <td class="description last">A valid Bitcoin Cash address in any format.</td>
902 </tr>
903
904
905 </tbody>
906</table>
907
908
909
910
911
912
913<dl class="details">
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940 <dt class="tag-source">Source:</dt>
941 <dd class="tag-source"><ul class="dummy"><li>
942 <a href="bchaddr.js.html">bchaddr.js</a>, <a href="bchaddr.js.html#line346">line 346</a>
943 </li></ul></dd>
944
945
946
947
948
949
950
951</dl>
952
953
954
955
956
957
958
959
960
961
962
963<h5>Throws:</h5>
964
965
966
967 <div class="param-desc">
968
969
970<span class="param-type">InvalidAddressError</span>
971
972
973
974 </div>
975
976
977
978
979
980<h5>Returns:</h5>
981
982
983
984
985<dl>
986 <dt>
987 Type
988 </dt>
989 <dd>
990
991<span class="param-type">boolean</span>
992
993
994 </dd>
995</dl>
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009 <h4 class="name" id=".isCashAddress"><span class="type-signature">(static) </span>isCashAddress<span class="signature">(address)</span><span class="type-signature"> &rarr; {boolean}</span></h4>
1010
1011
1012
1013
1014
1015
1016<div class="description">
1017 Returns a boolean indicating whether the address is in cashaddr format.
1018</div>
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028 <h5>Parameters:</h5>
1029
1030
1031<table class="params">
1032 <thead>
1033 <tr>
1034
1035 <th>Name</th>
1036
1037
1038 <th>Type</th>
1039
1040
1041
1042
1043
1044 <th class="last">Description</th>
1045 </tr>
1046 </thead>
1047
1048 <tbody>
1049
1050
1051 <tr>
1052
1053 <td class="name"><code>address</code></td>
1054
1055
1056 <td class="type">
1057
1058
1059<span class="param-type">string</span>
1060
1061
1062
1063 </td>
1064
1065
1066
1067
1068
1069 <td class="description last">A valid Bitcoin Cash address in any format.</td>
1070 </tr>
1071
1072
1073 </tbody>
1074</table>
1075
1076
1077
1078
1079
1080
1081<dl class="details">
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108 <dt class="tag-source">Source:</dt>
1109 <dd class="tag-source"><ul class="dummy"><li>
1110 <a href="bchaddr.js.html">bchaddr.js</a>, <a href="bchaddr.js.html#line357">line 357</a>
1111 </li></ul></dd>
1112
1113
1114
1115
1116
1117
1118
1119</dl>
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131<h5>Throws:</h5>
1132
1133
1134
1135 <div class="param-desc">
1136
1137
1138<span class="param-type">InvalidAddressError</span>
1139
1140
1141
1142 </div>
1143
1144
1145
1146
1147
1148<h5>Returns:</h5>
1149
1150
1151
1152
1153<dl>
1154 <dt>
1155 Type
1156 </dt>
1157 <dd>
1158
1159<span class="param-type">boolean</span>
1160
1161
1162 </dd>
1163</dl>
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177 <h4 class="name" id=".isLegacyAddress"><span class="type-signature">(static) </span>isLegacyAddress<span class="signature">(address)</span><span class="type-signature"> &rarr; {boolean}</span></h4>
1178
1179
1180
1181
1182
1183
1184<div class="description">
1185 Returns a boolean indicating whether the address is in legacy format.
1186</div>
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196 <h5>Parameters:</h5>
1197
1198
1199<table class="params">
1200 <thead>
1201 <tr>
1202
1203 <th>Name</th>
1204
1205
1206 <th>Type</th>
1207
1208
1209
1210
1211
1212 <th class="last">Description</th>
1213 </tr>
1214 </thead>
1215
1216 <tbody>
1217
1218
1219 <tr>
1220
1221 <td class="name"><code>address</code></td>
1222
1223
1224 <td class="type">
1225
1226
1227<span class="param-type">string</span>
1228
1229
1230
1231 </td>
1232
1233
1234
1235
1236
1237 <td class="description last">A valid Bitcoin Cash address in any format.</td>
1238 </tr>
1239
1240
1241 </tbody>
1242</table>
1243
1244
1245
1246
1247
1248
1249<dl class="details">
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276 <dt class="tag-source">Source:</dt>
1277 <dd class="tag-source"><ul class="dummy"><li>
1278 <a href="bchaddr.js.html">bchaddr.js</a>, <a href="bchaddr.js.html#line335">line 335</a>
1279 </li></ul></dd>
1280
1281
1282
1283
1284
1285
1286
1287</dl>
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299<h5>Throws:</h5>
1300
1301
1302
1303 <div class="param-desc">
1304
1305
1306<span class="param-type">InvalidAddressError</span>
1307
1308
1309
1310 </div>
1311
1312
1313
1314
1315
1316<h5>Returns:</h5>
1317
1318
1319
1320
1321<dl>
1322 <dt>
1323 Type
1324 </dt>
1325 <dd>
1326
1327<span class="param-type">boolean</span>
1328
1329
1330 </dd>
1331</dl>
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345 <h4 class="name" id=".isMainnetAddress"><span class="type-signature">(static) </span>isMainnetAddress<span class="signature">(address)</span><span class="type-signature"> &rarr; {boolean}</span></h4>
1346
1347
1348
1349
1350
1351
1352<div class="description">
1353 Returns a boolean indicating whether the address is a mainnet address.
1354</div>
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364 <h5>Parameters:</h5>
1365
1366
1367<table class="params">
1368 <thead>
1369 <tr>
1370
1371 <th>Name</th>
1372
1373
1374 <th>Type</th>
1375
1376
1377
1378
1379
1380 <th class="last">Description</th>
1381 </tr>
1382 </thead>
1383
1384 <tbody>
1385
1386
1387 <tr>
1388
1389 <td class="name"><code>address</code></td>
1390
1391
1392 <td class="type">
1393
1394
1395<span class="param-type">string</span>
1396
1397
1398
1399 </td>
1400
1401
1402
1403
1404
1405 <td class="description last">A valid Bitcoin Cash address in any format.</td>
1406 </tr>
1407
1408
1409 </tbody>
1410</table>
1411
1412
1413
1414
1415
1416
1417<dl class="details">
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444 <dt class="tag-source">Source:</dt>
1445 <dd class="tag-source"><ul class="dummy"><li>
1446 <a href="bchaddr.js.html">bchaddr.js</a>, <a href="bchaddr.js.html#line368">line 368</a>
1447 </li></ul></dd>
1448
1449
1450
1451
1452
1453
1454
1455</dl>
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467<h5>Throws:</h5>
1468
1469
1470
1471 <div class="param-desc">
1472
1473
1474<span class="param-type">InvalidAddressError</span>
1475
1476
1477
1478 </div>
1479
1480
1481
1482
1483
1484<h5>Returns:</h5>
1485
1486
1487
1488
1489<dl>
1490 <dt>
1491 Type
1492 </dt>
1493 <dd>
1494
1495<span class="param-type">boolean</span>
1496
1497
1498 </dd>
1499</dl>
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513 <h4 class="name" id=".isP2PKHAddress"><span class="type-signature">(static) </span>isP2PKHAddress<span class="signature">(address)</span><span class="type-signature"> &rarr; {boolean}</span></h4>
1514
1515
1516
1517
1518
1519
1520<div class="description">
1521 Returns a boolean indicating whether the address is a p2pkh address.
1522</div>
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532 <h5>Parameters:</h5>
1533
1534
1535<table class="params">
1536 <thead>
1537 <tr>
1538
1539 <th>Name</th>
1540
1541
1542 <th>Type</th>
1543
1544
1545
1546
1547
1548 <th class="last">Description</th>
1549 </tr>
1550 </thead>
1551
1552 <tbody>
1553
1554
1555 <tr>
1556
1557 <td class="name"><code>address</code></td>
1558
1559
1560 <td class="type">
1561
1562
1563<span class="param-type">string</span>
1564
1565
1566
1567 </td>
1568
1569
1570
1571
1572
1573 <td class="description last">A valid Bitcoin Cash address in any format.</td>
1574 </tr>
1575
1576
1577 </tbody>
1578</table>
1579
1580
1581
1582
1583
1584
1585<dl class="details">
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612 <dt class="tag-source">Source:</dt>
1613 <dd class="tag-source"><ul class="dummy"><li>
1614 <a href="bchaddr.js.html">bchaddr.js</a>, <a href="bchaddr.js.html#line390">line 390</a>
1615 </li></ul></dd>
1616
1617
1618
1619
1620
1621
1622
1623</dl>
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635<h5>Throws:</h5>
1636
1637
1638
1639 <div class="param-desc">
1640
1641
1642<span class="param-type">InvalidAddressError</span>
1643
1644
1645
1646 </div>
1647
1648
1649
1650
1651
1652<h5>Returns:</h5>
1653
1654
1655
1656
1657<dl>
1658 <dt>
1659 Type
1660 </dt>
1661 <dd>
1662
1663<span class="param-type">boolean</span>
1664
1665
1666 </dd>
1667</dl>
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681 <h4 class="name" id=".isP2SHAddress"><span class="type-signature">(static) </span>isP2SHAddress<span class="signature">(address)</span><span class="type-signature"> &rarr; {boolean}</span></h4>
1682
1683
1684
1685
1686
1687
1688<div class="description">
1689 Returns a boolean indicating whether the address is a p2sh address.
1690</div>
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700 <h5>Parameters:</h5>
1701
1702
1703<table class="params">
1704 <thead>
1705 <tr>
1706
1707 <th>Name</th>
1708
1709
1710 <th>Type</th>
1711
1712
1713
1714
1715
1716 <th class="last">Description</th>
1717 </tr>
1718 </thead>
1719
1720 <tbody>
1721
1722
1723 <tr>
1724
1725 <td class="name"><code>address</code></td>
1726
1727
1728 <td class="type">
1729
1730
1731<span class="param-type">string</span>
1732
1733
1734
1735 </td>
1736
1737
1738
1739
1740
1741 <td class="description last">A valid Bitcoin Cash address in any format.</td>
1742 </tr>
1743
1744
1745 </tbody>
1746</table>
1747
1748
1749
1750
1751
1752
1753<dl class="details">
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780 <dt class="tag-source">Source:</dt>
1781 <dd class="tag-source"><ul class="dummy"><li>
1782 <a href="bchaddr.js.html">bchaddr.js</a>, <a href="bchaddr.js.html#line401">line 401</a>
1783 </li></ul></dd>
1784
1785
1786
1787
1788
1789
1790
1791</dl>
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803<h5>Throws:</h5>
1804
1805
1806
1807 <div class="param-desc">
1808
1809
1810<span class="param-type">InvalidAddressError</span>
1811
1812
1813
1814 </div>
1815
1816
1817
1818
1819
1820<h5>Returns:</h5>
1821
1822
1823
1824
1825<dl>
1826 <dt>
1827 Type
1828 </dt>
1829 <dd>
1830
1831<span class="param-type">boolean</span>
1832
1833
1834 </dd>
1835</dl>
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849 <h4 class="name" id=".isTestnetAddress"><span class="type-signature">(static) </span>isTestnetAddress<span class="signature">(address)</span><span class="type-signature"> &rarr; {boolean}</span></h4>
1850
1851
1852
1853
1854
1855
1856<div class="description">
1857 Returns a boolean indicating whether the address is a testnet address.
1858</div>
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868 <h5>Parameters:</h5>
1869
1870
1871<table class="params">
1872 <thead>
1873 <tr>
1874
1875 <th>Name</th>
1876
1877
1878 <th>Type</th>
1879
1880
1881
1882
1883
1884 <th class="last">Description</th>
1885 </tr>
1886 </thead>
1887
1888 <tbody>
1889
1890
1891 <tr>
1892
1893 <td class="name"><code>address</code></td>
1894
1895
1896 <td class="type">
1897
1898
1899<span class="param-type">string</span>
1900
1901
1902
1903 </td>
1904
1905
1906
1907
1908
1909 <td class="description last">A valid Bitcoin Cash address in any format.</td>
1910 </tr>
1911
1912
1913 </tbody>
1914</table>
1915
1916
1917
1918
1919
1920
1921<dl class="details">
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948 <dt class="tag-source">Source:</dt>
1949 <dd class="tag-source"><ul class="dummy"><li>
1950 <a href="bchaddr.js.html">bchaddr.js</a>, <a href="bchaddr.js.html#line379">line 379</a>
1951 </li></ul></dd>
1952
1953
1954
1955
1956
1957
1958
1959</dl>
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971<h5>Throws:</h5>
1972
1973
1974
1975 <div class="param-desc">
1976
1977
1978<span class="param-type">InvalidAddressError</span>
1979
1980
1981
1982 </div>
1983
1984
1985
1986
1987
1988<h5>Returns:</h5>
1989
1990
1991
1992
1993<dl>
1994 <dt>
1995 Type
1996 </dt>
1997 <dd>
1998
1999<span class="param-type">boolean</span>
2000
2001
2002 </dd>
2003</dl>
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017 <h4 class="name" id=".toBitpayAddress"><span class="type-signature">(static) </span>toBitpayAddress<span class="signature">(address)</span><span class="type-signature"> &rarr; {string}</span></h4>
2018
2019
2020
2021
2022
2023
2024<div class="description">
2025 Translates the given address into bitpay format.
2026</div>
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036 <h5>Parameters:</h5>
2037
2038
2039<table class="params">
2040 <thead>
2041 <tr>
2042
2043 <th>Name</th>
2044
2045
2046 <th>Type</th>
2047
2048
2049
2050
2051
2052 <th class="last">Description</th>
2053 </tr>
2054 </thead>
2055
2056 <tbody>
2057
2058
2059 <tr>
2060
2061 <td class="name"><code>address</code></td>
2062
2063
2064 <td class="type">
2065
2066
2067<span class="param-type">string</span>
2068
2069
2070
2071 </td>
2072
2073
2074
2075
2076
2077 <td class="description last">A valid Bitcoin Cash address in any format.</td>
2078 </tr>
2079
2080
2081 </tbody>
2082</table>
2083
2084
2085
2086
2087
2088
2089<dl class="details">
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116 <dt class="tag-source">Source:</dt>
2117 <dd class="tag-source"><ul class="dummy"><li>
2118 <a href="bchaddr.js.html">bchaddr.js</a>, <a href="bchaddr.js.html#line104">line 104</a>
2119 </li></ul></dd>
2120
2121
2122
2123
2124
2125
2126
2127</dl>
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139<h5>Throws:</h5>
2140
2141
2142
2143 <div class="param-desc">
2144
2145
2146<span class="param-type">InvalidAddressError</span>
2147
2148
2149
2150 </div>
2151
2152
2153
2154
2155
2156<h5>Returns:</h5>
2157
2158
2159
2160
2161<dl>
2162 <dt>
2163 Type
2164 </dt>
2165 <dd>
2166
2167<span class="param-type">string</span>
2168
2169
2170 </dd>
2171</dl>
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185 <h4 class="name" id=".toCashAddress"><span class="type-signature">(static) </span>toCashAddress<span class="signature">(address)</span><span class="type-signature"> &rarr; {string}</span></h4>
2186
2187
2188
2189
2190
2191
2192<div class="description">
2193 Translates the given address into cashaddr format.
2194</div>
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204 <h5>Parameters:</h5>
2205
2206
2207<table class="params">
2208 <thead>
2209 <tr>
2210
2211 <th>Name</th>
2212
2213
2214 <th>Type</th>
2215
2216
2217
2218
2219
2220 <th class="last">Description</th>
2221 </tr>
2222 </thead>
2223
2224 <tbody>
2225
2226
2227 <tr>
2228
2229 <td class="name"><code>address</code></td>
2230
2231
2232 <td class="type">
2233
2234
2235<span class="param-type">string</span>
2236
2237
2238
2239 </td>
2240
2241
2242
2243
2244
2245 <td class="description last">A valid Bitcoin Cash address in any format.</td>
2246 </tr>
2247
2248
2249 </tbody>
2250</table>
2251
2252
2253
2254
2255
2256
2257<dl class="details">
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284 <dt class="tag-source">Source:</dt>
2285 <dd class="tag-source"><ul class="dummy"><li>
2286 <a href="bchaddr.js.html">bchaddr.js</a>, <a href="bchaddr.js.html#line119">line 119</a>
2287 </li></ul></dd>
2288
2289
2290
2291
2292
2293
2294
2295</dl>
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307<h5>Throws:</h5>
2308
2309
2310
2311 <div class="param-desc">
2312
2313
2314<span class="param-type">InvalidAddressError</span>
2315
2316
2317
2318 </div>
2319
2320
2321
2322
2323
2324<h5>Returns:</h5>
2325
2326
2327
2328
2329<dl>
2330 <dt>
2331 Type
2332 </dt>
2333 <dd>
2334
2335<span class="param-type">string</span>
2336
2337
2338 </dd>
2339</dl>
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353 <h4 class="name" id=".toLegacyAddress"><span class="type-signature">(static) </span>toLegacyAddress<span class="signature">(address)</span><span class="type-signature"> &rarr; {string}</span></h4>
2354
2355
2356
2357
2358
2359
2360<div class="description">
2361 Translates the given address into legacy format.
2362</div>
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372 <h5>Parameters:</h5>
2373
2374
2375<table class="params">
2376 <thead>
2377 <tr>
2378
2379 <th>Name</th>
2380
2381
2382 <th>Type</th>
2383
2384
2385
2386
2387
2388 <th class="last">Description</th>
2389 </tr>
2390 </thead>
2391
2392 <tbody>
2393
2394
2395 <tr>
2396
2397 <td class="name"><code>address</code></td>
2398
2399
2400 <td class="type">
2401
2402
2403<span class="param-type">string</span>
2404
2405
2406
2407 </td>
2408
2409
2410
2411
2412
2413 <td class="description last">A valid Bitcoin Cash address in any format.</td>
2414 </tr>
2415
2416
2417 </tbody>
2418</table>
2419
2420
2421
2422
2423
2424
2425<dl class="details">
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452 <dt class="tag-source">Source:</dt>
2453 <dd class="tag-source"><ul class="dummy"><li>
2454 <a href="bchaddr.js.html">bchaddr.js</a>, <a href="bchaddr.js.html#line89">line 89</a>
2455 </li></ul></dd>
2456
2457
2458
2459
2460
2461
2462
2463</dl>
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475<h5>Throws:</h5>
2476
2477
2478
2479 <div class="param-desc">
2480
2481
2482<span class="param-type">InvalidAddressError</span>
2483
2484
2485
2486 </div>
2487
2488
2489
2490
2491
2492<h5>Returns:</h5>
2493
2494
2495
2496
2497<dl>
2498 <dt>
2499 Type
2500 </dt>
2501 <dd>
2502
2503<span class="param-type">string</span>
2504
2505
2506 </dd>
2507</dl>
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521</article>
2522
2523</section>
2524
2525
2526
2527
2528</div>
2529
2530<nav>
2531 <h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-bchaddr.html">bchaddr</a></li></ul><h3>Classes</h3><ul><li><a href="module-bchaddr-InvalidAddressError.html">InvalidAddressError</a></li></ul>
2532</nav>
2533
2534<br class="clear">
2535
2536<footer>
2537 Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Jan 17 2018 20:22:59 GMT-0300 (-03)
2538</footer>
2539
2540<script> prettyPrint(); </script>
2541<script src="scripts/linenumber.js"> </script>
2542</body>
2543</html>
\No newline at end of file