├── README.md ├── build.xml ├── manifest.mf ├── nbproject ├── build-impl.xml ├── genfiles.properties ├── project.properties └── project.xml └── src ├── Classes └── Web3Handler.java ├── Frames ├── MainFrame.form ├── MainFrame.java ├── WalletLogin.form └── WalletLogin.java ├── Json └── UTC--2017-08-21T11-49-30.013Z--8c17ea160c092ae854f81580396ba570d9e62e24.json └── Sources └── miranz-logo.png /README.md: -------------------------------------------------------------------------------- 1 | # Web3j-Java-Wallet-Swing-Framework-Ethereum-Client\ 2 | 3 | We have developed a basic decenterlized wallet of ethereum using web3j as a ethereum client on java Swing framework. It has just basic functionality discuss below. 4 | 5 | # Getting Started 6 | Its a basic ethereum wallet made for learning purpopse. 7 | ## Functionality 8 | 9 | 1. You can generate new UTC-JSON file or new wallet. 10 | 2. You can login to your created wallet or existing wallet. 11 | 3. You can connect to any four major ethereum blockchain networks (Rinkeby, Kovan, Ropsten, Main-Net). 12 | 4. You can transfer funds from your ethereum address to another ethereum address. 13 | 5. You can get Gas Price, Block Hash aand Block number on every transaction you perform. 14 | 15 | ## Interface 16 | Main Wallet 17 | ![walletmain](https://user-images.githubusercontent.com/30287193/29768767-f3e61716-8c00-11e7-9fb7-75dee3b39097.PNG) 18 | 19 | ## Dependencies 20 | You need to install some libraries to run this Web3j in your project and you must have IDE like netbeans or eclipse to open this project. 21 | 1. core-2.3.0.jar 22 | 2. bcprov-jdk15on-158.jar 23 | 3. bouncycastle.jar 24 | 4. com.fasterxml.jackson.core.jar 25 | 5. com.fasterxml.jackson.databind.jar 26 | 6. commons-codec-1.9.jar 27 | 7. commons-logging-1.2.jar 28 | 8. httpclient-4.5.2.jar 29 | 9. httpcore-4.4.4.jar 30 | 10. jackson-annotations-2.1.2.jar 31 | 11. jackson-core-2.2.3.jar 32 | 12. rxjava-1.1.0.jar 33 | 13. scrypt-1.4.0.jar 34 | 35 | ## Built with 36 | 1. Java 37 | 2. Swing Framework 38 | 3. Netbeans 8.2 39 | 40 | # Acknowledgments 41 | ## Inspiration 42 | 1. Mist Wallet 43 | 2. My Ether Wallet 44 | 45 | ## Support Developer 46 | Donate Some Ether to the Developer. 47 | Ethereum Address : 0x39886D0BFccc74D8CCb21c44534a41eC626620b3 48 | -------------------------------------------------------------------------------- /build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Builds, tests, and runs the project Miranz Wallet. 12 | 13 | 73 | 74 | -------------------------------------------------------------------------------- /manifest.mf: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | X-COMMENT: Main-Class will be added automatically by build 3 | 4 | -------------------------------------------------------------------------------- /nbproject/build-impl.xml: -------------------------------------------------------------------------------- 1 | 2 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 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 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 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 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | Must set src.dir 234 | Must set test.src.dir 235 | Must set build.dir 236 | Must set dist.dir 237 | Must set build.classes.dir 238 | Must set dist.javadoc.dir 239 | Must set build.test.classes.dir 240 | Must set build.test.results.dir 241 | Must set build.classes.excludes 242 | Must set dist.jar 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 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 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | Must set javac.includes 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | 391 | 392 | 393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 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 | 437 | 438 | 439 | 440 | 441 | 442 | 443 | 444 | 445 | 446 | 447 | 448 | 449 | 450 | 451 | 452 | 453 | 454 | 455 | 456 | 457 | 458 | 459 | 460 | 461 | 462 | 463 | 464 | 465 | 466 | 467 | 468 | 469 | 470 | 471 | 472 | No tests executed. 473 | 474 | 475 | 476 | 477 | 478 | 479 | 480 | 481 | 482 | 483 | 484 | 485 | 486 | 487 | 488 | 489 | 490 | 491 | 492 | 493 | 494 | 495 | 496 | 497 | 498 | 499 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 509 | 510 | 511 | 512 | 513 | 514 | 515 | 516 | 517 | 518 | 519 | 520 | 521 | 522 | 523 | 524 | 525 | 526 | 527 | 528 | 529 | 530 | 531 | 532 | 533 | 534 | 535 | 536 | 537 | 538 | 539 | 540 | 541 | 542 | 543 | 544 | 545 | 546 | 547 | 548 | 549 | 550 | 551 | 552 | 553 | 554 | 555 | 556 | 557 | 558 | 559 | 560 | 561 | 562 | 563 | 564 | 565 | 566 | 567 | 568 | 569 | 570 | 571 | 572 | 573 | 574 | 575 | 576 | 577 | 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 | 605 | 606 | 607 | 608 | 609 | 610 | 611 | 612 | 613 | 614 | 615 | 616 | 617 | 618 | 619 | 620 | 621 | 622 | 623 | 624 | 625 | 626 | 627 | 628 | 629 | 630 | 631 | 632 | 633 | 634 | 635 | 636 | 637 | 638 | 639 | 640 | 641 | 642 | 643 | 644 | 645 | 646 | 647 | 648 | 649 | 650 | 651 | 652 | 653 | 654 | 655 | 656 | 657 | 658 | 659 | 660 | 661 | 662 | 663 | 664 | 665 | 666 | 667 | 668 | 669 | 670 | 671 | 672 | 673 | 674 | 675 | 676 | 677 | 680 | 681 | 682 | 683 | 684 | 685 | 686 | 687 | 688 | 689 | 690 | 691 | 692 | 693 | 694 | 695 | 696 | 697 | 698 | 699 | 700 | 701 | 702 | 703 | 704 | 705 | 706 | 707 | 708 | 709 | 710 | 711 | 712 | 713 | 714 | 715 | 716 | 717 | 718 | 719 | 720 | 721 | 722 | Must set JVM to use for profiling in profiler.info.jvm 723 | Must set profiler agent JVM arguments in profiler.info.jvmargs.agent 724 | 725 | 728 | 729 | 730 | 731 | 732 | 733 | 734 | 735 | 736 | 737 | 738 | 739 | 740 | 741 | 742 | 743 | 744 | 745 | 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 | 773 | 774 | 775 | 776 | 777 | 778 | 779 | 780 | 781 | 782 | 783 | 784 | 785 | 786 | 787 | 788 | 789 | 790 | 791 | 792 | 793 | 794 | 795 | 796 | 797 | 798 | 799 | 800 | 801 | 802 | 803 | 804 | 805 | 806 | 807 | 808 | 809 | 810 | 811 | 812 | 813 | 814 | 815 | 816 | 817 | 818 | 819 | 820 | 821 | 822 | 823 | 824 | 825 | 826 | 827 | 828 | 829 | 830 | 831 | 832 | 833 | 834 | 835 | 836 | 837 | 838 | 839 | 840 | 841 | 842 | 843 | 844 | 845 | 846 | 847 | 848 | 849 | 850 | 851 | 852 | 853 | 854 | 855 | 856 | 857 | 858 | 859 | 860 | 861 | 862 | 863 | 864 | 865 | 866 | 867 | 868 | 869 | 870 | 871 | 872 | 873 | 874 | 875 | 876 | 877 | 878 | 879 | 880 | 881 | 882 | 883 | 884 | 885 | 886 | 891 | 892 | 893 | 894 | 895 | 896 | 897 | 898 | 899 | 900 | 901 | 902 | 903 | 904 | 905 | 906 | 907 | 908 | 909 | 910 | 911 | 912 | 913 | 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 | 941 | 942 | 943 | 944 | 945 | 946 | 947 | 948 | 949 | 950 | 951 | Must select some files in the IDE or set javac.includes 952 | 953 | 954 | 955 | 956 | 957 | 958 | 959 | 960 | 965 | 966 | 967 | 968 | 969 | 970 | 971 | 972 | 973 | 974 | 975 | 976 | 977 | 978 | 979 | 980 | 981 | 982 | 983 | 984 | 985 | 986 | 987 | 988 | 989 | 990 | 991 | 992 | 993 | 994 | 995 | 996 | 997 | 998 | 999 | 1000 | 1001 | To run this application from the command line without Ant, try: 1002 | 1003 | java -jar "${dist.jar.resolved}" 1004 | 1005 | 1006 | 1007 | 1008 | 1009 | 1010 | 1011 | 1012 | 1013 | 1014 | 1015 | 1016 | 1017 | 1018 | 1019 | 1020 | 1021 | 1022 | 1023 | 1024 | 1025 | 1026 | 1027 | 1028 | 1029 | 1030 | 1031 | 1032 | 1033 | 1034 | 1039 | 1040 | 1041 | 1042 | 1043 | 1044 | 1045 | 1046 | 1047 | 1048 | 1049 | 1050 | Must select one file in the IDE or set run.class 1051 | 1052 | 1053 | 1054 | Must select one file in the IDE or set run.class 1055 | 1056 | 1057 | 1062 | 1063 | 1064 | 1065 | 1066 | 1067 | 1068 | 1069 | 1070 | 1071 | 1072 | 1073 | 1074 | 1075 | 1076 | 1077 | 1078 | 1079 | 1080 | 1081 | Must select one file in the IDE or set debug.class 1082 | 1083 | 1084 | 1085 | 1086 | Must select one file in the IDE or set debug.class 1087 | 1088 | 1089 | 1090 | 1091 | Must set fix.includes 1092 | 1093 | 1094 | 1095 | 1096 | 1097 | 1098 | 1103 | 1106 | 1107 | This target only works when run from inside the NetBeans IDE. 1108 | 1109 | 1110 | 1111 | 1112 | 1113 | 1114 | 1115 | 1116 | Must select one file in the IDE or set profile.class 1117 | This target only works when run from inside the NetBeans IDE. 1118 | 1119 | 1120 | 1121 | 1122 | 1123 | 1124 | 1125 | 1126 | This target only works when run from inside the NetBeans IDE. 1127 | 1128 | 1129 | 1130 | 1131 | 1132 | 1133 | 1134 | 1135 | 1136 | 1137 | 1138 | 1139 | This target only works when run from inside the NetBeans IDE. 1140 | 1141 | 1142 | 1143 | 1144 | 1145 | 1146 | 1147 | 1148 | 1149 | 1150 | 1151 | 1152 | 1153 | 1154 | 1155 | 1156 | 1157 | 1158 | 1159 | 1160 | 1161 | 1164 | 1165 | 1166 | 1167 | 1168 | 1169 | 1170 | 1171 | 1172 | 1173 | 1174 | 1175 | 1176 | 1177 | Must select one file in the IDE or set run.class 1178 | 1179 | 1180 | 1181 | 1182 | 1183 | Must select some files in the IDE or set test.includes 1184 | 1185 | 1186 | 1187 | 1188 | Must select one file in the IDE or set run.class 1189 | 1190 | 1191 | 1192 | 1193 | Must select one file in the IDE or set applet.url 1194 | 1195 | 1196 | 1197 | 1202 | 1203 | 1204 | 1205 | 1206 | 1207 | 1208 | 1209 | 1210 | 1211 | 1212 | 1213 | 1214 | 1215 | 1216 | 1217 | 1218 | 1219 | 1220 | 1221 | 1222 | 1223 | 1224 | 1225 | 1226 | 1227 | 1228 | 1229 | 1230 | 1231 | 1232 | 1233 | 1234 | 1235 | 1236 | 1237 | 1238 | 1239 | 1240 | 1241 | 1246 | 1247 | 1248 | 1249 | 1250 | 1251 | 1252 | 1253 | 1254 | 1255 | 1256 | 1257 | 1258 | 1259 | 1260 | 1261 | 1262 | 1263 | 1264 | 1265 | 1266 | 1267 | 1268 | 1269 | 1270 | 1271 | 1272 | Must select some files in the IDE or set javac.includes 1273 | 1274 | 1275 | 1276 | 1277 | 1278 | 1279 | 1280 | 1281 | 1282 | 1283 | 1284 | 1289 | 1290 | 1291 | 1292 | 1293 | 1294 | 1295 | 1296 | Some tests failed; see details above. 1297 | 1298 | 1299 | 1300 | 1301 | 1302 | 1303 | 1304 | 1305 | Must select some files in the IDE or set test.includes 1306 | 1307 | 1308 | 1309 | Some tests failed; see details above. 1310 | 1311 | 1312 | 1313 | Must select some files in the IDE or set test.class 1314 | Must select some method in the IDE or set test.method 1315 | 1316 | 1317 | 1318 | Some tests failed; see details above. 1319 | 1320 | 1321 | 1326 | 1327 | Must select one file in the IDE or set test.class 1328 | 1329 | 1330 | 1331 | Must select one file in the IDE or set test.class 1332 | Must select some method in the IDE or set test.method 1333 | 1334 | 1335 | 1336 | 1337 | 1338 | 1339 | 1340 | 1341 | 1342 | 1343 | 1344 | 1349 | 1350 | Must select one file in the IDE or set applet.url 1351 | 1352 | 1353 | 1354 | 1355 | 1356 | 1357 | 1362 | 1363 | Must select one file in the IDE or set applet.url 1364 | 1365 | 1366 | 1367 | 1368 | 1369 | 1370 | 1371 | 1376 | 1377 | 1378 | 1379 | 1380 | 1381 | 1382 | 1383 | 1384 | 1385 | 1386 | 1387 | 1388 | 1389 | 1390 | 1391 | 1392 | 1393 | 1394 | 1395 | 1396 | 1397 | 1398 | 1399 | 1400 | 1401 | 1402 | 1403 | 1404 | 1405 | 1406 | 1407 | 1408 | 1409 | 1410 | 1411 | 1412 | 1413 | 1414 | 1415 | 1416 | 1417 | 1418 | 1419 | 1420 | 1421 | -------------------------------------------------------------------------------- /nbproject/genfiles.properties: -------------------------------------------------------------------------------- 1 | build.xml.data.CRC32=6cbfd674 2 | build.xml.script.CRC32=0e99c18e 3 | build.xml.stylesheet.CRC32=8064a381@1.80.1.48 4 | # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. 5 | # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. 6 | nbproject/build-impl.xml.data.CRC32=6cbfd674 7 | nbproject/build-impl.xml.script.CRC32=c5c33611 8 | nbproject/build-impl.xml.stylesheet.CRC32=830a3534@1.80.1.48 9 | -------------------------------------------------------------------------------- /nbproject/project.properties: -------------------------------------------------------------------------------- 1 | annotation.processing.enabled=true 2 | annotation.processing.enabled.in.editor=false 3 | annotation.processing.processor.options= 4 | annotation.processing.processors.list= 5 | annotation.processing.run.all.processors=true 6 | annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output 7 | build.classes.dir=${build.dir}/classes 8 | build.classes.excludes=**/*.java,**/*.form 9 | # This directory is removed when the project is cleaned: 10 | build.dir=build 11 | build.generated.dir=${build.dir}/generated 12 | build.generated.sources.dir=${build.dir}/generated-sources 13 | # Only compile against the classpath explicitly listed here: 14 | build.sysclasspath=ignore 15 | build.test.classes.dir=${build.dir}/test/classes 16 | build.test.results.dir=${build.dir}/test/results 17 | # Uncomment to specify the preferred debugger connection transport: 18 | #debug.transport=dt_socket 19 | debug.classpath=\ 20 | ${run.classpath} 21 | debug.test.classpath=\ 22 | ${run.test.classpath} 23 | # Files in build.classes.dir which should be excluded from distribution jar 24 | dist.archive.excludes= 25 | # This directory is removed when the project is cleaned: 26 | dist.dir=dist 27 | dist.jar=${dist.dir}/Miranz_Wallet.jar 28 | dist.javadoc.dir=${dist.dir}/javadoc 29 | excludes= 30 | file.reference.bcprov-jdk15on-158.jar=C:\\Users\\mubas\\Desktop\\Used Jars for Web3j\\bcprov-jdk15on-158.jar 31 | file.reference.com.fasterxml.jackson.core.jar=C:\\Users\\mubas\\Desktop\\Used Jars for Web3j\\com.fasterxml.jackson.core.jar 32 | file.reference.com.fasterxml.jackson.databind.jar=C:\\Users\\mubas\\Desktop\\Used Jars for Web3j\\com.fasterxml.jackson.databind.jar 33 | file.reference.commons-codec-1.9.jar=C:\\Users\\mubas\\Desktop\\Used Jars for Web3j\\commons-codec-1.9.jar 34 | file.reference.commons-logging-1.2.jar=C:\\Users\\mubas\\Desktop\\Used Jars for Web3j\\commons-logging-1.2.jar 35 | file.reference.core-2.3.0.jar=C:\\Users\\mubas\\Desktop\\Used Jars for Web3j\\core-2.3.0.jar 36 | file.reference.httpclient-4.5.2.jar=C:\\Users\\mubas\\Desktop\\Used Jars for Web3j\\httpclient-4.5.2.jar 37 | file.reference.httpcore-4.4.4.jar=C:\\Users\\mubas\\Desktop\\Used Jars for Web3j\\httpcore-4.4.4.jar 38 | file.reference.jackson-annotations-2.1.2.jar=C:\\Users\\mubas\\Desktop\\Used Jars for Web3j\\jackson-annotations-2.1.2.jar 39 | file.reference.jackson-core-2.2.3.jar=C:\\Users\\mubas\\Desktop\\Used Jars for Web3j\\jackson-core-2.2.3.jar 40 | file.reference.rxjava-1.1.0.jar=C:\\Users\\mubas\\Desktop\\Used Jars for Web3j\\rxjava-1.1.0.jar 41 | file.reference.scrypt-1.4.0.jar=C:\\Users\\mubas\\Desktop\\Used Jars for Web3j\\scrypt-1.4.0.jar 42 | includes=** 43 | jar.compress=false 44 | javac.classpath=\ 45 | ${file.reference.com.fasterxml.jackson.databind.jar}:\ 46 | ${file.reference.commons-codec-1.9.jar}:\ 47 | ${file.reference.commons-logging-1.2.jar}:\ 48 | ${file.reference.core-2.3.0.jar}:\ 49 | ${file.reference.httpclient-4.5.2.jar}:\ 50 | ${file.reference.httpcore-4.4.4.jar}:\ 51 | ${file.reference.jackson-annotations-2.1.2.jar}:\ 52 | ${file.reference.jackson-core-2.2.3.jar}:\ 53 | ${file.reference.rxjava-1.1.0.jar}:\ 54 | ${file.reference.bcprov-jdk15on-158.jar}:\ 55 | ${file.reference.scrypt-1.4.0.jar}:\ 56 | ${file.reference.com.fasterxml.jackson.core.jar} 57 | # Space-separated list of extra javac options 58 | javac.compilerargs= 59 | javac.deprecation=false 60 | javac.external.vm=true 61 | javac.processorpath=\ 62 | ${javac.classpath} 63 | javac.source=1.8 64 | javac.target=1.8 65 | javac.test.classpath=\ 66 | ${javac.classpath}:\ 67 | ${build.classes.dir} 68 | javac.test.processorpath=\ 69 | ${javac.test.classpath} 70 | javadoc.additionalparam= 71 | javadoc.author=false 72 | javadoc.encoding=${source.encoding} 73 | javadoc.noindex=false 74 | javadoc.nonavbar=false 75 | javadoc.notree=false 76 | javadoc.private=false 77 | javadoc.splitindex=true 78 | javadoc.use=true 79 | javadoc.version=false 80 | javadoc.windowtitle= 81 | main.class=Frames.WalletLogin 82 | manifest.file=manifest.mf 83 | meta.inf.dir=${src.dir}/META-INF 84 | mkdist.disabled=false 85 | platform.active=default_platform 86 | run.classpath=\ 87 | ${javac.classpath}:\ 88 | ${build.classes.dir} 89 | # Space-separated list of JVM arguments used when running the project. 90 | # You may also define separate properties like run-sys-prop.name=value instead of -Dname=value. 91 | # To set system properties for unit tests define test-sys-prop.name=value: 92 | run.jvmargs= 93 | run.test.classpath=\ 94 | ${javac.test.classpath}:\ 95 | ${build.test.classes.dir} 96 | source.encoding=UTF-8 97 | src.dir=src 98 | test.src.dir=test 99 | -------------------------------------------------------------------------------- /nbproject/project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.netbeans.modules.java.j2seproject 4 | 5 | 6 | Miranz Wallet 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/Classes/Web3Handler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * %W% %E% Hamza Yasin 3 | * 4 | * Copyright (c) 2017-2018 Miranz Technology. All Rights Reserved. 5 | * 6 | * This software is the confidential and proprietary information of Miranz 7 | * technology. You shall not disclose such Confidential Information and 8 | * shall use it only in accordance with the terms of the license agreement 9 | * you entered into with Miranz. 10 | * 11 | */ 12 | 13 | 14 | package Classes; 15 | 16 | import java.io.File; 17 | import java.io.IOException; 18 | import java.math.BigDecimal; 19 | import java.math.BigInteger; 20 | import java.security.InvalidAlgorithmParameterException; 21 | import java.security.NoSuchAlgorithmException; 22 | import java.security.NoSuchProviderException; 23 | import java.util.concurrent.ExecutionException; 24 | import java.util.concurrent.Future; 25 | import org.web3j.crypto.CipherException; 26 | import org.web3j.crypto.Credentials; 27 | import org.web3j.crypto.WalletUtils; 28 | import org.web3j.protocol.Web3j; 29 | import org.web3j.protocol.core.DefaultBlockParameterName; 30 | import org.web3j.protocol.core.methods.response.EthGetBalance; 31 | import org.web3j.protocol.core.methods.response.TransactionReceipt; 32 | import org.web3j.protocol.exceptions.TransactionTimeoutException; 33 | import org.web3j.protocol.http.HttpService; 34 | import org.web3j.tx.Transfer; 35 | import org.web3j.utils.Convert; 36 | 37 | /** 38 | * This class is written for basic functions of Ethereum and web3j integration 39 | * Because it's handling all the basic function of web3j so that's why we named 40 | * it as a web3Handler. 41 | * 42 | * @version 1.10 25 Aug 2017 43 | * @author Hamza Yasin 44 | */ 45 | 46 | public class Web3Handler { 47 | /** String variable 'network' is used for selecting which network you want to use*/ 48 | public static String network; 49 | /** Web3j variable 'web3' is used to implement all the functions, exist in Web3j Library*/ 50 | public static Web3j web3; 51 | /** Credentials variable 'credentials' is used to implement all the functions, exist in Credentials Library*/ 52 | public static Credentials credentials; 53 | /** 54 | * web3Connection function is used to create the connection with the end-client node. // I uses Infura API. 55 | * @param string is used to concatenate the address of network connected with the API. 56 | * @return 57 | */ 58 | public static boolean web3Connection(String string){ 59 | web3 = Web3j.build(new HttpService("https://" + string + ".infura.io/wrtnuPnxYVCkCoeWWzs1")); 60 | return web3 != null; 61 | } 62 | /** 63 | * loadCredentials function is used to load the UTC-JSON file from a particular path. 64 | * @param password is used to access your UTC-JSON file. 65 | * @param path is used to give a path where your UTC-JSON file is located. 66 | * @throws IOException 67 | * @throws CipherException 68 | */ 69 | public static void loadCredentials(String password, String path) throws IOException, CipherException { 70 | credentials = WalletUtils.loadCredentials(password, path); 71 | } 72 | /** 73 | * generateWallet function is used to generate the UTC-JSON file against a particular password on static path (Here it is Desktop). 74 | * @param password is used to access your UTC-JSON file. 75 | * @throws IOException 76 | * @throws CipherException 77 | * @throws InvalidAlgorithmParameterException 78 | * @throws NoSuchAlgorithmException 79 | * @throws NoSuchProviderException 80 | */ 81 | public static void generateWallet(String password) throws IOException, CipherException, InvalidAlgorithmParameterException, NoSuchAlgorithmException, NoSuchProviderException { 82 | WalletUtils.generateFullNewWalletFile(password, new File("C:\\Users\\mubas\\Desktop")); 83 | } 84 | /** 85 | * transaction function is used to send funds from your address to another Ethereum address. 86 | * @param address is a TO address or a address where you want to transfer funds. 87 | * @param amount is a amount you want to send. 88 | * @throws TransactionTimeoutException 89 | * @throws IOException 90 | * @throws InterruptedException 91 | * @return 92 | */ 93 | public static TransactionReceipt transaction(String address, double amount) throws InterruptedException, IOException, TransactionTimeoutException { 94 | return Transfer.sendFunds( web3, credentials, address, BigDecimal.valueOf(amount), Convert.Unit.ETHER); 95 | } 96 | /** 97 | * getBalance function is used to get Balance and it returns the BigInteger value. 98 | * @throws InterruptedException 99 | * @throws ExecutionException 100 | * @return 101 | */ 102 | public static BigInteger getBalance() throws InterruptedException, ExecutionException{ 103 | Future ethGetBalanceFuture = web3.ethGetBalance(credentials.getAddress(), DefaultBlockParameterName.LATEST).sendAsync(); 104 | return ethGetBalanceFuture.get().getBalance(); 105 | } 106 | 107 | } -------------------------------------------------------------------------------- /src/Frames/MainFrame.form: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 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 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 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 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 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 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 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 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | 391 | 392 | 393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 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 | 437 | 438 | 439 | 440 | 441 | 442 | 443 | 444 | 445 | 446 | 447 | 448 | 449 | 450 | 451 | 452 | 453 | 454 | 455 | 456 | 457 | 458 | 459 | -------------------------------------------------------------------------------- /src/Frames/MainFrame.java: -------------------------------------------------------------------------------- 1 | /* 2 | * %W% %E% Hamza Yasin 3 | * 4 | * Copyright (c) 2017-2018 Miranz Technology. All Rights Reserved. 5 | * 6 | * This software is the confidential and proprietary information of Miranz 7 | * technology. You shall not disclose such Confidential Information and 8 | * shall use it only in accordance with the terms of the license agreement 9 | * you entered into with Miranz. 10 | * 11 | */ 12 | 13 | 14 | package Frames; 15 | 16 | import Classes.Web3Handler; 17 | import java.io.IOException; 18 | import java.math.BigDecimal; 19 | import java.util.concurrent.ExecutionException; 20 | import javax.swing.JOptionPane; 21 | import org.web3j.protocol.core.methods.response.TransactionReceipt; 22 | import org.web3j.protocol.exceptions.TransactionTimeoutException; 23 | import org.web3j.utils.Convert; 24 | 25 | /** 26 | * This class/Frame is written for basic functions of Ethereum and web3j integration 27 | * Because it's integrating the main functions of web3handling class so we called 28 | * it as a MainFrame. 29 | * 30 | * @version 1.10 25 Aug 2017 31 | * @author Hamza Yasin 32 | */ 33 | 34 | 35 | public class MainFrame extends javax.swing.JFrame { 36 | 37 | public MainFrame() throws InterruptedException, ExecutionException { 38 | initComponents(); 39 | 40 | networkLabel.setText(Web3Handler.network); 41 | AddressResult.setText(Web3Handler.credentials.getAddress()); 42 | fromAddressField.setText(Web3Handler.credentials.getAddress()); 43 | EthereReult.setText( Convert.toWei(Web3Handler.getBalance()+"", Convert.Unit.WEI).divide(new BigDecimal("1000000000000000000")).toString() ); 44 | 45 | 46 | } 47 | 48 | 49 | 50 | @SuppressWarnings("unchecked") 51 | // //GEN-BEGIN:initComponents 52 | private void initComponents() { 53 | 54 | MainPannel = new javax.swing.JPanel(); 55 | TitlePannel = new javax.swing.JPanel(); 56 | WalletTitle = new javax.swing.JLabel(); 57 | jPanel1 = new javax.swing.JPanel(); 58 | AddressTitle = new javax.swing.JLabel(); 59 | EthereReult = new javax.swing.JLabel(); 60 | EthereTitle = new javax.swing.JLabel(); 61 | AddressResult = new javax.swing.JLabel(); 62 | EthereTitle1 = new javax.swing.JLabel(); 63 | networkLabel = new javax.swing.JLabel(); 64 | jLabel1 = new javax.swing.JLabel(); 65 | LogoPannel = new javax.swing.JPanel(); 66 | LogoLabel = new javax.swing.JLabel(); 67 | BodyPannel = new javax.swing.JPanel(); 68 | fromAddressField = new javax.swing.JTextField(); 69 | jLabel2 = new javax.swing.JLabel(); 70 | toAddressField = new javax.swing.JTextField(); 71 | jLabel3 = new javax.swing.JLabel(); 72 | amountField = new javax.swing.JTextField(); 73 | jLabel4 = new javax.swing.JLabel(); 74 | jScrollPane1 = new javax.swing.JScrollPane(); 75 | transactionArea = new javax.swing.JTextArea(); 76 | jLabel5 = new javax.swing.JLabel(); 77 | sendButton = new javax.swing.JButton(); 78 | noteLabel = new javax.swing.JLabel(); 79 | jSeparator1 = new javax.swing.JSeparator(); 80 | 81 | setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); 82 | setTitle("Miranz Wallet"); 83 | setBackground(new java.awt.Color(51, 51, 51)); 84 | setResizable(false); 85 | 86 | MainPannel.setBackground(new java.awt.Color(255, 255, 255)); 87 | 88 | TitlePannel.setBackground(new java.awt.Color(255, 255, 255)); 89 | TitlePannel.setToolTipText(""); 90 | 91 | WalletTitle.setFont(new java.awt.Font("Trebuchet MS", 0, 48)); // NOI18N 92 | WalletTitle.setForeground(new java.awt.Color(0, 153, 204)); 93 | WalletTitle.setText("Miranz Wallet"); 94 | 95 | jPanel1.setBackground(new java.awt.Color(255, 255, 255)); 96 | 97 | AddressTitle.setFont(new java.awt.Font("Segoe UI Historic", 0, 13)); // NOI18N 98 | AddressTitle.setForeground(new java.awt.Color(51, 51, 51)); 99 | AddressTitle.setText("Address:"); 100 | 101 | EthereReult.setFont(new java.awt.Font("Segoe UI Historic", 0, 13)); // NOI18N 102 | 103 | EthereTitle.setFont(new java.awt.Font("Segoe UI Historic", 0, 13)); // NOI18N 104 | EthereTitle.setForeground(new java.awt.Color(51, 51, 51)); 105 | EthereTitle.setText("Ethere: "); 106 | 107 | AddressResult.setFont(new java.awt.Font("Segoe UI Historic", 0, 13)); // NOI18N 108 | 109 | EthereTitle1.setFont(new java.awt.Font("Segoe UI Historic", 0, 13)); // NOI18N 110 | EthereTitle1.setForeground(new java.awt.Color(51, 51, 51)); 111 | EthereTitle1.setText("Network:"); 112 | 113 | networkLabel.setFont(new java.awt.Font("Segoe UI Historic", 0, 13)); // NOI18N 114 | 115 | javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); 116 | jPanel1.setLayout(jPanel1Layout); 117 | jPanel1Layout.setHorizontalGroup( 118 | jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 119 | .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() 120 | .addContainerGap(121, Short.MAX_VALUE) 121 | .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 122 | .addComponent(EthereTitle1) 123 | .addComponent(EthereTitle) 124 | .addComponent(AddressTitle)) 125 | .addGap(18, 18, 18) 126 | .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 127 | .addComponent(EthereReult) 128 | .addComponent(networkLabel) 129 | .addComponent(AddressResult)) 130 | .addGap(86, 86, 86)) 131 | ); 132 | jPanel1Layout.setVerticalGroup( 133 | jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 134 | .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() 135 | .addGap(0, 0, Short.MAX_VALUE) 136 | .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) 137 | .addComponent(AddressTitle) 138 | .addComponent(AddressResult)) 139 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 140 | .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) 141 | .addComponent(EthereReult) 142 | .addComponent(EthereTitle)) 143 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 144 | .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 145 | .addComponent(EthereTitle1) 146 | .addComponent(networkLabel))) 147 | ); 148 | 149 | jLabel1.setFont(new java.awt.Font("Segoe UI Light", 0, 13)); // NOI18N 150 | jLabel1.setText(" Pakistan's First Blockchain experts solution providers"); 151 | 152 | javax.swing.GroupLayout TitlePannelLayout = new javax.swing.GroupLayout(TitlePannel); 153 | TitlePannel.setLayout(TitlePannelLayout); 154 | TitlePannelLayout.setHorizontalGroup( 155 | TitlePannelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 156 | .addGroup(TitlePannelLayout.createSequentialGroup() 157 | .addContainerGap(211, Short.MAX_VALUE) 158 | .addGroup(TitlePannelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) 159 | .addComponent(WalletTitle, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 160 | .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 294, javax.swing.GroupLayout.PREFERRED_SIZE)) 161 | .addGap(92, 92, 92) 162 | .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) 163 | .addContainerGap()) 164 | ); 165 | TitlePannelLayout.setVerticalGroup( 166 | TitlePannelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 167 | .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, TitlePannelLayout.createSequentialGroup() 168 | .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 169 | .addContainerGap()) 170 | .addGroup(TitlePannelLayout.createSequentialGroup() 171 | .addContainerGap() 172 | .addComponent(WalletTitle, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE) 173 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 174 | .addComponent(jLabel1) 175 | .addContainerGap(19, Short.MAX_VALUE)) 176 | ); 177 | 178 | LogoPannel.setBackground(new java.awt.Color(255, 255, 255)); 179 | 180 | LogoLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Sources/miranz-logo.png"))); // NOI18N 181 | 182 | javax.swing.GroupLayout LogoPannelLayout = new javax.swing.GroupLayout(LogoPannel); 183 | LogoPannel.setLayout(LogoPannelLayout); 184 | LogoPannelLayout.setHorizontalGroup( 185 | LogoPannelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 186 | .addGroup(LogoPannelLayout.createSequentialGroup() 187 | .addContainerGap() 188 | .addComponent(LogoLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 127, javax.swing.GroupLayout.PREFERRED_SIZE) 189 | .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 190 | ); 191 | LogoPannelLayout.setVerticalGroup( 192 | LogoPannelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 193 | .addGroup(LogoPannelLayout.createSequentialGroup() 194 | .addContainerGap() 195 | .addComponent(LogoLabel) 196 | .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 197 | ); 198 | 199 | fromAddressField.setEditable(false); 200 | fromAddressField.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N 201 | 202 | jLabel2.setFont(new java.awt.Font("Segoe UI Historic", 0, 14)); // NOI18N 203 | jLabel2.setText("From (Address):"); 204 | 205 | toAddressField.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N 206 | 207 | jLabel3.setFont(new java.awt.Font("Segoe UI Historic", 0, 14)); // NOI18N 208 | jLabel3.setText("To (Address):"); 209 | 210 | amountField.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N 211 | 212 | jLabel4.setFont(new java.awt.Font("Segoe UI Historic", 0, 14)); // NOI18N 213 | jLabel4.setText("Amount (Either):"); 214 | 215 | transactionArea.setEditable(false); 216 | transactionArea.setColumns(20); 217 | transactionArea.setRows(5); 218 | jScrollPane1.setViewportView(transactionArea); 219 | 220 | jLabel5.setFont(new java.awt.Font("Segoe UI Historic", 0, 14)); // NOI18N 221 | jLabel5.setText("Transaction Result:"); 222 | 223 | sendButton.setBackground(new java.awt.Color(255, 255, 255)); 224 | sendButton.setFont(new java.awt.Font("Segoe UI Historic", 0, 14)); // NOI18N 225 | sendButton.setText("Send Funds"); 226 | sendButton.addActionListener(new java.awt.event.ActionListener() { 227 | public void actionPerformed(java.awt.event.ActionEvent evt) { 228 | sendButtonActionPerformed(evt); 229 | } 230 | }); 231 | 232 | noteLabel.setFont(new java.awt.Font("Segoe UI Light", 0, 14)); // NOI18N 233 | noteLabel.setText("Note : You can only send either from one account to another. "); 234 | 235 | javax.swing.GroupLayout BodyPannelLayout = new javax.swing.GroupLayout(BodyPannel); 236 | BodyPannel.setLayout(BodyPannelLayout); 237 | BodyPannelLayout.setHorizontalGroup( 238 | BodyPannelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 239 | .addGroup(BodyPannelLayout.createSequentialGroup() 240 | .addGap(84, 84, 84) 241 | .addGroup(BodyPannelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 242 | .addGroup(BodyPannelLayout.createSequentialGroup() 243 | .addGroup(BodyPannelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) 244 | .addComponent(amountField, javax.swing.GroupLayout.Alignment.LEADING) 245 | .addComponent(toAddressField, javax.swing.GroupLayout.Alignment.LEADING) 246 | .addComponent(fromAddressField) 247 | .addGroup(BodyPannelLayout.createSequentialGroup() 248 | .addGap(0, 0, Short.MAX_VALUE) 249 | .addComponent(sendButton, javax.swing.GroupLayout.PREFERRED_SIZE, 113, javax.swing.GroupLayout.PREFERRED_SIZE))) 250 | .addGap(73, 73, 73)) 251 | .addGroup(BodyPannelLayout.createSequentialGroup() 252 | .addGroup(BodyPannelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 253 | .addComponent(jLabel3) 254 | .addComponent(jLabel2) 255 | .addComponent(jLabel4)) 256 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))) 257 | .addGroup(BodyPannelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 258 | .addComponent(jLabel5) 259 | .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 369, javax.swing.GroupLayout.PREFERRED_SIZE)) 260 | .addGap(138, 138, 138)) 261 | .addGroup(BodyPannelLayout.createSequentialGroup() 262 | .addGap(75, 75, 75) 263 | .addComponent(noteLabel) 264 | .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 265 | ); 266 | BodyPannelLayout.setVerticalGroup( 267 | BodyPannelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 268 | .addGroup(BodyPannelLayout.createSequentialGroup() 269 | .addGap(94, 94, 94) 270 | .addGroup(BodyPannelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) 271 | .addComponent(jLabel2) 272 | .addComponent(jLabel5)) 273 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 274 | .addGroup(BodyPannelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 275 | .addGroup(BodyPannelLayout.createSequentialGroup() 276 | .addComponent(fromAddressField, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) 277 | .addGap(18, 18, 18) 278 | .addComponent(jLabel3) 279 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 280 | .addComponent(toAddressField, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) 281 | .addGap(26, 26, 26) 282 | .addComponent(jLabel4) 283 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 284 | .addComponent(amountField, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) 285 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) 286 | .addComponent(sendButton) 287 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 288 | .addComponent(noteLabel)) 289 | .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 245, javax.swing.GroupLayout.PREFERRED_SIZE)) 290 | .addContainerGap(74, Short.MAX_VALUE)) 291 | ); 292 | 293 | javax.swing.GroupLayout MainPannelLayout = new javax.swing.GroupLayout(MainPannel); 294 | MainPannel.setLayout(MainPannelLayout); 295 | MainPannelLayout.setHorizontalGroup( 296 | MainPannelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 297 | .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, MainPannelLayout.createSequentialGroup() 298 | .addComponent(LogoPannel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) 299 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 300 | .addComponent(TitlePannel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 301 | .addComponent(jSeparator1) 302 | .addComponent(BodyPannel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 303 | ); 304 | MainPannelLayout.setVerticalGroup( 305 | MainPannelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 306 | .addGroup(MainPannelLayout.createSequentialGroup() 307 | .addGroup(MainPannelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 308 | .addComponent(LogoPannel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) 309 | .addComponent(TitlePannel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) 310 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 311 | .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 4, javax.swing.GroupLayout.PREFERRED_SIZE) 312 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 313 | .addComponent(BodyPannel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) 314 | .addGap(22, 22, 22)) 315 | ); 316 | 317 | javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); 318 | getContentPane().setLayout(layout); 319 | layout.setHorizontalGroup( 320 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 321 | .addGroup(layout.createSequentialGroup() 322 | .addComponent(MainPannel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 323 | .addContainerGap()) 324 | ); 325 | layout.setVerticalGroup( 326 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 327 | .addComponent(MainPannel, javax.swing.GroupLayout.PREFERRED_SIZE, 514, javax.swing.GroupLayout.PREFERRED_SIZE) 328 | ); 329 | 330 | pack(); 331 | setLocationRelativeTo(null); 332 | }// //GEN-END:initComponents 333 | 334 | private void sendButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_sendButtonActionPerformed 335 | try { 336 | TransactionReceipt trans = Web3Handler.transaction(toAddressField.getText(), Double.parseDouble(amountField.getText())); 337 | noteLabel.setText("Funds Transfer."); 338 | transactionArea.setText("Block Hash: " + trans.getBlockHash() 339 | + "\nBlock Number: " + trans.getBlockNumber() 340 | + "\nGas used: " + trans.getGasUsed()); 341 | EthereReult.setText(Convert.toWei(Web3Handler.getBalance() 342 | + "", Convert.Unit.WEI).divide(new BigDecimal("1000000000000000000")).toString() ); 343 | } catch (IOException | InterruptedException | NumberFormatException | ExecutionException | TransactionTimeoutException ex) { 344 | JOptionPane.showMessageDialog(null, ex.getMessage()); 345 | } 346 | }//GEN-LAST:event_sendButtonActionPerformed 347 | 348 | // Variables declaration - do not modify//GEN-BEGIN:variables 349 | private javax.swing.JLabel AddressResult; 350 | private javax.swing.JLabel AddressTitle; 351 | private javax.swing.JPanel BodyPannel; 352 | private javax.swing.JLabel EthereReult; 353 | private javax.swing.JLabel EthereTitle; 354 | private javax.swing.JLabel EthereTitle1; 355 | private javax.swing.JLabel LogoLabel; 356 | private javax.swing.JPanel LogoPannel; 357 | private javax.swing.JPanel MainPannel; 358 | private javax.swing.JPanel TitlePannel; 359 | private javax.swing.JLabel WalletTitle; 360 | private javax.swing.JTextField amountField; 361 | private javax.swing.JTextField fromAddressField; 362 | private javax.swing.JLabel jLabel1; 363 | private javax.swing.JLabel jLabel2; 364 | private javax.swing.JLabel jLabel3; 365 | private javax.swing.JLabel jLabel4; 366 | private javax.swing.JLabel jLabel5; 367 | private javax.swing.JPanel jPanel1; 368 | private javax.swing.JScrollPane jScrollPane1; 369 | private javax.swing.JSeparator jSeparator1; 370 | private javax.swing.JLabel networkLabel; 371 | private javax.swing.JLabel noteLabel; 372 | private javax.swing.JButton sendButton; 373 | private javax.swing.JTextField toAddressField; 374 | private javax.swing.JTextArea transactionArea; 375 | // End of variables declaration//GEN-END:variables 376 | } 377 | -------------------------------------------------------------------------------- /src/Frames/WalletLogin.form: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 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 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 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 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 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 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 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 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | 391 | 392 | 393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 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 | 437 | 438 | 439 | 440 | 441 | 442 | 443 | 444 | 445 | 446 | 447 | 448 | 449 | 450 | 451 | 452 | 453 | 454 | 455 | 456 | 457 | 458 | 459 | 460 | 461 | 462 | 463 | 464 | 465 | 466 | 467 | 468 | 469 | 470 | 471 | 472 | 473 | 474 | 475 | 476 | 477 | 478 | 479 | 480 | 481 | 482 | 483 | 484 | 485 | 486 | 487 | 488 | 489 | 490 | 491 | 492 | 493 | 494 | 495 | 496 | 497 | 498 | 499 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 509 | 510 | 511 | 512 | 513 | 514 | 515 | 516 | 517 | 518 | 519 | 520 | 521 | 522 | 523 | 524 | 525 | 526 | 527 | 528 | 529 | 530 | 531 | 532 | 533 | 534 | 535 | 536 | 537 | 538 | 539 | 540 | 541 | 542 | 543 | 544 | 545 | 546 | 547 | -------------------------------------------------------------------------------- /src/Frames/WalletLogin.java: -------------------------------------------------------------------------------- 1 | /* 2 | * %W% %E% Hamza Yasin 3 | * 4 | * Copyright (c) 2017-2018 Miranz Technology. All Rights Reserved. 5 | * 6 | * This software is the confidential and proprietary information of Miranz 7 | * technology. You shall not disclose such Confidential Information and 8 | * shall use it only in accordance with the terms of the license agreement 9 | * you entered into with Miranz. 10 | * 11 | */ 12 | 13 | 14 | package Frames; 15 | 16 | import Classes.Web3Handler; 17 | import java.awt.Color; 18 | import java.awt.HeadlessException; 19 | import java.io.IOException; 20 | import java.security.InvalidAlgorithmParameterException; 21 | import java.security.NoSuchAlgorithmException; 22 | import java.security.NoSuchProviderException; 23 | import java.util.concurrent.ExecutionException; 24 | import javax.swing.JFileChooser; 25 | import javax.swing.JOptionPane; 26 | import javax.swing.filechooser.FileNameExtensionFilter; 27 | import org.web3j.crypto.CipherException; 28 | 29 | 30 | /** 31 | * This class/Frame is written for basic functions of Ethereum and web3j integration 32 | * Because it's integrating the Login Credentials functions of web3handling class so we called 33 | * it as a WalletLogin. 34 | * 35 | * @version 1.10 25 Aug 2017 36 | * @author Hamza Yasin 37 | */ 38 | 39 | 40 | public class WalletLogin extends javax.swing.JFrame { 41 | 42 | 43 | public WalletLogin() { 44 | initComponents(); 45 | } 46 | 47 | 48 | @SuppressWarnings("unchecked") 49 | // //GEN-BEGIN:initComponents 50 | private void initComponents() { 51 | 52 | MainPannel = new javax.swing.JPanel(); 53 | TitlePannel = new javax.swing.JPanel(); 54 | walletTitle = new javax.swing.JLabel(); 55 | sloganLabel = new javax.swing.JLabel(); 56 | LogoPannel = new javax.swing.JPanel(); 57 | LogoLabel = new javax.swing.JLabel(); 58 | jTabbedPane2 = new javax.swing.JTabbedPane(); 59 | jPanel1 = new javax.swing.JPanel(); 60 | jLabel3 = new javax.swing.JLabel(); 61 | importButton = new javax.swing.JButton(); 62 | jLabel4 = new javax.swing.JLabel(); 63 | loginButton = new javax.swing.JButton(); 64 | noteLabel = new javax.swing.JLabel(); 65 | jLabel6 = new javax.swing.JLabel(); 66 | connectButton = new javax.swing.JButton(); 67 | jPanel4 = new javax.swing.JPanel(); 68 | fileField = new javax.swing.JTextField(); 69 | jPanel3 = new javax.swing.JPanel(); 70 | passField = new javax.swing.JPasswordField(); 71 | jPanel5 = new javax.swing.JPanel(); 72 | connectionBox = new javax.swing.JComboBox<>(); 73 | jPanel2 = new javax.swing.JPanel(); 74 | generateButton = new javax.swing.JButton(); 75 | jLabel1 = new javax.swing.JLabel(); 76 | passwordField = new javax.swing.JPasswordField(); 77 | noteStatusLabel = new javax.swing.JLabel(); 78 | notify = new javax.swing.JLabel(); 79 | 80 | setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); 81 | setTitle("Login"); 82 | setName("LoginFrame"); // NOI18N 83 | setResizable(false); 84 | 85 | MainPannel.setBackground(new java.awt.Color(255, 255, 255)); 86 | 87 | TitlePannel.setBackground(new java.awt.Color(255, 255, 255)); 88 | TitlePannel.setToolTipText(""); 89 | 90 | walletTitle.setFont(new java.awt.Font("Trebuchet MS", 0, 48)); // NOI18N 91 | walletTitle.setForeground(new java.awt.Color(0, 153, 204)); 92 | walletTitle.setText("Miranz Wallet"); 93 | 94 | sloganLabel.setFont(new java.awt.Font("Segoe UI Light", 0, 13)); // NOI18N 95 | sloganLabel.setText(" Pakistan's First Blockchain experts solution providers"); 96 | 97 | javax.swing.GroupLayout TitlePannelLayout = new javax.swing.GroupLayout(TitlePannel); 98 | TitlePannel.setLayout(TitlePannelLayout); 99 | TitlePannelLayout.setHorizontalGroup( 100 | TitlePannelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 101 | .addGroup(TitlePannelLayout.createSequentialGroup() 102 | .addGap(37, 37, 37) 103 | .addGroup(TitlePannelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) 104 | .addComponent(sloganLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 105 | .addComponent(walletTitle, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 106 | .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 107 | ); 108 | TitlePannelLayout.setVerticalGroup( 109 | TitlePannelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 110 | .addGroup(TitlePannelLayout.createSequentialGroup() 111 | .addContainerGap() 112 | .addComponent(walletTitle, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE) 113 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 114 | .addComponent(sloganLabel) 115 | .addContainerGap()) 116 | ); 117 | 118 | LogoPannel.setBackground(new java.awt.Color(255, 255, 255)); 119 | 120 | LogoLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Sources/miranz-logo.png"))); // NOI18N 121 | 122 | javax.swing.GroupLayout LogoPannelLayout = new javax.swing.GroupLayout(LogoPannel); 123 | LogoPannel.setLayout(LogoPannelLayout); 124 | LogoPannelLayout.setHorizontalGroup( 125 | LogoPannelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 126 | .addGroup(LogoPannelLayout.createSequentialGroup() 127 | .addContainerGap() 128 | .addComponent(LogoLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 127, javax.swing.GroupLayout.PREFERRED_SIZE) 129 | .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 130 | ); 131 | LogoPannelLayout.setVerticalGroup( 132 | LogoPannelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 133 | .addGroup(LogoPannelLayout.createSequentialGroup() 134 | .addContainerGap() 135 | .addComponent(LogoLabel) 136 | .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 137 | ); 138 | 139 | jTabbedPane2.setBackground(new java.awt.Color(255, 255, 255)); 140 | 141 | jPanel1.setBackground(new java.awt.Color(255, 255, 255)); 142 | 143 | jLabel3.setFont(new java.awt.Font("Segoe UI Light", 0, 14)); // NOI18N 144 | jLabel3.setText("Please input UTC-JSON file:"); 145 | 146 | importButton.setBackground(new java.awt.Color(255, 255, 255)); 147 | importButton.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N 148 | importButton.setText("Import"); 149 | importButton.addActionListener(new java.awt.event.ActionListener() { 150 | public void actionPerformed(java.awt.event.ActionEvent evt) { 151 | importButtonActionPerformed(evt); 152 | } 153 | }); 154 | 155 | jLabel4.setFont(new java.awt.Font("Segoe UI Light", 0, 14)); // NOI18N 156 | jLabel4.setText("Please input your password:"); 157 | 158 | loginButton.setBackground(new java.awt.Color(255, 255, 255)); 159 | loginButton.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N 160 | loginButton.setText("Login"); 161 | loginButton.addActionListener(new java.awt.event.ActionListener() { 162 | public void actionPerformed(java.awt.event.ActionEvent evt) { 163 | loginButtonActionPerformed(evt); 164 | } 165 | }); 166 | 167 | noteLabel.setFont(new java.awt.Font("Segoe UI Light", 0, 14)); // NOI18N 168 | noteLabel.setText("Note : UTC-JSON file and password is neccessory to login your account. "); 169 | 170 | jLabel6.setFont(new java.awt.Font("Segoe UI Light", 0, 14)); // NOI18N 171 | jLabel6.setText("Please choose your network:"); 172 | 173 | connectButton.setBackground(new java.awt.Color(255, 255, 255)); 174 | connectButton.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N 175 | connectButton.setText("Connect"); 176 | connectButton.addActionListener(new java.awt.event.ActionListener() { 177 | public void actionPerformed(java.awt.event.ActionEvent evt) { 178 | connectButtonActionPerformed(evt); 179 | } 180 | }); 181 | 182 | jPanel4.setBackground(new java.awt.Color(255, 255, 255)); 183 | 184 | jPanel3.setBackground(new java.awt.Color(255, 255, 255)); 185 | 186 | javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3); 187 | jPanel3.setLayout(jPanel3Layout); 188 | jPanel3Layout.setHorizontalGroup( 189 | jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 190 | .addGroup(jPanel3Layout.createSequentialGroup() 191 | .addComponent(passField, javax.swing.GroupLayout.PREFERRED_SIZE, 225, javax.swing.GroupLayout.PREFERRED_SIZE) 192 | .addGap(0, 0, Short.MAX_VALUE)) 193 | ); 194 | jPanel3Layout.setVerticalGroup( 195 | jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 196 | .addGroup(jPanel3Layout.createSequentialGroup() 197 | .addContainerGap() 198 | .addComponent(passField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) 199 | .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 200 | ); 201 | 202 | javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4); 203 | jPanel4.setLayout(jPanel4Layout); 204 | jPanel4Layout.setHorizontalGroup( 205 | jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 206 | .addGroup(jPanel4Layout.createSequentialGroup() 207 | .addComponent(fileField, javax.swing.GroupLayout.PREFERRED_SIZE, 225, javax.swing.GroupLayout.PREFERRED_SIZE) 208 | .addGap(0, 1, Short.MAX_VALUE)) 209 | .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup() 210 | .addGap(0, 0, Short.MAX_VALUE) 211 | .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) 212 | ); 213 | jPanel4Layout.setVerticalGroup( 214 | jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 215 | .addGroup(jPanel4Layout.createSequentialGroup() 216 | .addComponent(fileField, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE) 217 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 218 | .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE) 219 | .addGap(0, 0, Short.MAX_VALUE)) 220 | ); 221 | 222 | jPanel5.setBackground(new java.awt.Color(255, 255, 255)); 223 | 224 | connectionBox.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Mainnet", "Ropsten", "Kovan", "Rinkeby" })); 225 | 226 | javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5); 227 | jPanel5.setLayout(jPanel5Layout); 228 | jPanel5Layout.setHorizontalGroup( 229 | jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 230 | .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup() 231 | .addComponent(connectionBox, 0, 225, Short.MAX_VALUE) 232 | .addContainerGap()) 233 | ); 234 | jPanel5Layout.setVerticalGroup( 235 | jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 236 | .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup() 237 | .addGap(0, 11, Short.MAX_VALUE) 238 | .addComponent(connectionBox, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE)) 239 | ); 240 | 241 | javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); 242 | jPanel1.setLayout(jPanel1Layout); 243 | jPanel1Layout.setHorizontalGroup( 244 | jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 245 | .addGroup(jPanel1Layout.createSequentialGroup() 246 | .addContainerGap() 247 | .addComponent(noteLabel) 248 | .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 249 | .addGroup(jPanel1Layout.createSequentialGroup() 250 | .addGap(61, 61, 61) 251 | .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) 252 | .addGroup(jPanel1Layout.createSequentialGroup() 253 | .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) 254 | .addGroup(jPanel1Layout.createSequentialGroup() 255 | .addComponent(jLabel3) 256 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)) 257 | .addGroup(jPanel1Layout.createSequentialGroup() 258 | .addComponent(jLabel4) 259 | .addGap(10, 10, 10))) 260 | .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) 261 | .addGroup(jPanel1Layout.createSequentialGroup() 262 | .addComponent(jLabel6) 263 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 264 | .addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) 265 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 73, Short.MAX_VALUE) 266 | .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) 267 | .addComponent(importButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 268 | .addComponent(loginButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 269 | .addComponent(connectButton)) 270 | .addGap(35, 35, 35)) 271 | ); 272 | jPanel1Layout.setVerticalGroup( 273 | jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 274 | .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() 275 | .addContainerGap() 276 | .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 277 | .addGroup(jPanel1Layout.createSequentialGroup() 278 | .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) 279 | .addComponent(jLabel6) 280 | .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) 281 | .addGap(13, 13, 13) 282 | .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 283 | .addGroup(jPanel1Layout.createSequentialGroup() 284 | .addComponent(jLabel3) 285 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) 286 | .addComponent(jLabel4)) 287 | .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) 288 | .addGroup(jPanel1Layout.createSequentialGroup() 289 | .addGap(14, 14, 14) 290 | .addComponent(connectButton, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE) 291 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) 292 | .addComponent(importButton, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE) 293 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) 294 | .addComponent(loginButton, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE))) 295 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 35, Short.MAX_VALUE) 296 | .addComponent(noteLabel) 297 | .addContainerGap()) 298 | ); 299 | 300 | jTabbedPane2.addTab("Login", jPanel1); 301 | 302 | jPanel2.setBackground(new java.awt.Color(255, 255, 255)); 303 | 304 | generateButton.setBackground(new java.awt.Color(255, 255, 255)); 305 | generateButton.setText("Generate"); 306 | generateButton.addActionListener(new java.awt.event.ActionListener() { 307 | public void actionPerformed(java.awt.event.ActionEvent evt) { 308 | generateButtonActionPerformed(evt); 309 | } 310 | }); 311 | 312 | jLabel1.setFont(new java.awt.Font("Verdana", 0, 14)); // NOI18N 313 | jLabel1.setText("Enter Password"); 314 | 315 | noteStatusLabel.setFont(new java.awt.Font("Segoe UI Light", 0, 14)); // NOI18N 316 | noteStatusLabel.setText("Note : Your UTC-JSON file will be saved on Desktop."); 317 | 318 | javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); 319 | jPanel2.setLayout(jPanel2Layout); 320 | jPanel2Layout.setHorizontalGroup( 321 | jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 322 | .addGroup(jPanel2Layout.createSequentialGroup() 323 | .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 324 | .addGroup(jPanel2Layout.createSequentialGroup() 325 | .addGap(252, 252, 252) 326 | .addComponent(jLabel1)) 327 | .addGroup(jPanel2Layout.createSequentialGroup() 328 | .addContainerGap() 329 | .addComponent(noteStatusLabel)) 330 | .addGroup(jPanel2Layout.createSequentialGroup() 331 | .addGap(244, 244, 244) 332 | .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) 333 | .addComponent(passwordField) 334 | .addComponent(generateButton, javax.swing.GroupLayout.DEFAULT_SIZE, 128, Short.MAX_VALUE) 335 | .addComponent(notify, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))) 336 | .addContainerGap(283, Short.MAX_VALUE)) 337 | ); 338 | jPanel2Layout.setVerticalGroup( 339 | jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 340 | .addGroup(jPanel2Layout.createSequentialGroup() 341 | .addGap(32, 32, 32) 342 | .addComponent(jLabel1) 343 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 344 | .addComponent(passwordField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) 345 | .addGap(4, 4, 4) 346 | .addComponent(generateButton) 347 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 348 | .addComponent(notify, javax.swing.GroupLayout.PREFERRED_SIZE, 15, javax.swing.GroupLayout.PREFERRED_SIZE) 349 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 27, Short.MAX_VALUE) 350 | .addComponent(noteStatusLabel) 351 | .addContainerGap()) 352 | ); 353 | 354 | jTabbedPane2.addTab("Generate New", jPanel2); 355 | 356 | javax.swing.GroupLayout MainPannelLayout = new javax.swing.GroupLayout(MainPannel); 357 | MainPannel.setLayout(MainPannelLayout); 358 | MainPannelLayout.setHorizontalGroup( 359 | MainPannelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 360 | .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, MainPannelLayout.createSequentialGroup() 361 | .addComponent(LogoPannel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) 362 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 363 | .addComponent(TitlePannel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 364 | .addComponent(jTabbedPane2) 365 | ); 366 | MainPannelLayout.setVerticalGroup( 367 | MainPannelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 368 | .addGroup(MainPannelLayout.createSequentialGroup() 369 | .addGroup(MainPannelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) 370 | .addComponent(LogoPannel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 371 | .addComponent(TitlePannel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) 372 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 373 | .addComponent(jTabbedPane2)) 374 | ); 375 | 376 | javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); 377 | getContentPane().setLayout(layout); 378 | layout.setHorizontalGroup( 379 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 380 | .addComponent(MainPannel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 381 | ); 382 | layout.setVerticalGroup( 383 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 384 | .addComponent(MainPannel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 385 | ); 386 | 387 | pack(); 388 | setLocationRelativeTo(null); 389 | }// //GEN-END:initComponents 390 | 391 | private void generateButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_generateButtonActionPerformed 392 | 393 | notify.setText("Please Wait,Processing!"); 394 | notify.setForeground(Color.YELLOW); 395 | new Thread(() -> { 396 | try{ 397 | Web3Handler.generateWallet(passwordField.getText()); 398 | notify.setText("Process is Completed!"); 399 | notify.setForeground(Color.GREEN); 400 | JOptionPane.showMessageDialog(null,"File Generated on the Desktop."); 401 | }catch( HeadlessException | IOException | InvalidAlgorithmParameterException | NoSuchAlgorithmException | NoSuchProviderException | CipherException e) 402 | { 403 | JOptionPane.showMessageDialog(null, e.getMessage()); 404 | } 405 | }).start(); 406 | 407 | 408 | 409 | }//GEN-LAST:event_generateButtonActionPerformed 410 | 411 | private void importButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_importButtonActionPerformed 412 | 413 | JFileChooser chooser = new JFileChooser(); 414 | FileNameExtensionFilter filter = new FileNameExtensionFilter( "json", "JSON"); 415 | chooser.setFileFilter(filter); 416 | int returnVal = chooser.showOpenDialog(null); 417 | if(returnVal == JFileChooser.APPROVE_OPTION) { 418 | 419 | noteLabel.setText("You chose: " + chooser.getSelectedFile().getName()); 420 | fileField.setText(chooser.getSelectedFile().getAbsolutePath()); 421 | 422 | } 423 | 424 | 425 | }//GEN-LAST:event_importButtonActionPerformed 426 | 427 | private void loginButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_loginButtonActionPerformed 428 | try { 429 | Web3Handler.loadCredentials(passField.getText(), fileField.getText()); 430 | this.setVisible(false); 431 | MainFrame main = new MainFrame(); 432 | main.setVisible(true); 433 | } catch (IOException | InterruptedException | ExecutionException | CipherException ex) { 434 | noteLabel.setText(ex.getMessage()); 435 | } 436 | }//GEN-LAST:event_loginButtonActionPerformed 437 | 438 | private void connectButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_connectButtonActionPerformed 439 | if(Web3Handler.web3Connection(connectionBox.getSelectedItem().toString().toLowerCase())){ 440 | Web3Handler.network = connectionBox.getSelectedItem().toString(); 441 | status(); 442 | } 443 | else { 444 | noteLabel.setText("Please Connect with the network first."); 445 | notify.setForeground(Color.RED); 446 | } 447 | }//GEN-LAST:event_connectButtonActionPerformed 448 | 449 | private void status(){ 450 | noteLabel.setText("Connected." + connectionBox.getSelectedItem().toString()); 451 | notify.setForeground(Color.GREEN); 452 | } 453 | public static void main(String args[]) { 454 | 455 | java.awt.EventQueue.invokeLater(() -> { 456 | new WalletLogin().setVisible(true); 457 | }); 458 | } 459 | 460 | // Variables declaration - do not modify//GEN-BEGIN:variables 461 | private javax.swing.JLabel LogoLabel; 462 | private javax.swing.JPanel LogoPannel; 463 | private javax.swing.JPanel MainPannel; 464 | private javax.swing.JPanel TitlePannel; 465 | private javax.swing.JButton connectButton; 466 | private javax.swing.JComboBox connectionBox; 467 | private javax.swing.JTextField fileField; 468 | private javax.swing.JButton generateButton; 469 | private javax.swing.JButton importButton; 470 | private javax.swing.JLabel jLabel1; 471 | private javax.swing.JLabel jLabel3; 472 | private javax.swing.JLabel jLabel4; 473 | private javax.swing.JLabel jLabel6; 474 | private javax.swing.JPanel jPanel1; 475 | private javax.swing.JPanel jPanel2; 476 | private javax.swing.JPanel jPanel3; 477 | private javax.swing.JPanel jPanel4; 478 | private javax.swing.JPanel jPanel5; 479 | private javax.swing.JTabbedPane jTabbedPane2; 480 | private javax.swing.JButton loginButton; 481 | private javax.swing.JLabel noteLabel; 482 | private javax.swing.JLabel noteStatusLabel; 483 | private javax.swing.JLabel notify; 484 | private javax.swing.JPasswordField passField; 485 | private javax.swing.JPasswordField passwordField; 486 | private javax.swing.JLabel sloganLabel; 487 | private javax.swing.JLabel walletTitle; 488 | // End of variables declaration//GEN-END:variables 489 | } 490 | -------------------------------------------------------------------------------- /src/Json/UTC--2017-08-21T11-49-30.013Z--8c17ea160c092ae854f81580396ba570d9e62e24.json: -------------------------------------------------------------------------------- 1 | {"version":3,"id":"f294a597-aac6-4628-b157-ebcdeabb062f","address":"8c17ea160c092ae854f81580396ba570d9e62e24","Crypto":{"ciphertext":"ece19263a5de440b740ebf467997ce6d885a5051bd4007376a08fa96714fcdde","cipherparams":{"iv":"c7a350ad344e177661c6d11961b02789"},"cipher":"aes-128-ctr","kdf":"scrypt","kdfparams":{"dklen":32,"salt":"32d2515b4b42fd14f1a9d47f25287becb608f509499c75aeb160310486cb3d11","n":1024,"r":8,"p":1},"mac":"acef48bc288b174b168c506e429dcaef2731bd9cfbc0900108f0f5e16ad3ca6f"}} -------------------------------------------------------------------------------- /src/Sources/miranz-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HamzaYasin1/Web3j-Java-Wallet-Swing-Framework-Ethereum-Client/599fd35e451fff9a3a88e1e6970591ce88945c0d/src/Sources/miranz-logo.png --------------------------------------------------------------------------------