├── .gitignore ├── Cargo.lock ├── Cargo.toml ├── README.md └── src ├── eth_wallet.rs ├── main.rs └── utils.rs /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | crypto_wallet.json 3 | .env -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "anyhow" 7 | version = "1.0.53" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "94a45b455c14666b85fc40a019e8ab9eb75e3a124e05494f5397122bc9eb06e0" 10 | 11 | [[package]] 12 | name = "arrayvec" 13 | version = "0.5.2" 14 | source = "registry+https://github.com/rust-lang/crates.io-index" 15 | checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" 16 | 17 | [[package]] 18 | name = "arrayvec" 19 | version = "0.7.2" 20 | source = "registry+https://github.com/rust-lang/crates.io-index" 21 | checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" 22 | 23 | [[package]] 24 | name = "autocfg" 25 | version = "0.1.8" 26 | source = "registry+https://github.com/rust-lang/crates.io-index" 27 | checksum = "0dde43e75fd43e8a1bf86103336bc699aa8d17ad1be60c76c0bdfd4828e19b78" 28 | dependencies = [ 29 | "autocfg 1.1.0", 30 | ] 31 | 32 | [[package]] 33 | name = "autocfg" 34 | version = "1.1.0" 35 | source = "registry+https://github.com/rust-lang/crates.io-index" 36 | checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" 37 | 38 | [[package]] 39 | name = "base64" 40 | version = "0.13.0" 41 | source = "registry+https://github.com/rust-lang/crates.io-index" 42 | checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" 43 | 44 | [[package]] 45 | name = "bitflags" 46 | version = "1.3.2" 47 | source = "registry+https://github.com/rust-lang/crates.io-index" 48 | checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" 49 | 50 | [[package]] 51 | name = "bitvec" 52 | version = "0.20.4" 53 | source = "registry+https://github.com/rust-lang/crates.io-index" 54 | checksum = "7774144344a4faa177370406a7ff5f1da24303817368584c6206c8303eb07848" 55 | dependencies = [ 56 | "funty", 57 | "radium", 58 | "tap", 59 | "wyz", 60 | ] 61 | 62 | [[package]] 63 | name = "block-buffer" 64 | version = "0.9.0" 65 | source = "registry+https://github.com/rust-lang/crates.io-index" 66 | checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" 67 | dependencies = [ 68 | "block-padding", 69 | "generic-array", 70 | ] 71 | 72 | [[package]] 73 | name = "block-buffer" 74 | version = "0.10.2" 75 | source = "registry+https://github.com/rust-lang/crates.io-index" 76 | checksum = "0bf7fe51849ea569fd452f37822f606a5cabb684dc918707a0193fd4664ff324" 77 | dependencies = [ 78 | "generic-array", 79 | ] 80 | 81 | [[package]] 82 | name = "block-padding" 83 | version = "0.2.1" 84 | source = "registry+https://github.com/rust-lang/crates.io-index" 85 | checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" 86 | 87 | [[package]] 88 | name = "bumpalo" 89 | version = "3.9.1" 90 | source = "registry+https://github.com/rust-lang/crates.io-index" 91 | checksum = "a4a45a46ab1f2412e53d3a0ade76ffad2025804294569aae387231a0cd6e0899" 92 | 93 | [[package]] 94 | name = "byte-slice-cast" 95 | version = "1.2.0" 96 | source = "registry+https://github.com/rust-lang/crates.io-index" 97 | checksum = "1d30c751592b77c499e7bce34d99d67c2c11bdc0574e9a488ddade14150a4698" 98 | 99 | [[package]] 100 | name = "byteorder" 101 | version = "1.4.3" 102 | source = "registry+https://github.com/rust-lang/crates.io-index" 103 | checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" 104 | 105 | [[package]] 106 | name = "bytes" 107 | version = "1.1.0" 108 | source = "registry+https://github.com/rust-lang/crates.io-index" 109 | checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8" 110 | 111 | [[package]] 112 | name = "cc" 113 | version = "1.0.72" 114 | source = "registry+https://github.com/rust-lang/crates.io-index" 115 | checksum = "22a9137b95ea06864e018375b72adfb7db6e6f68cfc8df5a04d00288050485ee" 116 | 117 | [[package]] 118 | name = "cfg-if" 119 | version = "1.0.0" 120 | source = "registry+https://github.com/rust-lang/crates.io-index" 121 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 122 | 123 | [[package]] 124 | name = "convert_case" 125 | version = "0.4.0" 126 | source = "registry+https://github.com/rust-lang/crates.io-index" 127 | checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" 128 | 129 | [[package]] 130 | name = "core-foundation" 131 | version = "0.9.3" 132 | source = "registry+https://github.com/rust-lang/crates.io-index" 133 | checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" 134 | dependencies = [ 135 | "core-foundation-sys", 136 | "libc", 137 | ] 138 | 139 | [[package]] 140 | name = "core-foundation-sys" 141 | version = "0.8.3" 142 | source = "registry+https://github.com/rust-lang/crates.io-index" 143 | checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" 144 | 145 | [[package]] 146 | name = "cpufeatures" 147 | version = "0.2.1" 148 | source = "registry+https://github.com/rust-lang/crates.io-index" 149 | checksum = "95059428f66df56b63431fdb4e1947ed2190586af5c5a8a8b71122bdf5a7f469" 150 | dependencies = [ 151 | "libc", 152 | ] 153 | 154 | [[package]] 155 | name = "crunchy" 156 | version = "0.2.2" 157 | source = "registry+https://github.com/rust-lang/crates.io-index" 158 | checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" 159 | 160 | [[package]] 161 | name = "crypto-common" 162 | version = "0.1.2" 163 | source = "registry+https://github.com/rust-lang/crates.io-index" 164 | checksum = "a4600d695eb3f6ce1cd44e6e291adceb2cc3ab12f20a33777ecd0bf6eba34e06" 165 | dependencies = [ 166 | "generic-array", 167 | ] 168 | 169 | [[package]] 170 | name = "derive_more" 171 | version = "0.99.17" 172 | source = "registry+https://github.com/rust-lang/crates.io-index" 173 | checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" 174 | dependencies = [ 175 | "convert_case", 176 | "proc-macro2", 177 | "quote", 178 | "rustc_version", 179 | "syn", 180 | ] 181 | 182 | [[package]] 183 | name = "digest" 184 | version = "0.9.0" 185 | source = "registry+https://github.com/rust-lang/crates.io-index" 186 | checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" 187 | dependencies = [ 188 | "generic-array", 189 | ] 190 | 191 | [[package]] 192 | name = "digest" 193 | version = "0.10.2" 194 | source = "registry+https://github.com/rust-lang/crates.io-index" 195 | checksum = "8cb780dce4f9a8f5c087362b3a4595936b2019e7c8b30f2c3e9a7e94e6ae9837" 196 | dependencies = [ 197 | "block-buffer 0.10.2", 198 | "crypto-common", 199 | ] 200 | 201 | [[package]] 202 | name = "dotenv" 203 | version = "0.15.0" 204 | source = "registry+https://github.com/rust-lang/crates.io-index" 205 | checksum = "77c90badedccf4105eca100756a0b1289e191f6fcbdadd3cee1d2f614f97da8f" 206 | 207 | [[package]] 208 | name = "encoding_rs" 209 | version = "0.8.30" 210 | source = "registry+https://github.com/rust-lang/crates.io-index" 211 | checksum = "7896dc8abb250ffdda33912550faa54c88ec8b998dec0b2c55ab224921ce11df" 212 | dependencies = [ 213 | "cfg-if", 214 | ] 215 | 216 | [[package]] 217 | name = "ethabi" 218 | version = "14.1.0" 219 | source = "registry+https://github.com/rust-lang/crates.io-index" 220 | checksum = "a01317735d563b3bad2d5f90d2e1799f414165408251abb762510f40e790e69a" 221 | dependencies = [ 222 | "anyhow", 223 | "ethereum-types", 224 | "hex", 225 | "serde", 226 | "serde_json", 227 | "sha3", 228 | "thiserror", 229 | "uint", 230 | ] 231 | 232 | [[package]] 233 | name = "ethbloom" 234 | version = "0.11.1" 235 | source = "registry+https://github.com/rust-lang/crates.io-index" 236 | checksum = "bfb684ac8fa8f6c5759f788862bb22ec6fe3cb392f6bfd08e3c64b603661e3f8" 237 | dependencies = [ 238 | "crunchy", 239 | "fixed-hash", 240 | "impl-rlp", 241 | "impl-serde", 242 | "tiny-keccak 2.0.2", 243 | ] 244 | 245 | [[package]] 246 | name = "ethereum-types" 247 | version = "0.11.0" 248 | source = "registry+https://github.com/rust-lang/crates.io-index" 249 | checksum = "f64b5df66a228d85e4b17e5d6c6aa43b0310898ffe8a85988c4c032357aaabfd" 250 | dependencies = [ 251 | "ethbloom", 252 | "fixed-hash", 253 | "impl-rlp", 254 | "impl-serde", 255 | "primitive-types", 256 | "uint", 257 | ] 258 | 259 | [[package]] 260 | name = "fastrand" 261 | version = "1.7.0" 262 | source = "registry+https://github.com/rust-lang/crates.io-index" 263 | checksum = "c3fcf0cee53519c866c09b5de1f6c56ff9d647101f81c1964fa632e148896cdf" 264 | dependencies = [ 265 | "instant", 266 | ] 267 | 268 | [[package]] 269 | name = "fixed-hash" 270 | version = "0.7.0" 271 | source = "registry+https://github.com/rust-lang/crates.io-index" 272 | checksum = "cfcf0ed7fe52a17a03854ec54a9f76d6d84508d1c0e66bc1793301c73fc8493c" 273 | dependencies = [ 274 | "byteorder", 275 | "rand 0.8.4", 276 | "rustc-hex", 277 | "static_assertions", 278 | ] 279 | 280 | [[package]] 281 | name = "fnv" 282 | version = "1.0.7" 283 | source = "registry+https://github.com/rust-lang/crates.io-index" 284 | checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" 285 | 286 | [[package]] 287 | name = "foreign-types" 288 | version = "0.3.2" 289 | source = "registry+https://github.com/rust-lang/crates.io-index" 290 | checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" 291 | dependencies = [ 292 | "foreign-types-shared", 293 | ] 294 | 295 | [[package]] 296 | name = "foreign-types-shared" 297 | version = "0.1.1" 298 | source = "registry+https://github.com/rust-lang/crates.io-index" 299 | checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" 300 | 301 | [[package]] 302 | name = "form_urlencoded" 303 | version = "1.0.1" 304 | source = "registry+https://github.com/rust-lang/crates.io-index" 305 | checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191" 306 | dependencies = [ 307 | "matches", 308 | "percent-encoding", 309 | ] 310 | 311 | [[package]] 312 | name = "funty" 313 | version = "1.1.0" 314 | source = "registry+https://github.com/rust-lang/crates.io-index" 315 | checksum = "fed34cd105917e91daa4da6b3728c47b068749d6a62c59811f06ed2ac71d9da7" 316 | 317 | [[package]] 318 | name = "futures" 319 | version = "0.3.21" 320 | source = "registry+https://github.com/rust-lang/crates.io-index" 321 | checksum = "f73fe65f54d1e12b726f517d3e2135ca3125a437b6d998caf1962961f7172d9e" 322 | dependencies = [ 323 | "futures-channel", 324 | "futures-core", 325 | "futures-executor", 326 | "futures-io", 327 | "futures-sink", 328 | "futures-task", 329 | "futures-util", 330 | ] 331 | 332 | [[package]] 333 | name = "futures-channel" 334 | version = "0.3.21" 335 | source = "registry+https://github.com/rust-lang/crates.io-index" 336 | checksum = "c3083ce4b914124575708913bca19bfe887522d6e2e6d0952943f5eac4a74010" 337 | dependencies = [ 338 | "futures-core", 339 | "futures-sink", 340 | ] 341 | 342 | [[package]] 343 | name = "futures-core" 344 | version = "0.3.21" 345 | source = "registry+https://github.com/rust-lang/crates.io-index" 346 | checksum = "0c09fd04b7e4073ac7156a9539b57a484a8ea920f79c7c675d05d289ab6110d3" 347 | 348 | [[package]] 349 | name = "futures-executor" 350 | version = "0.3.21" 351 | source = "registry+https://github.com/rust-lang/crates.io-index" 352 | checksum = "9420b90cfa29e327d0429f19be13e7ddb68fa1cccb09d65e5706b8c7a749b8a6" 353 | dependencies = [ 354 | "futures-core", 355 | "futures-task", 356 | "futures-util", 357 | ] 358 | 359 | [[package]] 360 | name = "futures-io" 361 | version = "0.3.21" 362 | source = "registry+https://github.com/rust-lang/crates.io-index" 363 | checksum = "fc4045962a5a5e935ee2fdedaa4e08284547402885ab326734432bed5d12966b" 364 | 365 | [[package]] 366 | name = "futures-macro" 367 | version = "0.3.21" 368 | source = "registry+https://github.com/rust-lang/crates.io-index" 369 | checksum = "33c1e13800337f4d4d7a316bf45a567dbcb6ffe087f16424852d97e97a91f512" 370 | dependencies = [ 371 | "proc-macro2", 372 | "quote", 373 | "syn", 374 | ] 375 | 376 | [[package]] 377 | name = "futures-sink" 378 | version = "0.3.21" 379 | source = "registry+https://github.com/rust-lang/crates.io-index" 380 | checksum = "21163e139fa306126e6eedaf49ecdb4588f939600f0b1e770f4205ee4b7fa868" 381 | 382 | [[package]] 383 | name = "futures-task" 384 | version = "0.3.21" 385 | source = "registry+https://github.com/rust-lang/crates.io-index" 386 | checksum = "57c66a976bf5909d801bbef33416c41372779507e7a6b3a5e25e4749c58f776a" 387 | 388 | [[package]] 389 | name = "futures-timer" 390 | version = "3.0.2" 391 | source = "registry+https://github.com/rust-lang/crates.io-index" 392 | checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" 393 | 394 | [[package]] 395 | name = "futures-util" 396 | version = "0.3.21" 397 | source = "registry+https://github.com/rust-lang/crates.io-index" 398 | checksum = "d8b7abd5d659d9b90c8cba917f6ec750a74e2dc23902ef9cd4cc8c8b22e6036a" 399 | dependencies = [ 400 | "futures-channel", 401 | "futures-core", 402 | "futures-io", 403 | "futures-macro", 404 | "futures-sink", 405 | "futures-task", 406 | "memchr", 407 | "pin-project-lite", 408 | "pin-utils", 409 | "slab", 410 | ] 411 | 412 | [[package]] 413 | name = "generic-array" 414 | version = "0.14.5" 415 | source = "registry+https://github.com/rust-lang/crates.io-index" 416 | checksum = "fd48d33ec7f05fbfa152300fdad764757cbded343c1aa1cff2fbaf4134851803" 417 | dependencies = [ 418 | "typenum", 419 | "version_check", 420 | ] 421 | 422 | [[package]] 423 | name = "getrandom" 424 | version = "0.2.4" 425 | source = "registry+https://github.com/rust-lang/crates.io-index" 426 | checksum = "418d37c8b1d42553c93648be529cb70f920d3baf8ef469b74b9638df426e0b4c" 427 | dependencies = [ 428 | "cfg-if", 429 | "libc", 430 | "wasi", 431 | ] 432 | 433 | [[package]] 434 | name = "h2" 435 | version = "0.3.11" 436 | source = "registry+https://github.com/rust-lang/crates.io-index" 437 | checksum = "d9f1f717ddc7b2ba36df7e871fd88db79326551d3d6f1fc406fbfd28b582ff8e" 438 | dependencies = [ 439 | "bytes", 440 | "fnv", 441 | "futures-core", 442 | "futures-sink", 443 | "futures-util", 444 | "http", 445 | "indexmap", 446 | "slab", 447 | "tokio", 448 | "tokio-util", 449 | "tracing", 450 | ] 451 | 452 | [[package]] 453 | name = "hashbrown" 454 | version = "0.11.2" 455 | source = "registry+https://github.com/rust-lang/crates.io-index" 456 | checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" 457 | 458 | [[package]] 459 | name = "headers" 460 | version = "0.3.7" 461 | source = "registry+https://github.com/rust-lang/crates.io-index" 462 | checksum = "4cff78e5788be1e0ab65b04d306b2ed5092c815ec97ec70f4ebd5aee158aa55d" 463 | dependencies = [ 464 | "base64", 465 | "bitflags", 466 | "bytes", 467 | "headers-core", 468 | "http", 469 | "httpdate", 470 | "mime", 471 | "sha-1 0.10.0", 472 | ] 473 | 474 | [[package]] 475 | name = "headers-core" 476 | version = "0.2.0" 477 | source = "registry+https://github.com/rust-lang/crates.io-index" 478 | checksum = "e7f66481bfee273957b1f20485a4ff3362987f85b2c236580d81b4eb7a326429" 479 | dependencies = [ 480 | "http", 481 | ] 482 | 483 | [[package]] 484 | name = "hermit-abi" 485 | version = "0.1.19" 486 | source = "registry+https://github.com/rust-lang/crates.io-index" 487 | checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" 488 | dependencies = [ 489 | "libc", 490 | ] 491 | 492 | [[package]] 493 | name = "hex" 494 | version = "0.4.3" 495 | source = "registry+https://github.com/rust-lang/crates.io-index" 496 | checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" 497 | 498 | [[package]] 499 | name = "http" 500 | version = "0.2.6" 501 | source = "registry+https://github.com/rust-lang/crates.io-index" 502 | checksum = "31f4c6746584866f0feabcc69893c5b51beef3831656a968ed7ae254cdc4fd03" 503 | dependencies = [ 504 | "bytes", 505 | "fnv", 506 | "itoa", 507 | ] 508 | 509 | [[package]] 510 | name = "http-body" 511 | version = "0.4.4" 512 | source = "registry+https://github.com/rust-lang/crates.io-index" 513 | checksum = "1ff4f84919677303da5f147645dbea6b1881f368d03ac84e1dc09031ebd7b2c6" 514 | dependencies = [ 515 | "bytes", 516 | "http", 517 | "pin-project-lite", 518 | ] 519 | 520 | [[package]] 521 | name = "httparse" 522 | version = "1.6.0" 523 | source = "registry+https://github.com/rust-lang/crates.io-index" 524 | checksum = "9100414882e15fb7feccb4897e5f0ff0ff1ca7d1a86a23208ada4d7a18e6c6c4" 525 | 526 | [[package]] 527 | name = "httpdate" 528 | version = "1.0.2" 529 | source = "registry+https://github.com/rust-lang/crates.io-index" 530 | checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" 531 | 532 | [[package]] 533 | name = "hyper" 534 | version = "0.14.17" 535 | source = "registry+https://github.com/rust-lang/crates.io-index" 536 | checksum = "043f0e083e9901b6cc658a77d1eb86f4fc650bbb977a4337dd63192826aa85dd" 537 | dependencies = [ 538 | "bytes", 539 | "futures-channel", 540 | "futures-core", 541 | "futures-util", 542 | "h2", 543 | "http", 544 | "http-body", 545 | "httparse", 546 | "httpdate", 547 | "itoa", 548 | "pin-project-lite", 549 | "socket2", 550 | "tokio", 551 | "tower-service", 552 | "tracing", 553 | "want", 554 | ] 555 | 556 | [[package]] 557 | name = "hyper-tls" 558 | version = "0.5.0" 559 | source = "registry+https://github.com/rust-lang/crates.io-index" 560 | checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" 561 | dependencies = [ 562 | "bytes", 563 | "hyper", 564 | "native-tls", 565 | "tokio", 566 | "tokio-native-tls", 567 | ] 568 | 569 | [[package]] 570 | name = "idna" 571 | version = "0.2.3" 572 | source = "registry+https://github.com/rust-lang/crates.io-index" 573 | checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" 574 | dependencies = [ 575 | "matches", 576 | "unicode-bidi", 577 | "unicode-normalization", 578 | ] 579 | 580 | [[package]] 581 | name = "impl-codec" 582 | version = "0.5.1" 583 | source = "registry+https://github.com/rust-lang/crates.io-index" 584 | checksum = "161ebdfec3c8e3b52bf61c4f3550a1eea4f9579d10dc1b936f3171ebdcd6c443" 585 | dependencies = [ 586 | "parity-scale-codec", 587 | ] 588 | 589 | [[package]] 590 | name = "impl-rlp" 591 | version = "0.3.0" 592 | source = "registry+https://github.com/rust-lang/crates.io-index" 593 | checksum = "f28220f89297a075ddc7245cd538076ee98b01f2a9c23a53a4f1105d5a322808" 594 | dependencies = [ 595 | "rlp", 596 | ] 597 | 598 | [[package]] 599 | name = "impl-serde" 600 | version = "0.3.2" 601 | source = "registry+https://github.com/rust-lang/crates.io-index" 602 | checksum = "4551f042f3438e64dbd6226b20527fc84a6e1fe65688b58746a2f53623f25f5c" 603 | dependencies = [ 604 | "serde", 605 | ] 606 | 607 | [[package]] 608 | name = "impl-trait-for-tuples" 609 | version = "0.2.2" 610 | source = "registry+https://github.com/rust-lang/crates.io-index" 611 | checksum = "11d7a9f6330b71fea57921c9b61c47ee6e84f72d394754eff6163ae67e7395eb" 612 | dependencies = [ 613 | "proc-macro2", 614 | "quote", 615 | "syn", 616 | ] 617 | 618 | [[package]] 619 | name = "indexmap" 620 | version = "1.8.0" 621 | source = "registry+https://github.com/rust-lang/crates.io-index" 622 | checksum = "282a6247722caba404c065016bbfa522806e51714c34f5dfc3e4a3a46fcb4223" 623 | dependencies = [ 624 | "autocfg 1.1.0", 625 | "hashbrown", 626 | ] 627 | 628 | [[package]] 629 | name = "instant" 630 | version = "0.1.12" 631 | source = "registry+https://github.com/rust-lang/crates.io-index" 632 | checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" 633 | dependencies = [ 634 | "cfg-if", 635 | ] 636 | 637 | [[package]] 638 | name = "ipnet" 639 | version = "2.3.1" 640 | source = "registry+https://github.com/rust-lang/crates.io-index" 641 | checksum = "68f2d64f2edebec4ce84ad108148e67e1064789bee435edc5b60ad398714a3a9" 642 | 643 | [[package]] 644 | name = "itoa" 645 | version = "1.0.1" 646 | source = "registry+https://github.com/rust-lang/crates.io-index" 647 | checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35" 648 | 649 | [[package]] 650 | name = "js-sys" 651 | version = "0.3.56" 652 | source = "registry+https://github.com/rust-lang/crates.io-index" 653 | checksum = "a38fc24e30fd564ce974c02bf1d337caddff65be6cc4735a1f7eab22a7440f04" 654 | dependencies = [ 655 | "wasm-bindgen", 656 | ] 657 | 658 | [[package]] 659 | name = "jsonrpc-core" 660 | version = "18.0.0" 661 | source = "registry+https://github.com/rust-lang/crates.io-index" 662 | checksum = "14f7f76aef2d054868398427f6c54943cf3d1caa9a7ec7d0c38d69df97a965eb" 663 | dependencies = [ 664 | "futures", 665 | "futures-executor", 666 | "futures-util", 667 | "log", 668 | "serde", 669 | "serde_derive", 670 | "serde_json", 671 | ] 672 | 673 | [[package]] 674 | name = "keccak" 675 | version = "0.1.0" 676 | source = "registry+https://github.com/rust-lang/crates.io-index" 677 | checksum = "67c21572b4949434e4fc1e1978b99c5f77064153c59d998bf13ecd96fb5ecba7" 678 | 679 | [[package]] 680 | name = "lazy_static" 681 | version = "1.4.0" 682 | source = "registry+https://github.com/rust-lang/crates.io-index" 683 | checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" 684 | 685 | [[package]] 686 | name = "libc" 687 | version = "0.2.117" 688 | source = "registry+https://github.com/rust-lang/crates.io-index" 689 | checksum = "e74d72e0f9b65b5b4ca49a346af3976df0f9c61d550727f349ecd559f251a26c" 690 | 691 | [[package]] 692 | name = "lock_api" 693 | version = "0.4.6" 694 | source = "registry+https://github.com/rust-lang/crates.io-index" 695 | checksum = "88943dd7ef4a2e5a4bfa2753aaab3013e34ce2533d1996fb18ef591e315e2b3b" 696 | dependencies = [ 697 | "scopeguard", 698 | ] 699 | 700 | [[package]] 701 | name = "log" 702 | version = "0.4.14" 703 | source = "registry+https://github.com/rust-lang/crates.io-index" 704 | checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" 705 | dependencies = [ 706 | "cfg-if", 707 | ] 708 | 709 | [[package]] 710 | name = "matches" 711 | version = "0.1.9" 712 | source = "registry+https://github.com/rust-lang/crates.io-index" 713 | checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" 714 | 715 | [[package]] 716 | name = "memchr" 717 | version = "2.4.1" 718 | source = "registry+https://github.com/rust-lang/crates.io-index" 719 | checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" 720 | 721 | [[package]] 722 | name = "mime" 723 | version = "0.3.16" 724 | source = "registry+https://github.com/rust-lang/crates.io-index" 725 | checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" 726 | 727 | [[package]] 728 | name = "mio" 729 | version = "0.7.14" 730 | source = "registry+https://github.com/rust-lang/crates.io-index" 731 | checksum = "8067b404fe97c70829f082dec8bcf4f71225d7eaea1d8645349cb76fa06205cc" 732 | dependencies = [ 733 | "libc", 734 | "log", 735 | "miow", 736 | "ntapi", 737 | "winapi", 738 | ] 739 | 740 | [[package]] 741 | name = "miow" 742 | version = "0.3.7" 743 | source = "registry+https://github.com/rust-lang/crates.io-index" 744 | checksum = "b9f1c5b025cda876f66ef43a113f91ebc9f4ccef34843000e0adf6ebbab84e21" 745 | dependencies = [ 746 | "winapi", 747 | ] 748 | 749 | [[package]] 750 | name = "native-tls" 751 | version = "0.2.8" 752 | source = "registry+https://github.com/rust-lang/crates.io-index" 753 | checksum = "48ba9f7719b5a0f42f338907614285fb5fd70e53858141f69898a1fb7203b24d" 754 | dependencies = [ 755 | "lazy_static", 756 | "libc", 757 | "log", 758 | "openssl", 759 | "openssl-probe", 760 | "openssl-sys", 761 | "schannel", 762 | "security-framework", 763 | "security-framework-sys", 764 | "tempfile", 765 | ] 766 | 767 | [[package]] 768 | name = "ntapi" 769 | version = "0.3.7" 770 | source = "registry+https://github.com/rust-lang/crates.io-index" 771 | checksum = "c28774a7fd2fbb4f0babd8237ce554b73af68021b5f695a3cebd6c59bac0980f" 772 | dependencies = [ 773 | "winapi", 774 | ] 775 | 776 | [[package]] 777 | name = "num_cpus" 778 | version = "1.13.1" 779 | source = "registry+https://github.com/rust-lang/crates.io-index" 780 | checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" 781 | dependencies = [ 782 | "hermit-abi", 783 | "libc", 784 | ] 785 | 786 | [[package]] 787 | name = "once_cell" 788 | version = "1.9.0" 789 | source = "registry+https://github.com/rust-lang/crates.io-index" 790 | checksum = "da32515d9f6e6e489d7bc9d84c71b060db7247dc035bbe44eac88cf87486d8d5" 791 | 792 | [[package]] 793 | name = "opaque-debug" 794 | version = "0.3.0" 795 | source = "registry+https://github.com/rust-lang/crates.io-index" 796 | checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" 797 | 798 | [[package]] 799 | name = "openssl" 800 | version = "0.10.38" 801 | source = "registry+https://github.com/rust-lang/crates.io-index" 802 | checksum = "0c7ae222234c30df141154f159066c5093ff73b63204dcda7121eb082fc56a95" 803 | dependencies = [ 804 | "bitflags", 805 | "cfg-if", 806 | "foreign-types", 807 | "libc", 808 | "once_cell", 809 | "openssl-sys", 810 | ] 811 | 812 | [[package]] 813 | name = "openssl-probe" 814 | version = "0.1.5" 815 | source = "registry+https://github.com/rust-lang/crates.io-index" 816 | checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" 817 | 818 | [[package]] 819 | name = "openssl-sys" 820 | version = "0.9.72" 821 | source = "registry+https://github.com/rust-lang/crates.io-index" 822 | checksum = "7e46109c383602735fa0a2e48dd2b7c892b048e1bf69e5c3b1d804b7d9c203cb" 823 | dependencies = [ 824 | "autocfg 1.1.0", 825 | "cc", 826 | "libc", 827 | "pkg-config", 828 | "vcpkg", 829 | ] 830 | 831 | [[package]] 832 | name = "parity-scale-codec" 833 | version = "2.3.1" 834 | source = "registry+https://github.com/rust-lang/crates.io-index" 835 | checksum = "373b1a4c1338d9cd3d1fa53b3a11bdab5ab6bd80a20f7f7becd76953ae2be909" 836 | dependencies = [ 837 | "arrayvec 0.7.2", 838 | "bitvec", 839 | "byte-slice-cast", 840 | "impl-trait-for-tuples", 841 | "parity-scale-codec-derive", 842 | "serde", 843 | ] 844 | 845 | [[package]] 846 | name = "parity-scale-codec-derive" 847 | version = "2.3.1" 848 | source = "registry+https://github.com/rust-lang/crates.io-index" 849 | checksum = "1557010476e0595c9b568d16dcfb81b93cdeb157612726f5170d31aa707bed27" 850 | dependencies = [ 851 | "proc-macro-crate", 852 | "proc-macro2", 853 | "quote", 854 | "syn", 855 | ] 856 | 857 | [[package]] 858 | name = "parking_lot" 859 | version = "0.11.2" 860 | source = "registry+https://github.com/rust-lang/crates.io-index" 861 | checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" 862 | dependencies = [ 863 | "instant", 864 | "lock_api", 865 | "parking_lot_core", 866 | ] 867 | 868 | [[package]] 869 | name = "parking_lot_core" 870 | version = "0.8.5" 871 | source = "registry+https://github.com/rust-lang/crates.io-index" 872 | checksum = "d76e8e1493bcac0d2766c42737f34458f1c8c50c0d23bcb24ea953affb273216" 873 | dependencies = [ 874 | "cfg-if", 875 | "instant", 876 | "libc", 877 | "redox_syscall", 878 | "smallvec", 879 | "winapi", 880 | ] 881 | 882 | [[package]] 883 | name = "percent-encoding" 884 | version = "2.1.0" 885 | source = "registry+https://github.com/rust-lang/crates.io-index" 886 | checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" 887 | 888 | [[package]] 889 | name = "pin-project" 890 | version = "1.0.10" 891 | source = "registry+https://github.com/rust-lang/crates.io-index" 892 | checksum = "58ad3879ad3baf4e44784bc6a718a8698867bb991f8ce24d1bcbe2cfb4c3a75e" 893 | dependencies = [ 894 | "pin-project-internal", 895 | ] 896 | 897 | [[package]] 898 | name = "pin-project-internal" 899 | version = "1.0.10" 900 | source = "registry+https://github.com/rust-lang/crates.io-index" 901 | checksum = "744b6f092ba29c3650faf274db506afd39944f48420f6c86b17cfe0ee1cb36bb" 902 | dependencies = [ 903 | "proc-macro2", 904 | "quote", 905 | "syn", 906 | ] 907 | 908 | [[package]] 909 | name = "pin-project-lite" 910 | version = "0.2.8" 911 | source = "registry+https://github.com/rust-lang/crates.io-index" 912 | checksum = "e280fbe77cc62c91527259e9442153f4688736748d24660126286329742b4c6c" 913 | 914 | [[package]] 915 | name = "pin-utils" 916 | version = "0.1.0" 917 | source = "registry+https://github.com/rust-lang/crates.io-index" 918 | checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" 919 | 920 | [[package]] 921 | name = "pkg-config" 922 | version = "0.3.24" 923 | source = "registry+https://github.com/rust-lang/crates.io-index" 924 | checksum = "58893f751c9b0412871a09abd62ecd2a00298c6c83befa223ef98c52aef40cbe" 925 | 926 | [[package]] 927 | name = "ppv-lite86" 928 | version = "0.2.16" 929 | source = "registry+https://github.com/rust-lang/crates.io-index" 930 | checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" 931 | 932 | [[package]] 933 | name = "primitive-types" 934 | version = "0.9.1" 935 | source = "registry+https://github.com/rust-lang/crates.io-index" 936 | checksum = "06345ee39fbccfb06ab45f3a1a5798d9dafa04cb8921a76d227040003a234b0e" 937 | dependencies = [ 938 | "fixed-hash", 939 | "impl-codec", 940 | "impl-rlp", 941 | "impl-serde", 942 | "uint", 943 | ] 944 | 945 | [[package]] 946 | name = "proc-macro-crate" 947 | version = "1.1.0" 948 | source = "registry+https://github.com/rust-lang/crates.io-index" 949 | checksum = "1ebace6889caf889b4d3f76becee12e90353f2b8c7d875534a71e5742f8f6f83" 950 | dependencies = [ 951 | "thiserror", 952 | "toml", 953 | ] 954 | 955 | [[package]] 956 | name = "proc-macro2" 957 | version = "1.0.36" 958 | source = "registry+https://github.com/rust-lang/crates.io-index" 959 | checksum = "c7342d5883fbccae1cc37a2353b09c87c9b0f3afd73f5fb9bba687a1f733b029" 960 | dependencies = [ 961 | "unicode-xid", 962 | ] 963 | 964 | [[package]] 965 | name = "quote" 966 | version = "1.0.15" 967 | source = "registry+https://github.com/rust-lang/crates.io-index" 968 | checksum = "864d3e96a899863136fc6e99f3d7cae289dafe43bf2c5ac19b70df7210c0a145" 969 | dependencies = [ 970 | "proc-macro2", 971 | ] 972 | 973 | [[package]] 974 | name = "radium" 975 | version = "0.6.2" 976 | source = "registry+https://github.com/rust-lang/crates.io-index" 977 | checksum = "643f8f41a8ebc4c5dc4515c82bb8abd397b527fc20fd681b7c011c2aee5d44fb" 978 | 979 | [[package]] 980 | name = "rand" 981 | version = "0.6.5" 982 | source = "registry+https://github.com/rust-lang/crates.io-index" 983 | checksum = "6d71dacdc3c88c1fde3885a3be3fbab9f35724e6ce99467f7d9c5026132184ca" 984 | dependencies = [ 985 | "autocfg 0.1.8", 986 | "libc", 987 | "rand_chacha 0.1.1", 988 | "rand_core 0.4.2", 989 | "rand_hc 0.1.0", 990 | "rand_isaac", 991 | "rand_jitter", 992 | "rand_pcg", 993 | "rand_xorshift", 994 | "winapi", 995 | ] 996 | 997 | [[package]] 998 | name = "rand" 999 | version = "0.8.4" 1000 | source = "registry+https://github.com/rust-lang/crates.io-index" 1001 | checksum = "2e7573632e6454cf6b99d7aac4ccca54be06da05aca2ef7423d22d27d4d4bcd8" 1002 | dependencies = [ 1003 | "libc", 1004 | "rand_chacha 0.3.1", 1005 | "rand_core 0.6.3", 1006 | "rand_hc 0.3.1", 1007 | ] 1008 | 1009 | [[package]] 1010 | name = "rand_chacha" 1011 | version = "0.1.1" 1012 | source = "registry+https://github.com/rust-lang/crates.io-index" 1013 | checksum = "556d3a1ca6600bfcbab7c7c91ccb085ac7fbbcd70e008a98742e7847f4f7bcef" 1014 | dependencies = [ 1015 | "autocfg 0.1.8", 1016 | "rand_core 0.3.1", 1017 | ] 1018 | 1019 | [[package]] 1020 | name = "rand_chacha" 1021 | version = "0.3.1" 1022 | source = "registry+https://github.com/rust-lang/crates.io-index" 1023 | checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" 1024 | dependencies = [ 1025 | "ppv-lite86", 1026 | "rand_core 0.6.3", 1027 | ] 1028 | 1029 | [[package]] 1030 | name = "rand_core" 1031 | version = "0.3.1" 1032 | source = "registry+https://github.com/rust-lang/crates.io-index" 1033 | checksum = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" 1034 | dependencies = [ 1035 | "rand_core 0.4.2", 1036 | ] 1037 | 1038 | [[package]] 1039 | name = "rand_core" 1040 | version = "0.4.2" 1041 | source = "registry+https://github.com/rust-lang/crates.io-index" 1042 | checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" 1043 | 1044 | [[package]] 1045 | name = "rand_core" 1046 | version = "0.6.3" 1047 | source = "registry+https://github.com/rust-lang/crates.io-index" 1048 | checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" 1049 | dependencies = [ 1050 | "getrandom", 1051 | ] 1052 | 1053 | [[package]] 1054 | name = "rand_hc" 1055 | version = "0.1.0" 1056 | source = "registry+https://github.com/rust-lang/crates.io-index" 1057 | checksum = "7b40677c7be09ae76218dc623efbf7b18e34bced3f38883af07bb75630a21bc4" 1058 | dependencies = [ 1059 | "rand_core 0.3.1", 1060 | ] 1061 | 1062 | [[package]] 1063 | name = "rand_hc" 1064 | version = "0.3.1" 1065 | source = "registry+https://github.com/rust-lang/crates.io-index" 1066 | checksum = "d51e9f596de227fda2ea6c84607f5558e196eeaf43c986b724ba4fb8fdf497e7" 1067 | dependencies = [ 1068 | "rand_core 0.6.3", 1069 | ] 1070 | 1071 | [[package]] 1072 | name = "rand_isaac" 1073 | version = "0.1.1" 1074 | source = "registry+https://github.com/rust-lang/crates.io-index" 1075 | checksum = "ded997c9d5f13925be2a6fd7e66bf1872597f759fd9dd93513dd7e92e5a5ee08" 1076 | dependencies = [ 1077 | "rand_core 0.3.1", 1078 | ] 1079 | 1080 | [[package]] 1081 | name = "rand_jitter" 1082 | version = "0.1.4" 1083 | source = "registry+https://github.com/rust-lang/crates.io-index" 1084 | checksum = "1166d5c91dc97b88d1decc3285bb0a99ed84b05cfd0bc2341bdf2d43fc41e39b" 1085 | dependencies = [ 1086 | "libc", 1087 | "rand_core 0.4.2", 1088 | "winapi", 1089 | ] 1090 | 1091 | [[package]] 1092 | name = "rand_pcg" 1093 | version = "0.1.2" 1094 | source = "registry+https://github.com/rust-lang/crates.io-index" 1095 | checksum = "abf9b09b01790cfe0364f52bf32995ea3c39f4d2dd011eac241d2914146d0b44" 1096 | dependencies = [ 1097 | "autocfg 0.1.8", 1098 | "rand_core 0.4.2", 1099 | ] 1100 | 1101 | [[package]] 1102 | name = "rand_xorshift" 1103 | version = "0.1.1" 1104 | source = "registry+https://github.com/rust-lang/crates.io-index" 1105 | checksum = "cbf7e9e623549b0e21f6e97cf8ecf247c1a8fd2e8a992ae265314300b2455d5c" 1106 | dependencies = [ 1107 | "rand_core 0.3.1", 1108 | ] 1109 | 1110 | [[package]] 1111 | name = "redox_syscall" 1112 | version = "0.2.10" 1113 | source = "registry+https://github.com/rust-lang/crates.io-index" 1114 | checksum = "8383f39639269cde97d255a32bdb68c047337295414940c68bdd30c2e13203ff" 1115 | dependencies = [ 1116 | "bitflags", 1117 | ] 1118 | 1119 | [[package]] 1120 | name = "remove_dir_all" 1121 | version = "0.5.3" 1122 | source = "registry+https://github.com/rust-lang/crates.io-index" 1123 | checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" 1124 | dependencies = [ 1125 | "winapi", 1126 | ] 1127 | 1128 | [[package]] 1129 | name = "reqwest" 1130 | version = "0.11.9" 1131 | source = "registry+https://github.com/rust-lang/crates.io-index" 1132 | checksum = "87f242f1488a539a79bac6dbe7c8609ae43b7914b7736210f239a37cccb32525" 1133 | dependencies = [ 1134 | "base64", 1135 | "bytes", 1136 | "encoding_rs", 1137 | "futures-core", 1138 | "futures-util", 1139 | "h2", 1140 | "http", 1141 | "http-body", 1142 | "hyper", 1143 | "hyper-tls", 1144 | "ipnet", 1145 | "js-sys", 1146 | "lazy_static", 1147 | "log", 1148 | "mime", 1149 | "native-tls", 1150 | "percent-encoding", 1151 | "pin-project-lite", 1152 | "serde", 1153 | "serde_json", 1154 | "serde_urlencoded", 1155 | "tokio", 1156 | "tokio-native-tls", 1157 | "url", 1158 | "wasm-bindgen", 1159 | "wasm-bindgen-futures", 1160 | "web-sys", 1161 | "winreg", 1162 | ] 1163 | 1164 | [[package]] 1165 | name = "rlp" 1166 | version = "0.5.1" 1167 | source = "registry+https://github.com/rust-lang/crates.io-index" 1168 | checksum = "999508abb0ae792aabed2460c45b89106d97fe4adac593bdaef433c2605847b5" 1169 | dependencies = [ 1170 | "bytes", 1171 | "rustc-hex", 1172 | ] 1173 | 1174 | [[package]] 1175 | name = "rust-eth-crypto-wallet" 1176 | version = "0.1.0" 1177 | dependencies = [ 1178 | "anyhow", 1179 | "dotenv", 1180 | "secp256k1", 1181 | "serde", 1182 | "serde_json", 1183 | "tiny-keccak 1.5.0", 1184 | "tokio", 1185 | "web3", 1186 | ] 1187 | 1188 | [[package]] 1189 | name = "rustc-hex" 1190 | version = "2.1.0" 1191 | source = "registry+https://github.com/rust-lang/crates.io-index" 1192 | checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" 1193 | 1194 | [[package]] 1195 | name = "rustc_version" 1196 | version = "0.4.0" 1197 | source = "registry+https://github.com/rust-lang/crates.io-index" 1198 | checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" 1199 | dependencies = [ 1200 | "semver", 1201 | ] 1202 | 1203 | [[package]] 1204 | name = "ryu" 1205 | version = "1.0.9" 1206 | source = "registry+https://github.com/rust-lang/crates.io-index" 1207 | checksum = "73b4b750c782965c211b42f022f59af1fbceabdd026623714f104152f1ec149f" 1208 | 1209 | [[package]] 1210 | name = "schannel" 1211 | version = "0.1.19" 1212 | source = "registry+https://github.com/rust-lang/crates.io-index" 1213 | checksum = "8f05ba609c234e60bee0d547fe94a4c7e9da733d1c962cf6e59efa4cd9c8bc75" 1214 | dependencies = [ 1215 | "lazy_static", 1216 | "winapi", 1217 | ] 1218 | 1219 | [[package]] 1220 | name = "scopeguard" 1221 | version = "1.1.0" 1222 | source = "registry+https://github.com/rust-lang/crates.io-index" 1223 | checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" 1224 | 1225 | [[package]] 1226 | name = "secp256k1" 1227 | version = "0.20.3" 1228 | source = "registry+https://github.com/rust-lang/crates.io-index" 1229 | checksum = "97d03ceae636d0fed5bae6a7f4f664354c5f4fcedf6eef053fef17e49f837d0a" 1230 | dependencies = [ 1231 | "rand 0.6.5", 1232 | "secp256k1-sys", 1233 | ] 1234 | 1235 | [[package]] 1236 | name = "secp256k1-sys" 1237 | version = "0.4.2" 1238 | source = "registry+https://github.com/rust-lang/crates.io-index" 1239 | checksum = "957da2573cde917463ece3570eab4a0b3f19de6f1646cde62e6fd3868f566036" 1240 | dependencies = [ 1241 | "cc", 1242 | ] 1243 | 1244 | [[package]] 1245 | name = "security-framework" 1246 | version = "2.6.1" 1247 | source = "registry+https://github.com/rust-lang/crates.io-index" 1248 | checksum = "2dc14f172faf8a0194a3aded622712b0de276821addc574fa54fc0a1167e10dc" 1249 | dependencies = [ 1250 | "bitflags", 1251 | "core-foundation", 1252 | "core-foundation-sys", 1253 | "libc", 1254 | "security-framework-sys", 1255 | ] 1256 | 1257 | [[package]] 1258 | name = "security-framework-sys" 1259 | version = "2.6.1" 1260 | source = "registry+https://github.com/rust-lang/crates.io-index" 1261 | checksum = "0160a13a177a45bfb43ce71c01580998474f556ad854dcbca936dd2841a5c556" 1262 | dependencies = [ 1263 | "core-foundation-sys", 1264 | "libc", 1265 | ] 1266 | 1267 | [[package]] 1268 | name = "semver" 1269 | version = "1.0.5" 1270 | source = "registry+https://github.com/rust-lang/crates.io-index" 1271 | checksum = "0486718e92ec9a68fbed73bb5ef687d71103b142595b406835649bebd33f72c7" 1272 | 1273 | [[package]] 1274 | name = "serde" 1275 | version = "1.0.136" 1276 | source = "registry+https://github.com/rust-lang/crates.io-index" 1277 | checksum = "ce31e24b01e1e524df96f1c2fdd054405f8d7376249a5110886fb4b658484789" 1278 | dependencies = [ 1279 | "serde_derive", 1280 | ] 1281 | 1282 | [[package]] 1283 | name = "serde_derive" 1284 | version = "1.0.136" 1285 | source = "registry+https://github.com/rust-lang/crates.io-index" 1286 | checksum = "08597e7152fcd306f41838ed3e37be9eaeed2b61c42e2117266a554fab4662f9" 1287 | dependencies = [ 1288 | "proc-macro2", 1289 | "quote", 1290 | "syn", 1291 | ] 1292 | 1293 | [[package]] 1294 | name = "serde_json" 1295 | version = "1.0.79" 1296 | source = "registry+https://github.com/rust-lang/crates.io-index" 1297 | checksum = "8e8d9fa5c3b304765ce1fd9c4c8a3de2c8db365a5b91be52f186efc675681d95" 1298 | dependencies = [ 1299 | "itoa", 1300 | "ryu", 1301 | "serde", 1302 | ] 1303 | 1304 | [[package]] 1305 | name = "serde_urlencoded" 1306 | version = "0.7.1" 1307 | source = "registry+https://github.com/rust-lang/crates.io-index" 1308 | checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" 1309 | dependencies = [ 1310 | "form_urlencoded", 1311 | "itoa", 1312 | "ryu", 1313 | "serde", 1314 | ] 1315 | 1316 | [[package]] 1317 | name = "sha-1" 1318 | version = "0.9.8" 1319 | source = "registry+https://github.com/rust-lang/crates.io-index" 1320 | checksum = "99cd6713db3cf16b6c84e06321e049a9b9f699826e16096d23bbcc44d15d51a6" 1321 | dependencies = [ 1322 | "block-buffer 0.9.0", 1323 | "cfg-if", 1324 | "cpufeatures", 1325 | "digest 0.9.0", 1326 | "opaque-debug", 1327 | ] 1328 | 1329 | [[package]] 1330 | name = "sha-1" 1331 | version = "0.10.0" 1332 | source = "registry+https://github.com/rust-lang/crates.io-index" 1333 | checksum = "028f48d513f9678cda28f6e4064755b3fbb2af6acd672f2c209b62323f7aea0f" 1334 | dependencies = [ 1335 | "cfg-if", 1336 | "cpufeatures", 1337 | "digest 0.10.2", 1338 | ] 1339 | 1340 | [[package]] 1341 | name = "sha3" 1342 | version = "0.9.1" 1343 | source = "registry+https://github.com/rust-lang/crates.io-index" 1344 | checksum = "f81199417d4e5de3f04b1e871023acea7389672c4135918f05aa9cbf2f2fa809" 1345 | dependencies = [ 1346 | "block-buffer 0.9.0", 1347 | "digest 0.9.0", 1348 | "keccak", 1349 | "opaque-debug", 1350 | ] 1351 | 1352 | [[package]] 1353 | name = "signal-hook-registry" 1354 | version = "1.4.0" 1355 | source = "registry+https://github.com/rust-lang/crates.io-index" 1356 | checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" 1357 | dependencies = [ 1358 | "libc", 1359 | ] 1360 | 1361 | [[package]] 1362 | name = "slab" 1363 | version = "0.4.5" 1364 | source = "registry+https://github.com/rust-lang/crates.io-index" 1365 | checksum = "9def91fd1e018fe007022791f865d0ccc9b3a0d5001e01aabb8b40e46000afb5" 1366 | 1367 | [[package]] 1368 | name = "smallvec" 1369 | version = "1.8.0" 1370 | source = "registry+https://github.com/rust-lang/crates.io-index" 1371 | checksum = "f2dd574626839106c320a323308629dcb1acfc96e32a8cba364ddc61ac23ee83" 1372 | 1373 | [[package]] 1374 | name = "socket2" 1375 | version = "0.4.4" 1376 | source = "registry+https://github.com/rust-lang/crates.io-index" 1377 | checksum = "66d72b759436ae32898a2af0a14218dbf55efde3feeb170eb623637db85ee1e0" 1378 | dependencies = [ 1379 | "libc", 1380 | "winapi", 1381 | ] 1382 | 1383 | [[package]] 1384 | name = "soketto" 1385 | version = "0.5.0" 1386 | source = "registry+https://github.com/rust-lang/crates.io-index" 1387 | checksum = "4919971d141dbadaa0e82b5d369e2d7666c98e4625046140615ca363e50d4daa" 1388 | dependencies = [ 1389 | "base64", 1390 | "bytes", 1391 | "futures", 1392 | "httparse", 1393 | "log", 1394 | "rand 0.8.4", 1395 | "sha-1 0.9.8", 1396 | ] 1397 | 1398 | [[package]] 1399 | name = "static_assertions" 1400 | version = "1.1.0" 1401 | source = "registry+https://github.com/rust-lang/crates.io-index" 1402 | checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" 1403 | 1404 | [[package]] 1405 | name = "syn" 1406 | version = "1.0.86" 1407 | source = "registry+https://github.com/rust-lang/crates.io-index" 1408 | checksum = "8a65b3f4ffa0092e9887669db0eae07941f023991ab58ea44da8fe8e2d511c6b" 1409 | dependencies = [ 1410 | "proc-macro2", 1411 | "quote", 1412 | "unicode-xid", 1413 | ] 1414 | 1415 | [[package]] 1416 | name = "tap" 1417 | version = "1.0.1" 1418 | source = "registry+https://github.com/rust-lang/crates.io-index" 1419 | checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" 1420 | 1421 | [[package]] 1422 | name = "tempfile" 1423 | version = "3.3.0" 1424 | source = "registry+https://github.com/rust-lang/crates.io-index" 1425 | checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" 1426 | dependencies = [ 1427 | "cfg-if", 1428 | "fastrand", 1429 | "libc", 1430 | "redox_syscall", 1431 | "remove_dir_all", 1432 | "winapi", 1433 | ] 1434 | 1435 | [[package]] 1436 | name = "thiserror" 1437 | version = "1.0.30" 1438 | source = "registry+https://github.com/rust-lang/crates.io-index" 1439 | checksum = "854babe52e4df1653706b98fcfc05843010039b406875930a70e4d9644e5c417" 1440 | dependencies = [ 1441 | "thiserror-impl", 1442 | ] 1443 | 1444 | [[package]] 1445 | name = "thiserror-impl" 1446 | version = "1.0.30" 1447 | source = "registry+https://github.com/rust-lang/crates.io-index" 1448 | checksum = "aa32fd3f627f367fe16f893e2597ae3c05020f8bba2666a4e6ea73d377e5714b" 1449 | dependencies = [ 1450 | "proc-macro2", 1451 | "quote", 1452 | "syn", 1453 | ] 1454 | 1455 | [[package]] 1456 | name = "tiny-keccak" 1457 | version = "1.5.0" 1458 | source = "registry+https://github.com/rust-lang/crates.io-index" 1459 | checksum = "1d8a021c69bb74a44ccedb824a046447e2c84a01df9e5c20779750acb38e11b2" 1460 | dependencies = [ 1461 | "crunchy", 1462 | ] 1463 | 1464 | [[package]] 1465 | name = "tiny-keccak" 1466 | version = "2.0.2" 1467 | source = "registry+https://github.com/rust-lang/crates.io-index" 1468 | checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" 1469 | dependencies = [ 1470 | "crunchy", 1471 | ] 1472 | 1473 | [[package]] 1474 | name = "tinyvec" 1475 | version = "1.5.1" 1476 | source = "registry+https://github.com/rust-lang/crates.io-index" 1477 | checksum = "2c1c1d5a42b6245520c249549ec267180beaffcc0615401ac8e31853d4b6d8d2" 1478 | dependencies = [ 1479 | "tinyvec_macros", 1480 | ] 1481 | 1482 | [[package]] 1483 | name = "tinyvec_macros" 1484 | version = "0.1.0" 1485 | source = "registry+https://github.com/rust-lang/crates.io-index" 1486 | checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" 1487 | 1488 | [[package]] 1489 | name = "tokio" 1490 | version = "1.16.1" 1491 | source = "registry+https://github.com/rust-lang/crates.io-index" 1492 | checksum = "0c27a64b625de6d309e8c57716ba93021dccf1b3b5c97edd6d3dd2d2135afc0a" 1493 | dependencies = [ 1494 | "bytes", 1495 | "libc", 1496 | "memchr", 1497 | "mio", 1498 | "num_cpus", 1499 | "once_cell", 1500 | "parking_lot", 1501 | "pin-project-lite", 1502 | "signal-hook-registry", 1503 | "tokio-macros", 1504 | "winapi", 1505 | ] 1506 | 1507 | [[package]] 1508 | name = "tokio-macros" 1509 | version = "1.7.0" 1510 | source = "registry+https://github.com/rust-lang/crates.io-index" 1511 | checksum = "b557f72f448c511a979e2564e55d74e6c4432fc96ff4f6241bc6bded342643b7" 1512 | dependencies = [ 1513 | "proc-macro2", 1514 | "quote", 1515 | "syn", 1516 | ] 1517 | 1518 | [[package]] 1519 | name = "tokio-native-tls" 1520 | version = "0.3.0" 1521 | source = "registry+https://github.com/rust-lang/crates.io-index" 1522 | checksum = "f7d995660bd2b7f8c1568414c1126076c13fbb725c40112dc0120b78eb9b717b" 1523 | dependencies = [ 1524 | "native-tls", 1525 | "tokio", 1526 | ] 1527 | 1528 | [[package]] 1529 | name = "tokio-stream" 1530 | version = "0.1.8" 1531 | source = "registry+https://github.com/rust-lang/crates.io-index" 1532 | checksum = "50145484efff8818b5ccd256697f36863f587da82cf8b409c53adf1e840798e3" 1533 | dependencies = [ 1534 | "futures-core", 1535 | "pin-project-lite", 1536 | "tokio", 1537 | ] 1538 | 1539 | [[package]] 1540 | name = "tokio-util" 1541 | version = "0.6.9" 1542 | source = "registry+https://github.com/rust-lang/crates.io-index" 1543 | checksum = "9e99e1983e5d376cd8eb4b66604d2e99e79f5bd988c3055891dcd8c9e2604cc0" 1544 | dependencies = [ 1545 | "bytes", 1546 | "futures-core", 1547 | "futures-io", 1548 | "futures-sink", 1549 | "log", 1550 | "pin-project-lite", 1551 | "tokio", 1552 | ] 1553 | 1554 | [[package]] 1555 | name = "toml" 1556 | version = "0.5.8" 1557 | source = "registry+https://github.com/rust-lang/crates.io-index" 1558 | checksum = "a31142970826733df8241ef35dc040ef98c679ab14d7c3e54d827099b3acecaa" 1559 | dependencies = [ 1560 | "serde", 1561 | ] 1562 | 1563 | [[package]] 1564 | name = "tower-service" 1565 | version = "0.3.1" 1566 | source = "registry+https://github.com/rust-lang/crates.io-index" 1567 | checksum = "360dfd1d6d30e05fda32ace2c8c70e9c0a9da713275777f5a4dbb8a1893930c6" 1568 | 1569 | [[package]] 1570 | name = "tracing" 1571 | version = "0.1.30" 1572 | source = "registry+https://github.com/rust-lang/crates.io-index" 1573 | checksum = "2d8d93354fe2a8e50d5953f5ae2e47a3fc2ef03292e7ea46e3cc38f549525fb9" 1574 | dependencies = [ 1575 | "cfg-if", 1576 | "pin-project-lite", 1577 | "tracing-core", 1578 | ] 1579 | 1580 | [[package]] 1581 | name = "tracing-core" 1582 | version = "0.1.22" 1583 | source = "registry+https://github.com/rust-lang/crates.io-index" 1584 | checksum = "03cfcb51380632a72d3111cb8d3447a8d908e577d31beeac006f836383d29a23" 1585 | dependencies = [ 1586 | "lazy_static", 1587 | ] 1588 | 1589 | [[package]] 1590 | name = "try-lock" 1591 | version = "0.2.3" 1592 | source = "registry+https://github.com/rust-lang/crates.io-index" 1593 | checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" 1594 | 1595 | [[package]] 1596 | name = "typenum" 1597 | version = "1.15.0" 1598 | source = "registry+https://github.com/rust-lang/crates.io-index" 1599 | checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" 1600 | 1601 | [[package]] 1602 | name = "uint" 1603 | version = "0.9.3" 1604 | source = "registry+https://github.com/rust-lang/crates.io-index" 1605 | checksum = "12f03af7ccf01dd611cc450a0d10dbc9b745770d096473e2faf0ca6e2d66d1e0" 1606 | dependencies = [ 1607 | "byteorder", 1608 | "crunchy", 1609 | "hex", 1610 | "static_assertions", 1611 | ] 1612 | 1613 | [[package]] 1614 | name = "unicode-bidi" 1615 | version = "0.3.7" 1616 | source = "registry+https://github.com/rust-lang/crates.io-index" 1617 | checksum = "1a01404663e3db436ed2746d9fefef640d868edae3cceb81c3b8d5732fda678f" 1618 | 1619 | [[package]] 1620 | name = "unicode-normalization" 1621 | version = "0.1.19" 1622 | source = "registry+https://github.com/rust-lang/crates.io-index" 1623 | checksum = "d54590932941a9e9266f0832deed84ebe1bf2e4c9e4a3554d393d18f5e854bf9" 1624 | dependencies = [ 1625 | "tinyvec", 1626 | ] 1627 | 1628 | [[package]] 1629 | name = "unicode-xid" 1630 | version = "0.2.2" 1631 | source = "registry+https://github.com/rust-lang/crates.io-index" 1632 | checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" 1633 | 1634 | [[package]] 1635 | name = "url" 1636 | version = "2.2.2" 1637 | source = "registry+https://github.com/rust-lang/crates.io-index" 1638 | checksum = "a507c383b2d33b5fc35d1861e77e6b383d158b2da5e14fe51b83dfedf6fd578c" 1639 | dependencies = [ 1640 | "form_urlencoded", 1641 | "idna", 1642 | "matches", 1643 | "percent-encoding", 1644 | ] 1645 | 1646 | [[package]] 1647 | name = "vcpkg" 1648 | version = "0.2.15" 1649 | source = "registry+https://github.com/rust-lang/crates.io-index" 1650 | checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" 1651 | 1652 | [[package]] 1653 | name = "version_check" 1654 | version = "0.9.4" 1655 | source = "registry+https://github.com/rust-lang/crates.io-index" 1656 | checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" 1657 | 1658 | [[package]] 1659 | name = "want" 1660 | version = "0.3.0" 1661 | source = "registry+https://github.com/rust-lang/crates.io-index" 1662 | checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" 1663 | dependencies = [ 1664 | "log", 1665 | "try-lock", 1666 | ] 1667 | 1668 | [[package]] 1669 | name = "wasi" 1670 | version = "0.10.2+wasi-snapshot-preview1" 1671 | source = "registry+https://github.com/rust-lang/crates.io-index" 1672 | checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" 1673 | 1674 | [[package]] 1675 | name = "wasm-bindgen" 1676 | version = "0.2.79" 1677 | source = "registry+https://github.com/rust-lang/crates.io-index" 1678 | checksum = "25f1af7423d8588a3d840681122e72e6a24ddbcb3f0ec385cac0d12d24256c06" 1679 | dependencies = [ 1680 | "cfg-if", 1681 | "wasm-bindgen-macro", 1682 | ] 1683 | 1684 | [[package]] 1685 | name = "wasm-bindgen-backend" 1686 | version = "0.2.79" 1687 | source = "registry+https://github.com/rust-lang/crates.io-index" 1688 | checksum = "8b21c0df030f5a177f3cba22e9bc4322695ec43e7257d865302900290bcdedca" 1689 | dependencies = [ 1690 | "bumpalo", 1691 | "lazy_static", 1692 | "log", 1693 | "proc-macro2", 1694 | "quote", 1695 | "syn", 1696 | "wasm-bindgen-shared", 1697 | ] 1698 | 1699 | [[package]] 1700 | name = "wasm-bindgen-futures" 1701 | version = "0.4.29" 1702 | source = "registry+https://github.com/rust-lang/crates.io-index" 1703 | checksum = "2eb6ec270a31b1d3c7e266b999739109abce8b6c87e4b31fcfcd788b65267395" 1704 | dependencies = [ 1705 | "cfg-if", 1706 | "js-sys", 1707 | "wasm-bindgen", 1708 | "web-sys", 1709 | ] 1710 | 1711 | [[package]] 1712 | name = "wasm-bindgen-macro" 1713 | version = "0.2.79" 1714 | source = "registry+https://github.com/rust-lang/crates.io-index" 1715 | checksum = "2f4203d69e40a52ee523b2529a773d5ffc1dc0071801c87b3d270b471b80ed01" 1716 | dependencies = [ 1717 | "quote", 1718 | "wasm-bindgen-macro-support", 1719 | ] 1720 | 1721 | [[package]] 1722 | name = "wasm-bindgen-macro-support" 1723 | version = "0.2.79" 1724 | source = "registry+https://github.com/rust-lang/crates.io-index" 1725 | checksum = "bfa8a30d46208db204854cadbb5d4baf5fcf8071ba5bf48190c3e59937962ebc" 1726 | dependencies = [ 1727 | "proc-macro2", 1728 | "quote", 1729 | "syn", 1730 | "wasm-bindgen-backend", 1731 | "wasm-bindgen-shared", 1732 | ] 1733 | 1734 | [[package]] 1735 | name = "wasm-bindgen-shared" 1736 | version = "0.2.79" 1737 | source = "registry+https://github.com/rust-lang/crates.io-index" 1738 | checksum = "3d958d035c4438e28c70e4321a2911302f10135ce78a9c7834c0cab4123d06a2" 1739 | 1740 | [[package]] 1741 | name = "web-sys" 1742 | version = "0.3.56" 1743 | source = "registry+https://github.com/rust-lang/crates.io-index" 1744 | checksum = "c060b319f29dd25724f09a2ba1418f142f539b2be99fbf4d2d5a8f7330afb8eb" 1745 | dependencies = [ 1746 | "js-sys", 1747 | "wasm-bindgen", 1748 | ] 1749 | 1750 | [[package]] 1751 | name = "web3" 1752 | version = "0.17.0" 1753 | source = "registry+https://github.com/rust-lang/crates.io-index" 1754 | checksum = "cd24abe6f2b68e0677f843059faea87bcbd4892e39f02886f366d8222c3c540d" 1755 | dependencies = [ 1756 | "arrayvec 0.5.2", 1757 | "base64", 1758 | "bytes", 1759 | "derive_more", 1760 | "ethabi", 1761 | "ethereum-types", 1762 | "futures", 1763 | "futures-timer", 1764 | "headers", 1765 | "hex", 1766 | "jsonrpc-core", 1767 | "log", 1768 | "parking_lot", 1769 | "pin-project", 1770 | "reqwest", 1771 | "rlp", 1772 | "secp256k1", 1773 | "serde", 1774 | "serde_json", 1775 | "soketto", 1776 | "tiny-keccak 2.0.2", 1777 | "tokio", 1778 | "tokio-stream", 1779 | "tokio-util", 1780 | "url", 1781 | "web3-async-native-tls", 1782 | ] 1783 | 1784 | [[package]] 1785 | name = "web3-async-native-tls" 1786 | version = "0.4.0" 1787 | source = "registry+https://github.com/rust-lang/crates.io-index" 1788 | checksum = "1f6d8d1636b2627fe63518d5a9b38a569405d9c9bc665c43c9c341de57227ebb" 1789 | dependencies = [ 1790 | "native-tls", 1791 | "thiserror", 1792 | "tokio", 1793 | "url", 1794 | ] 1795 | 1796 | [[package]] 1797 | name = "winapi" 1798 | version = "0.3.9" 1799 | source = "registry+https://github.com/rust-lang/crates.io-index" 1800 | checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" 1801 | dependencies = [ 1802 | "winapi-i686-pc-windows-gnu", 1803 | "winapi-x86_64-pc-windows-gnu", 1804 | ] 1805 | 1806 | [[package]] 1807 | name = "winapi-i686-pc-windows-gnu" 1808 | version = "0.4.0" 1809 | source = "registry+https://github.com/rust-lang/crates.io-index" 1810 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 1811 | 1812 | [[package]] 1813 | name = "winapi-x86_64-pc-windows-gnu" 1814 | version = "0.4.0" 1815 | source = "registry+https://github.com/rust-lang/crates.io-index" 1816 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 1817 | 1818 | [[package]] 1819 | name = "winreg" 1820 | version = "0.7.0" 1821 | source = "registry+https://github.com/rust-lang/crates.io-index" 1822 | checksum = "0120db82e8a1e0b9fb3345a539c478767c0048d842860994d96113d5b667bd69" 1823 | dependencies = [ 1824 | "winapi", 1825 | ] 1826 | 1827 | [[package]] 1828 | name = "wyz" 1829 | version = "0.2.0" 1830 | source = "registry+https://github.com/rust-lang/crates.io-index" 1831 | checksum = "85e60b0d1b5f99db2556934e21937020776a5d31520bf169e851ac44e6420214" 1832 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "rust-eth-crypto-wallet" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 | 8 | [dependencies] 9 | anyhow = "1.0" 10 | dotenv = "0.15.0" 11 | secp256k1 = { version = "0.20.3", features = ["rand"] } 12 | tokio = { version= "1", features = ["full"] } 13 | web3 = "0.17.0" 14 | serde = { version = "1.0", features = ["derive"]} 15 | serde_json = "1.0" 16 | tiny-keccak = { version = "1.4" } 17 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Build a crypto wallet using Rust 2 | 3 | This repository shows an example of how to implement a simple crypto currency wallet using Rust. This example is for educational purposes. 4 | 5 | On my blog I explain the whole process of building this project: [Build a crypto wallet using Rust: steps how to](https://tms-dev-blog.com/build-a-crypto-wallet-using-rust/). 6 | 7 | The wallet can generate a secret key, public key and public address. Furthermore it shows the balance for the wallet's address. An example of sending Eth from the wallet to a different address is also shown. 8 | 9 | ## Set up and run 10 | 11 | In order to run the project a `.env` file is required containing an endpoint for connecting to an Ethereum network using WebSockets. For example: 12 | 13 | ``` 14 | INFURA_RINKEBY_WS=wss://rinkeby.infura.io/ws/v3/08xxxxxxxxx 15 | ``` 16 | 17 | The `INFURA_RINKEBY` value is an endpoint address from [infura.io](https://infura.io), however it can be any valid address to an Ethereum network WebSocket endpoint. 18 | 19 | Infura.io is an easy way to gain access to an Ethereum node endpoint. -------------------------------------------------------------------------------- /src/eth_wallet.rs: -------------------------------------------------------------------------------- 1 | use crate::utils; 2 | use anyhow::Result; 3 | use secp256k1::{rand::rngs, PublicKey, SecretKey}; 4 | use serde::{Deserialize, Serialize}; 5 | use std::io::BufWriter; 6 | use std::str::FromStr; 7 | use std::{fs::OpenOptions, io::BufReader}; 8 | use tiny_keccak::keccak256; 9 | use web3::{ 10 | transports, 11 | types::{Address, TransactionParameters, H256, U256}, 12 | Web3, 13 | }; 14 | 15 | pub fn generate_keypair() -> (SecretKey, PublicKey) { 16 | let secp = secp256k1::Secp256k1::new(); 17 | let mut rng = rngs::JitterRng::new_with_timer(utils::get_nstime); 18 | secp.generate_keypair(&mut rng) 19 | } 20 | 21 | pub fn public_key_address(public_key: &PublicKey) -> Address { 22 | let public_key = public_key.serialize_uncompressed(); 23 | debug_assert_eq!(public_key[0], 0x04); 24 | let hash = keccak256(&public_key[1..]); 25 | 26 | Address::from_slice(&hash[12..]) 27 | } 28 | 29 | #[derive(Serialize, Deserialize, Debug)] 30 | pub struct Wallet { 31 | pub secret_key: String, 32 | pub public_key: String, 33 | pub public_address: String, 34 | } 35 | 36 | impl Wallet { 37 | pub fn new(secret_key: &SecretKey, public_key: &PublicKey) -> Self { 38 | let addr: Address = public_key_address(&public_key); 39 | Wallet { 40 | secret_key: format!("{}", secret_key.to_string()), 41 | public_key: public_key.to_string(), 42 | public_address: format!("{:?}", addr), 43 | } 44 | } 45 | 46 | pub fn save_to_file(&self, file_path: &str) -> Result<()> { 47 | let file = OpenOptions::new() 48 | .write(true) 49 | .create(true) 50 | .open(file_path)?; 51 | let buf_writer = BufWriter::new(file); 52 | 53 | serde_json::to_writer_pretty(buf_writer, self)?; 54 | 55 | Ok(()) 56 | } 57 | 58 | pub fn from_file(file_path: &str) -> Result { 59 | let file = OpenOptions::new().read(true).open(file_path)?; 60 | let buf_reader = BufReader::new(file); 61 | 62 | let wallet: Wallet = serde_json::from_reader(buf_reader)?; 63 | Ok(wallet) 64 | } 65 | 66 | pub fn get_secret_key(&self) -> Result { 67 | let secret_key = SecretKey::from_str(&self.secret_key)?; 68 | Ok(secret_key) 69 | } 70 | 71 | pub fn get_public_key(&self) -> Result { 72 | let pub_key = PublicKey::from_str(&self.public_key)?; 73 | Ok(pub_key) 74 | } 75 | 76 | pub async fn get_balance(&self, web3_connection: &Web3) -> Result { 77 | let wallet_address = Address::from_str(&self.public_address)?; 78 | let balance = web3_connection.eth().balance(wallet_address, None).await?; 79 | 80 | Ok(balance) 81 | } 82 | 83 | pub async fn get_balance_in_eth( 84 | &self, 85 | web3_connection: &Web3, 86 | ) -> Result { 87 | let wei_balance = self.get_balance(web3_connection).await?; 88 | Ok(utils::wei_to_eth(wei_balance)) 89 | } 90 | } 91 | 92 | pub async fn establish_web3_connection(url: &str) -> Result> { 93 | let transport = transports::WebSocket::new(url).await?; 94 | Ok(Web3::new(transport)) 95 | } 96 | 97 | pub fn create_eth_transaction(to: Address, eth_value: f64) -> TransactionParameters { 98 | TransactionParameters { 99 | to: Some(to), 100 | value: utils::eth_to_wei(eth_value), 101 | ..Default::default() 102 | } 103 | } 104 | 105 | pub async fn sign_and_send( 106 | web3: &Web3, 107 | transaction: TransactionParameters, 108 | secret_key: &SecretKey, 109 | ) -> Result { 110 | let signed = web3 111 | .accounts() 112 | .sign_transaction(transaction, secret_key) 113 | .await?; 114 | 115 | let transaction_result = web3 116 | .eth() 117 | .send_raw_transaction(signed.raw_transaction) 118 | .await?; 119 | Ok(transaction_result) 120 | } 121 | -------------------------------------------------------------------------------- /src/main.rs: -------------------------------------------------------------------------------- 1 | use anyhow::Result; 2 | mod eth_wallet; 3 | mod utils; 4 | use std::env; 5 | use std::str::FromStr; 6 | use web3::types::Address; 7 | 8 | #[tokio::main] 9 | async fn main() -> Result<()> { 10 | dotenv::dotenv().ok(); 11 | let (secret_key, pub_key) = eth_wallet::generate_keypair(); 12 | 13 | println!("secret key: {}", &secret_key.to_string()); 14 | println!("public key: {}", &pub_key.to_string()); 15 | 16 | let pub_address = eth_wallet::public_key_address(&pub_key); 17 | println!("public address: {:?}", pub_address); 18 | 19 | // let crypto_wallet = eth_wallet::Wallet::new(&secret_key, &pub_key); 20 | // println!("crypto_wallet: {:?}", &crypto_wallet); 21 | 22 | let wallet_file_path = "crypto_wallet.json"; 23 | // crypto_wallet.save_to_file(wallet_file_path)?; 24 | 25 | let loaded_wallet = eth_wallet::Wallet::from_file(wallet_file_path)?; 26 | println!("loaded_wallet: {:?}", loaded_wallet); 27 | 28 | let endpoint = env::var("INFURA_RINKEBY_WS")?; 29 | let web3_con = eth_wallet::establish_web3_connection(&endpoint).await?; 30 | 31 | let block_number = web3_con.eth().block_number().await?; 32 | println!("block number: {}", &block_number); 33 | 34 | let balance = loaded_wallet.get_balance_in_eth(&web3_con).await?; 35 | println!("wallet balance: {} eth", &balance); 36 | 37 | // let transaction = 38 | // eth_wallet::create_eth_transaction(Address::from_str("0x4fill in address here")?, 0.01); 39 | // let transact_hash = 40 | // eth_wallet::sign_and_send(&web3_con, transaction, &loaded_wallet.get_secret_key()?).await?; 41 | 42 | // println!("transaction hash: {:?}", transact_hash); 43 | 44 | Ok(()) 45 | } 46 | -------------------------------------------------------------------------------- /src/utils.rs: -------------------------------------------------------------------------------- 1 | use std::time::{SystemTime, UNIX_EPOCH}; 2 | use web3::types::U256; 3 | 4 | pub fn get_nstime() -> u64 { 5 | let dur = SystemTime::now().duration_since(UNIX_EPOCH).unwrap(); 6 | // The correct way to calculate the current time is 7 | // `dur.as_secs() * 1_000_000_000 + dur.subsec_nanos() as u64` 8 | // But this is faster, and the difference in terms of entropy is 9 | // negligible (log2(10^9) == 29.9). 10 | dur.as_secs() << 30 | dur.subsec_nanos() as u64 11 | } 12 | 13 | pub fn wei_to_eth(wei_val: U256) -> f64 { 14 | let res = wei_val.as_u128() as f64; 15 | res / 1_000_000_000_000_000_000.0 16 | } 17 | 18 | pub fn eth_to_wei(eth_val: f64) -> U256 { 19 | let result = eth_val * 1_000_000_000_000_000_000.0; 20 | let result = result as u128; 21 | 22 | U256::from(result) 23 | } 24 | --------------------------------------------------------------------------------