├── .github └── workflows │ └── rust.yml ├── .gitignore ├── Cargo.lock ├── Cargo.toml ├── LICENSE-APACHE ├── LICENSE-MIT ├── README.md ├── docs └── near_rewards.png ├── rust_toolchain └── src ├── configs.rs ├── main.rs ├── near_jsonrpc_client.rs ├── primitives.rs └── utils ├── accounts.rs ├── binance.rs ├── human.rs └── mod.rs /.github/workflows/rust.yml: -------------------------------------------------------------------------------- 1 | name: Rust 2 | 3 | on: 4 | push: 5 | branches: [ master ] 6 | pull_request: 7 | branches: [ master ] 8 | 9 | env: 10 | CARGO_TERM_COLOR: always 11 | 12 | jobs: 13 | build: 14 | 15 | runs-on: ubuntu-latest 16 | 17 | steps: 18 | - uses: actions/checkout@v2 19 | - name: Check 20 | run: cargo check 21 | - name: Clippy 22 | run: cargo check 23 | - name: Run tests 24 | run: cargo test --verbose 25 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | /target 3 | 4 | .DS_Store 5 | -------------------------------------------------------------------------------- /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 = "Inflector" 7 | version = "0.11.4" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" 10 | 11 | [[package]] 12 | name = "ahash" 13 | version = "0.7.6" 14 | source = "registry+https://github.com/rust-lang/crates.io-index" 15 | checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" 16 | dependencies = [ 17 | "getrandom 0.2.9", 18 | "once_cell", 19 | "version_check", 20 | ] 21 | 22 | [[package]] 23 | name = "android_system_properties" 24 | version = "0.1.5" 25 | source = "registry+https://github.com/rust-lang/crates.io-index" 26 | checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" 27 | dependencies = [ 28 | "libc", 29 | ] 30 | 31 | [[package]] 32 | name = "anstream" 33 | version = "0.3.2" 34 | source = "registry+https://github.com/rust-lang/crates.io-index" 35 | checksum = "0ca84f3628370c59db74ee214b3263d58f9aadd9b4fe7e711fd87dc452b7f163" 36 | dependencies = [ 37 | "anstyle", 38 | "anstyle-parse", 39 | "anstyle-query", 40 | "anstyle-wincon", 41 | "colorchoice", 42 | "is-terminal", 43 | "utf8parse", 44 | ] 45 | 46 | [[package]] 47 | name = "anstyle" 48 | version = "1.0.0" 49 | source = "registry+https://github.com/rust-lang/crates.io-index" 50 | checksum = "41ed9a86bf92ae6580e0a31281f65a1b1d867c0cc68d5346e2ae128dddfa6a7d" 51 | 52 | [[package]] 53 | name = "anstyle-parse" 54 | version = "0.2.0" 55 | source = "registry+https://github.com/rust-lang/crates.io-index" 56 | checksum = "e765fd216e48e067936442276d1d57399e37bce53c264d6fefbe298080cb57ee" 57 | dependencies = [ 58 | "utf8parse", 59 | ] 60 | 61 | [[package]] 62 | name = "anstyle-query" 63 | version = "1.0.0" 64 | source = "registry+https://github.com/rust-lang/crates.io-index" 65 | checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" 66 | dependencies = [ 67 | "windows-sys 0.48.0", 68 | ] 69 | 70 | [[package]] 71 | name = "anstyle-wincon" 72 | version = "1.0.1" 73 | source = "registry+https://github.com/rust-lang/crates.io-index" 74 | checksum = "180abfa45703aebe0093f79badacc01b8fd4ea2e35118747e5811127f926e188" 75 | dependencies = [ 76 | "anstyle", 77 | "windows-sys 0.48.0", 78 | ] 79 | 80 | [[package]] 81 | name = "arrayref" 82 | version = "0.3.7" 83 | source = "registry+https://github.com/rust-lang/crates.io-index" 84 | checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" 85 | 86 | [[package]] 87 | name = "arrayvec" 88 | version = "0.5.2" 89 | source = "registry+https://github.com/rust-lang/crates.io-index" 90 | checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" 91 | 92 | [[package]] 93 | name = "arrayvec" 94 | version = "0.7.2" 95 | source = "registry+https://github.com/rust-lang/crates.io-index" 96 | checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" 97 | 98 | [[package]] 99 | name = "atty" 100 | version = "0.2.14" 101 | source = "registry+https://github.com/rust-lang/crates.io-index" 102 | checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" 103 | dependencies = [ 104 | "hermit-abi 0.1.19", 105 | "libc", 106 | "winapi", 107 | ] 108 | 109 | [[package]] 110 | name = "autocfg" 111 | version = "1.1.0" 112 | source = "registry+https://github.com/rust-lang/crates.io-index" 113 | checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" 114 | 115 | [[package]] 116 | name = "base64" 117 | version = "0.11.0" 118 | source = "registry+https://github.com/rust-lang/crates.io-index" 119 | checksum = "b41b7ea54a0c9d92199de89e20e58d49f02f8e699814ef3fdf266f6f748d15c7" 120 | 121 | [[package]] 122 | name = "base64" 123 | version = "0.13.1" 124 | source = "registry+https://github.com/rust-lang/crates.io-index" 125 | checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" 126 | 127 | [[package]] 128 | name = "base64" 129 | version = "0.21.0" 130 | source = "registry+https://github.com/rust-lang/crates.io-index" 131 | checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a" 132 | 133 | [[package]] 134 | name = "bitflags" 135 | version = "1.3.2" 136 | source = "registry+https://github.com/rust-lang/crates.io-index" 137 | checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" 138 | 139 | [[package]] 140 | name = "bitvec" 141 | version = "0.20.4" 142 | source = "registry+https://github.com/rust-lang/crates.io-index" 143 | checksum = "7774144344a4faa177370406a7ff5f1da24303817368584c6206c8303eb07848" 144 | dependencies = [ 145 | "funty", 146 | "radium", 147 | "tap", 148 | "wyz", 149 | ] 150 | 151 | [[package]] 152 | name = "blake2" 153 | version = "0.9.2" 154 | source = "registry+https://github.com/rust-lang/crates.io-index" 155 | checksum = "0a4e37d16930f5459780f5621038b6382b9bb37c19016f39fb6b5808d831f174" 156 | dependencies = [ 157 | "crypto-mac", 158 | "digest 0.9.0", 159 | "opaque-debug", 160 | ] 161 | 162 | [[package]] 163 | name = "block-buffer" 164 | version = "0.9.0" 165 | source = "registry+https://github.com/rust-lang/crates.io-index" 166 | checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" 167 | dependencies = [ 168 | "generic-array", 169 | ] 170 | 171 | [[package]] 172 | name = "block-buffer" 173 | version = "0.10.4" 174 | source = "registry+https://github.com/rust-lang/crates.io-index" 175 | checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" 176 | dependencies = [ 177 | "generic-array", 178 | ] 179 | 180 | [[package]] 181 | name = "borsh" 182 | version = "0.9.3" 183 | source = "registry+https://github.com/rust-lang/crates.io-index" 184 | checksum = "15bf3650200d8bffa99015595e10f1fbd17de07abbc25bb067da79e769939bfa" 185 | dependencies = [ 186 | "borsh-derive 0.9.3", 187 | "hashbrown 0.11.2", 188 | ] 189 | 190 | [[package]] 191 | name = "borsh" 192 | version = "0.10.3" 193 | source = "registry+https://github.com/rust-lang/crates.io-index" 194 | checksum = "4114279215a005bc675e386011e594e1d9b800918cea18fcadadcce864a2046b" 195 | dependencies = [ 196 | "borsh-derive 0.10.3", 197 | "hashbrown 0.12.3", 198 | ] 199 | 200 | [[package]] 201 | name = "borsh-derive" 202 | version = "0.9.3" 203 | source = "registry+https://github.com/rust-lang/crates.io-index" 204 | checksum = "6441c552f230375d18e3cc377677914d2ca2b0d36e52129fe15450a2dce46775" 205 | dependencies = [ 206 | "borsh-derive-internal 0.9.3", 207 | "borsh-schema-derive-internal 0.9.3", 208 | "proc-macro-crate 0.1.5", 209 | "proc-macro2", 210 | "syn 1.0.109", 211 | ] 212 | 213 | [[package]] 214 | name = "borsh-derive" 215 | version = "0.10.3" 216 | source = "registry+https://github.com/rust-lang/crates.io-index" 217 | checksum = "0754613691538d51f329cce9af41d7b7ca150bc973056f1156611489475f54f7" 218 | dependencies = [ 219 | "borsh-derive-internal 0.10.3", 220 | "borsh-schema-derive-internal 0.10.3", 221 | "proc-macro-crate 0.1.5", 222 | "proc-macro2", 223 | "syn 1.0.109", 224 | ] 225 | 226 | [[package]] 227 | name = "borsh-derive-internal" 228 | version = "0.9.3" 229 | source = "registry+https://github.com/rust-lang/crates.io-index" 230 | checksum = "5449c28a7b352f2d1e592a8a28bf139bc71afb0764a14f3c02500935d8c44065" 231 | dependencies = [ 232 | "proc-macro2", 233 | "quote", 234 | "syn 1.0.109", 235 | ] 236 | 237 | [[package]] 238 | name = "borsh-derive-internal" 239 | version = "0.10.3" 240 | source = "registry+https://github.com/rust-lang/crates.io-index" 241 | checksum = "afb438156919598d2c7bad7e1c0adf3d26ed3840dbc010db1a882a65583ca2fb" 242 | dependencies = [ 243 | "proc-macro2", 244 | "quote", 245 | "syn 1.0.109", 246 | ] 247 | 248 | [[package]] 249 | name = "borsh-schema-derive-internal" 250 | version = "0.9.3" 251 | source = "registry+https://github.com/rust-lang/crates.io-index" 252 | checksum = "cdbd5696d8bfa21d53d9fe39a714a18538bad11492a42d066dbbc395fb1951c0" 253 | dependencies = [ 254 | "proc-macro2", 255 | "quote", 256 | "syn 1.0.109", 257 | ] 258 | 259 | [[package]] 260 | name = "borsh-schema-derive-internal" 261 | version = "0.10.3" 262 | source = "registry+https://github.com/rust-lang/crates.io-index" 263 | checksum = "634205cc43f74a1b9046ef87c4540ebda95696ec0f315024860cad7c5b0f5ccd" 264 | dependencies = [ 265 | "proc-macro2", 266 | "quote", 267 | "syn 1.0.109", 268 | ] 269 | 270 | [[package]] 271 | name = "bs58" 272 | version = "0.4.0" 273 | source = "registry+https://github.com/rust-lang/crates.io-index" 274 | checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" 275 | 276 | [[package]] 277 | name = "bumpalo" 278 | version = "3.12.1" 279 | source = "registry+https://github.com/rust-lang/crates.io-index" 280 | checksum = "9b1ce199063694f33ffb7dd4e0ee620741495c32833cde5aa08f02a0bf96f0c8" 281 | 282 | [[package]] 283 | name = "byte-slice-cast" 284 | version = "1.2.2" 285 | source = "registry+https://github.com/rust-lang/crates.io-index" 286 | checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" 287 | 288 | [[package]] 289 | name = "byteorder" 290 | version = "1.4.3" 291 | source = "registry+https://github.com/rust-lang/crates.io-index" 292 | checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" 293 | 294 | [[package]] 295 | name = "bytes" 296 | version = "1.4.0" 297 | source = "registry+https://github.com/rust-lang/crates.io-index" 298 | checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" 299 | 300 | [[package]] 301 | name = "bytesize" 302 | version = "1.2.0" 303 | source = "registry+https://github.com/rust-lang/crates.io-index" 304 | checksum = "38fcc2979eff34a4b84e1cf9a1e3da42a7d44b3b690a40cdcb23e3d556cfb2e5" 305 | 306 | [[package]] 307 | name = "c2-chacha" 308 | version = "0.3.3" 309 | source = "registry+https://github.com/rust-lang/crates.io-index" 310 | checksum = "d27dae93fe7b1e0424dc57179ac396908c26b035a87234809f5c4dfd1b47dc80" 311 | dependencies = [ 312 | "cipher", 313 | "ppv-lite86", 314 | ] 315 | 316 | [[package]] 317 | name = "cc" 318 | version = "1.0.79" 319 | source = "registry+https://github.com/rust-lang/crates.io-index" 320 | checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" 321 | 322 | [[package]] 323 | name = "cfg-if" 324 | version = "0.1.10" 325 | source = "registry+https://github.com/rust-lang/crates.io-index" 326 | checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" 327 | 328 | [[package]] 329 | name = "cfg-if" 330 | version = "1.0.0" 331 | source = "registry+https://github.com/rust-lang/crates.io-index" 332 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 333 | 334 | [[package]] 335 | name = "chrono" 336 | version = "0.4.24" 337 | source = "registry+https://github.com/rust-lang/crates.io-index" 338 | checksum = "4e3c5919066adf22df73762e50cffcde3a758f2a848b113b586d1f86728b673b" 339 | dependencies = [ 340 | "iana-time-zone", 341 | "js-sys", 342 | "num-integer", 343 | "num-traits", 344 | "serde", 345 | "time", 346 | "wasm-bindgen", 347 | "winapi", 348 | ] 349 | 350 | [[package]] 351 | name = "cipher" 352 | version = "0.2.5" 353 | source = "registry+https://github.com/rust-lang/crates.io-index" 354 | checksum = "12f8e7987cbd042a63249497f41aed09f8e65add917ea6566effbc56578d6801" 355 | dependencies = [ 356 | "generic-array", 357 | ] 358 | 359 | [[package]] 360 | name = "clap" 361 | version = "4.2.7" 362 | source = "registry+https://github.com/rust-lang/crates.io-index" 363 | checksum = "34d21f9bf1b425d2968943631ec91202fe5e837264063503708b83013f8fc938" 364 | dependencies = [ 365 | "clap_builder", 366 | "clap_derive", 367 | "once_cell", 368 | ] 369 | 370 | [[package]] 371 | name = "clap_builder" 372 | version = "4.2.7" 373 | source = "registry+https://github.com/rust-lang/crates.io-index" 374 | checksum = "914c8c79fb560f238ef6429439a30023c862f7a28e688c58f7203f12b29970bd" 375 | dependencies = [ 376 | "anstream", 377 | "anstyle", 378 | "bitflags", 379 | "clap_lex", 380 | "strsim", 381 | ] 382 | 383 | [[package]] 384 | name = "clap_derive" 385 | version = "4.2.0" 386 | source = "registry+https://github.com/rust-lang/crates.io-index" 387 | checksum = "3f9644cd56d6b87dbe899ef8b053e331c0637664e9e21a33dfcdc36093f5c5c4" 388 | dependencies = [ 389 | "heck", 390 | "proc-macro2", 391 | "quote", 392 | "syn 2.0.15", 393 | ] 394 | 395 | [[package]] 396 | name = "clap_lex" 397 | version = "0.4.1" 398 | source = "registry+https://github.com/rust-lang/crates.io-index" 399 | checksum = "8a2dd5a6fe8c6e3502f568a6353e5273bbb15193ad9a89e457b9970798efbea1" 400 | 401 | [[package]] 402 | name = "codespan-reporting" 403 | version = "0.11.1" 404 | source = "registry+https://github.com/rust-lang/crates.io-index" 405 | checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" 406 | dependencies = [ 407 | "termcolor", 408 | "unicode-width", 409 | ] 410 | 411 | [[package]] 412 | name = "colorchoice" 413 | version = "1.0.0" 414 | source = "registry+https://github.com/rust-lang/crates.io-index" 415 | checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" 416 | 417 | [[package]] 418 | name = "colored" 419 | version = "2.0.0" 420 | source = "registry+https://github.com/rust-lang/crates.io-index" 421 | checksum = "b3616f750b84d8f0de8a58bda93e08e2a81ad3f523089b05f1dffecab48c6cbd" 422 | dependencies = [ 423 | "atty", 424 | "lazy_static", 425 | "winapi", 426 | ] 427 | 428 | [[package]] 429 | name = "convert_case" 430 | version = "0.4.0" 431 | source = "registry+https://github.com/rust-lang/crates.io-index" 432 | checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" 433 | 434 | [[package]] 435 | name = "core-foundation" 436 | version = "0.9.3" 437 | source = "registry+https://github.com/rust-lang/crates.io-index" 438 | checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" 439 | dependencies = [ 440 | "core-foundation-sys", 441 | "libc", 442 | ] 443 | 444 | [[package]] 445 | name = "core-foundation-sys" 446 | version = "0.8.4" 447 | source = "registry+https://github.com/rust-lang/crates.io-index" 448 | checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" 449 | 450 | [[package]] 451 | name = "cpufeatures" 452 | version = "0.2.7" 453 | source = "registry+https://github.com/rust-lang/crates.io-index" 454 | checksum = "3e4c1eaa2012c47becbbad2ab175484c2a84d1185b566fb2cc5b8707343dfe58" 455 | dependencies = [ 456 | "libc", 457 | ] 458 | 459 | [[package]] 460 | name = "crunchy" 461 | version = "0.2.2" 462 | source = "registry+https://github.com/rust-lang/crates.io-index" 463 | checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" 464 | 465 | [[package]] 466 | name = "crypto-common" 467 | version = "0.1.6" 468 | source = "registry+https://github.com/rust-lang/crates.io-index" 469 | checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" 470 | dependencies = [ 471 | "generic-array", 472 | "typenum", 473 | ] 474 | 475 | [[package]] 476 | name = "crypto-mac" 477 | version = "0.8.0" 478 | source = "registry+https://github.com/rust-lang/crates.io-index" 479 | checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" 480 | dependencies = [ 481 | "generic-array", 482 | "subtle", 483 | ] 484 | 485 | [[package]] 486 | name = "csv" 487 | version = "1.2.1" 488 | source = "registry+https://github.com/rust-lang/crates.io-index" 489 | checksum = "0b015497079b9a9d69c02ad25de6c0a6edef051ea6360a327d0bd05802ef64ad" 490 | dependencies = [ 491 | "csv-core", 492 | "itoa", 493 | "ryu", 494 | "serde", 495 | ] 496 | 497 | [[package]] 498 | name = "csv-core" 499 | version = "0.1.10" 500 | source = "registry+https://github.com/rust-lang/crates.io-index" 501 | checksum = "2b2466559f260f48ad25fe6317b3c8dac77b5bdb5763ac7d9d6103530663bc90" 502 | dependencies = [ 503 | "memchr", 504 | ] 505 | 506 | [[package]] 507 | name = "curve25519-dalek" 508 | version = "3.2.1" 509 | source = "registry+https://github.com/rust-lang/crates.io-index" 510 | checksum = "90f9d052967f590a76e62eb387bd0bbb1b000182c3cefe5364db6b7211651bc0" 511 | dependencies = [ 512 | "byteorder", 513 | "digest 0.9.0", 514 | "rand_core 0.5.1", 515 | "subtle", 516 | "zeroize", 517 | ] 518 | 519 | [[package]] 520 | name = "cxx" 521 | version = "1.0.94" 522 | source = "registry+https://github.com/rust-lang/crates.io-index" 523 | checksum = "f61f1b6389c3fe1c316bf8a4dccc90a38208354b330925bce1f74a6c4756eb93" 524 | dependencies = [ 525 | "cc", 526 | "cxxbridge-flags", 527 | "cxxbridge-macro", 528 | "link-cplusplus", 529 | ] 530 | 531 | [[package]] 532 | name = "cxx-build" 533 | version = "1.0.94" 534 | source = "registry+https://github.com/rust-lang/crates.io-index" 535 | checksum = "12cee708e8962df2aeb38f594aae5d827c022b6460ac71a7a3e2c3c2aae5a07b" 536 | dependencies = [ 537 | "cc", 538 | "codespan-reporting", 539 | "once_cell", 540 | "proc-macro2", 541 | "quote", 542 | "scratch", 543 | "syn 2.0.15", 544 | ] 545 | 546 | [[package]] 547 | name = "cxxbridge-flags" 548 | version = "1.0.94" 549 | source = "registry+https://github.com/rust-lang/crates.io-index" 550 | checksum = "7944172ae7e4068c533afbb984114a56c46e9ccddda550499caa222902c7f7bb" 551 | 552 | [[package]] 553 | name = "cxxbridge-macro" 554 | version = "1.0.94" 555 | source = "registry+https://github.com/rust-lang/crates.io-index" 556 | checksum = "2345488264226bf682893e25de0769f3360aac9957980ec49361b083ddaa5bc5" 557 | dependencies = [ 558 | "proc-macro2", 559 | "quote", 560 | "syn 2.0.15", 561 | ] 562 | 563 | [[package]] 564 | name = "derive_more" 565 | version = "0.99.17" 566 | source = "registry+https://github.com/rust-lang/crates.io-index" 567 | checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" 568 | dependencies = [ 569 | "convert_case", 570 | "proc-macro2", 571 | "quote", 572 | "rustc_version", 573 | "syn 1.0.109", 574 | ] 575 | 576 | [[package]] 577 | name = "digest" 578 | version = "0.9.0" 579 | source = "registry+https://github.com/rust-lang/crates.io-index" 580 | checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" 581 | dependencies = [ 582 | "generic-array", 583 | ] 584 | 585 | [[package]] 586 | name = "digest" 587 | version = "0.10.6" 588 | source = "registry+https://github.com/rust-lang/crates.io-index" 589 | checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" 590 | dependencies = [ 591 | "block-buffer 0.10.4", 592 | "crypto-common", 593 | ] 594 | 595 | [[package]] 596 | name = "dirs" 597 | version = "3.0.2" 598 | source = "registry+https://github.com/rust-lang/crates.io-index" 599 | checksum = "30baa043103c9d0c2a57cf537cc2f35623889dc0d405e6c3cccfadbc81c71309" 600 | dependencies = [ 601 | "dirs-sys", 602 | ] 603 | 604 | [[package]] 605 | name = "dirs-next" 606 | version = "2.0.0" 607 | source = "registry+https://github.com/rust-lang/crates.io-index" 608 | checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" 609 | dependencies = [ 610 | "cfg-if 1.0.0", 611 | "dirs-sys-next", 612 | ] 613 | 614 | [[package]] 615 | name = "dirs-sys" 616 | version = "0.3.7" 617 | source = "registry+https://github.com/rust-lang/crates.io-index" 618 | checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" 619 | dependencies = [ 620 | "libc", 621 | "redox_users", 622 | "winapi", 623 | ] 624 | 625 | [[package]] 626 | name = "dirs-sys-next" 627 | version = "0.1.2" 628 | source = "registry+https://github.com/rust-lang/crates.io-index" 629 | checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" 630 | dependencies = [ 631 | "libc", 632 | "redox_users", 633 | "winapi", 634 | ] 635 | 636 | [[package]] 637 | name = "dyn-clone" 638 | version = "1.0.11" 639 | source = "registry+https://github.com/rust-lang/crates.io-index" 640 | checksum = "68b0cf012f1230e43cd00ebb729c6bb58707ecfa8ad08b52ef3a4ccd2697fc30" 641 | 642 | [[package]] 643 | name = "easy-ext" 644 | version = "0.2.9" 645 | source = "registry+https://github.com/rust-lang/crates.io-index" 646 | checksum = "53aff6fdc1b181225acdcb5b14c47106726fd8e486707315b1b138baed68ee31" 647 | 648 | [[package]] 649 | name = "ed25519" 650 | version = "1.5.3" 651 | source = "registry+https://github.com/rust-lang/crates.io-index" 652 | checksum = "91cff35c70bba8a626e3185d8cd48cc11b5437e1a5bcd15b9b5fa3c64b6dfee7" 653 | dependencies = [ 654 | "signature", 655 | ] 656 | 657 | [[package]] 658 | name = "ed25519-dalek" 659 | version = "1.0.1" 660 | source = "registry+https://github.com/rust-lang/crates.io-index" 661 | checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d" 662 | dependencies = [ 663 | "curve25519-dalek", 664 | "ed25519", 665 | "rand 0.7.3", 666 | "serde", 667 | "sha2 0.9.9", 668 | "zeroize", 669 | ] 670 | 671 | [[package]] 672 | name = "encode_unicode" 673 | version = "1.0.0" 674 | source = "registry+https://github.com/rust-lang/crates.io-index" 675 | checksum = "34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0" 676 | 677 | [[package]] 678 | name = "encoding_rs" 679 | version = "0.8.32" 680 | source = "registry+https://github.com/rust-lang/crates.io-index" 681 | checksum = "071a31f4ee85403370b58aca746f01041ede6f0da2730960ad001edc2b71b394" 682 | dependencies = [ 683 | "cfg-if 1.0.0", 684 | ] 685 | 686 | [[package]] 687 | name = "errno" 688 | version = "0.3.1" 689 | source = "registry+https://github.com/rust-lang/crates.io-index" 690 | checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" 691 | dependencies = [ 692 | "errno-dragonfly", 693 | "libc", 694 | "windows-sys 0.48.0", 695 | ] 696 | 697 | [[package]] 698 | name = "errno-dragonfly" 699 | version = "0.1.2" 700 | source = "registry+https://github.com/rust-lang/crates.io-index" 701 | checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" 702 | dependencies = [ 703 | "cc", 704 | "libc", 705 | ] 706 | 707 | [[package]] 708 | name = "fastrand" 709 | version = "1.9.0" 710 | source = "registry+https://github.com/rust-lang/crates.io-index" 711 | checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" 712 | dependencies = [ 713 | "instant", 714 | ] 715 | 716 | [[package]] 717 | name = "fixed-hash" 718 | version = "0.7.0" 719 | source = "registry+https://github.com/rust-lang/crates.io-index" 720 | checksum = "cfcf0ed7fe52a17a03854ec54a9f76d6d84508d1c0e66bc1793301c73fc8493c" 721 | dependencies = [ 722 | "byteorder", 723 | "rand 0.8.5", 724 | "rustc-hex", 725 | "static_assertions", 726 | ] 727 | 728 | [[package]] 729 | name = "fnv" 730 | version = "1.0.7" 731 | source = "registry+https://github.com/rust-lang/crates.io-index" 732 | checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" 733 | 734 | [[package]] 735 | name = "foreign-types" 736 | version = "0.3.2" 737 | source = "registry+https://github.com/rust-lang/crates.io-index" 738 | checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" 739 | dependencies = [ 740 | "foreign-types-shared", 741 | ] 742 | 743 | [[package]] 744 | name = "foreign-types-shared" 745 | version = "0.1.1" 746 | source = "registry+https://github.com/rust-lang/crates.io-index" 747 | checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" 748 | 749 | [[package]] 750 | name = "form_urlencoded" 751 | version = "1.1.0" 752 | source = "registry+https://github.com/rust-lang/crates.io-index" 753 | checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" 754 | dependencies = [ 755 | "percent-encoding", 756 | ] 757 | 758 | [[package]] 759 | name = "funty" 760 | version = "1.1.0" 761 | source = "registry+https://github.com/rust-lang/crates.io-index" 762 | checksum = "fed34cd105917e91daa4da6b3728c47b068749d6a62c59811f06ed2ac71d9da7" 763 | 764 | [[package]] 765 | name = "futures" 766 | version = "0.3.28" 767 | source = "registry+https://github.com/rust-lang/crates.io-index" 768 | checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" 769 | dependencies = [ 770 | "futures-channel", 771 | "futures-core", 772 | "futures-executor", 773 | "futures-io", 774 | "futures-sink", 775 | "futures-task", 776 | "futures-util", 777 | ] 778 | 779 | [[package]] 780 | name = "futures-channel" 781 | version = "0.3.28" 782 | source = "registry+https://github.com/rust-lang/crates.io-index" 783 | checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" 784 | dependencies = [ 785 | "futures-core", 786 | "futures-sink", 787 | ] 788 | 789 | [[package]] 790 | name = "futures-core" 791 | version = "0.3.28" 792 | source = "registry+https://github.com/rust-lang/crates.io-index" 793 | checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" 794 | 795 | [[package]] 796 | name = "futures-executor" 797 | version = "0.3.28" 798 | source = "registry+https://github.com/rust-lang/crates.io-index" 799 | checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" 800 | dependencies = [ 801 | "futures-core", 802 | "futures-task", 803 | "futures-util", 804 | ] 805 | 806 | [[package]] 807 | name = "futures-io" 808 | version = "0.3.28" 809 | source = "registry+https://github.com/rust-lang/crates.io-index" 810 | checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" 811 | 812 | [[package]] 813 | name = "futures-macro" 814 | version = "0.3.28" 815 | source = "registry+https://github.com/rust-lang/crates.io-index" 816 | checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" 817 | dependencies = [ 818 | "proc-macro2", 819 | "quote", 820 | "syn 2.0.15", 821 | ] 822 | 823 | [[package]] 824 | name = "futures-sink" 825 | version = "0.3.28" 826 | source = "registry+https://github.com/rust-lang/crates.io-index" 827 | checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" 828 | 829 | [[package]] 830 | name = "futures-task" 831 | version = "0.3.28" 832 | source = "registry+https://github.com/rust-lang/crates.io-index" 833 | checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" 834 | 835 | [[package]] 836 | name = "futures-util" 837 | version = "0.3.28" 838 | source = "registry+https://github.com/rust-lang/crates.io-index" 839 | checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" 840 | dependencies = [ 841 | "futures-channel", 842 | "futures-core", 843 | "futures-io", 844 | "futures-macro", 845 | "futures-sink", 846 | "futures-task", 847 | "memchr", 848 | "pin-project-lite", 849 | "pin-utils", 850 | "slab", 851 | ] 852 | 853 | [[package]] 854 | name = "generic-array" 855 | version = "0.14.7" 856 | source = "registry+https://github.com/rust-lang/crates.io-index" 857 | checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" 858 | dependencies = [ 859 | "typenum", 860 | "version_check", 861 | ] 862 | 863 | [[package]] 864 | name = "getrandom" 865 | version = "0.1.16" 866 | source = "registry+https://github.com/rust-lang/crates.io-index" 867 | checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" 868 | dependencies = [ 869 | "cfg-if 1.0.0", 870 | "libc", 871 | "wasi 0.9.0+wasi-snapshot-preview1", 872 | ] 873 | 874 | [[package]] 875 | name = "getrandom" 876 | version = "0.2.9" 877 | source = "registry+https://github.com/rust-lang/crates.io-index" 878 | checksum = "c85e1d9ab2eadba7e5040d4e09cbd6d072b76a557ad64e797c2cb9d4da21d7e4" 879 | dependencies = [ 880 | "cfg-if 1.0.0", 881 | "libc", 882 | "wasi 0.11.0+wasi-snapshot-preview1", 883 | ] 884 | 885 | [[package]] 886 | name = "h2" 887 | version = "0.3.18" 888 | source = "registry+https://github.com/rust-lang/crates.io-index" 889 | checksum = "17f8a914c2987b688368b5138aa05321db91f4090cf26118185672ad588bce21" 890 | dependencies = [ 891 | "bytes", 892 | "fnv", 893 | "futures-core", 894 | "futures-sink", 895 | "futures-util", 896 | "http", 897 | "indexmap", 898 | "slab", 899 | "tokio", 900 | "tokio-util", 901 | "tracing", 902 | ] 903 | 904 | [[package]] 905 | name = "hashbrown" 906 | version = "0.11.2" 907 | source = "registry+https://github.com/rust-lang/crates.io-index" 908 | checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" 909 | dependencies = [ 910 | "ahash", 911 | ] 912 | 913 | [[package]] 914 | name = "hashbrown" 915 | version = "0.12.3" 916 | source = "registry+https://github.com/rust-lang/crates.io-index" 917 | checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" 918 | dependencies = [ 919 | "ahash", 920 | ] 921 | 922 | [[package]] 923 | name = "heck" 924 | version = "0.4.1" 925 | source = "registry+https://github.com/rust-lang/crates.io-index" 926 | checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" 927 | 928 | [[package]] 929 | name = "hermit-abi" 930 | version = "0.1.19" 931 | source = "registry+https://github.com/rust-lang/crates.io-index" 932 | checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" 933 | dependencies = [ 934 | "libc", 935 | ] 936 | 937 | [[package]] 938 | name = "hermit-abi" 939 | version = "0.2.6" 940 | source = "registry+https://github.com/rust-lang/crates.io-index" 941 | checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" 942 | dependencies = [ 943 | "libc", 944 | ] 945 | 946 | [[package]] 947 | name = "hermit-abi" 948 | version = "0.3.1" 949 | source = "registry+https://github.com/rust-lang/crates.io-index" 950 | checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" 951 | 952 | [[package]] 953 | name = "hex" 954 | version = "0.4.3" 955 | source = "registry+https://github.com/rust-lang/crates.io-index" 956 | checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" 957 | 958 | [[package]] 959 | name = "http" 960 | version = "0.2.9" 961 | source = "registry+https://github.com/rust-lang/crates.io-index" 962 | checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" 963 | dependencies = [ 964 | "bytes", 965 | "fnv", 966 | "itoa", 967 | ] 968 | 969 | [[package]] 970 | name = "http-body" 971 | version = "0.4.5" 972 | source = "registry+https://github.com/rust-lang/crates.io-index" 973 | checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" 974 | dependencies = [ 975 | "bytes", 976 | "http", 977 | "pin-project-lite", 978 | ] 979 | 980 | [[package]] 981 | name = "httparse" 982 | version = "1.8.0" 983 | source = "registry+https://github.com/rust-lang/crates.io-index" 984 | checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" 985 | 986 | [[package]] 987 | name = "httpdate" 988 | version = "1.0.2" 989 | source = "registry+https://github.com/rust-lang/crates.io-index" 990 | checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" 991 | 992 | [[package]] 993 | name = "hyper" 994 | version = "0.14.26" 995 | source = "registry+https://github.com/rust-lang/crates.io-index" 996 | checksum = "ab302d72a6f11a3b910431ff93aae7e773078c769f0a3ef15fb9ec692ed147d4" 997 | dependencies = [ 998 | "bytes", 999 | "futures-channel", 1000 | "futures-core", 1001 | "futures-util", 1002 | "h2", 1003 | "http", 1004 | "http-body", 1005 | "httparse", 1006 | "httpdate", 1007 | "itoa", 1008 | "pin-project-lite", 1009 | "socket2", 1010 | "tokio", 1011 | "tower-service", 1012 | "tracing", 1013 | "want", 1014 | ] 1015 | 1016 | [[package]] 1017 | name = "hyper-tls" 1018 | version = "0.5.0" 1019 | source = "registry+https://github.com/rust-lang/crates.io-index" 1020 | checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" 1021 | dependencies = [ 1022 | "bytes", 1023 | "hyper", 1024 | "native-tls", 1025 | "tokio", 1026 | "tokio-native-tls", 1027 | ] 1028 | 1029 | [[package]] 1030 | name = "iana-time-zone" 1031 | version = "0.1.56" 1032 | source = "registry+https://github.com/rust-lang/crates.io-index" 1033 | checksum = "0722cd7114b7de04316e7ea5456a0bbb20e4adb46fd27a3697adb812cff0f37c" 1034 | dependencies = [ 1035 | "android_system_properties", 1036 | "core-foundation-sys", 1037 | "iana-time-zone-haiku", 1038 | "js-sys", 1039 | "wasm-bindgen", 1040 | "windows", 1041 | ] 1042 | 1043 | [[package]] 1044 | name = "iana-time-zone-haiku" 1045 | version = "0.1.1" 1046 | source = "registry+https://github.com/rust-lang/crates.io-index" 1047 | checksum = "0703ae284fc167426161c2e3f1da3ea71d94b21bedbcc9494e92b28e334e3dca" 1048 | dependencies = [ 1049 | "cxx", 1050 | "cxx-build", 1051 | ] 1052 | 1053 | [[package]] 1054 | name = "idna" 1055 | version = "0.3.0" 1056 | source = "registry+https://github.com/rust-lang/crates.io-index" 1057 | checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" 1058 | dependencies = [ 1059 | "unicode-bidi", 1060 | "unicode-normalization", 1061 | ] 1062 | 1063 | [[package]] 1064 | name = "impl-codec" 1065 | version = "0.5.1" 1066 | source = "registry+https://github.com/rust-lang/crates.io-index" 1067 | checksum = "161ebdfec3c8e3b52bf61c4f3550a1eea4f9579d10dc1b936f3171ebdcd6c443" 1068 | dependencies = [ 1069 | "parity-scale-codec", 1070 | ] 1071 | 1072 | [[package]] 1073 | name = "impl-trait-for-tuples" 1074 | version = "0.2.2" 1075 | source = "registry+https://github.com/rust-lang/crates.io-index" 1076 | checksum = "11d7a9f6330b71fea57921c9b61c47ee6e84f72d394754eff6163ae67e7395eb" 1077 | dependencies = [ 1078 | "proc-macro2", 1079 | "quote", 1080 | "syn 1.0.109", 1081 | ] 1082 | 1083 | [[package]] 1084 | name = "indexmap" 1085 | version = "1.9.3" 1086 | source = "registry+https://github.com/rust-lang/crates.io-index" 1087 | checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" 1088 | dependencies = [ 1089 | "autocfg", 1090 | "hashbrown 0.12.3", 1091 | ] 1092 | 1093 | [[package]] 1094 | name = "instant" 1095 | version = "0.1.12" 1096 | source = "registry+https://github.com/rust-lang/crates.io-index" 1097 | checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" 1098 | dependencies = [ 1099 | "cfg-if 1.0.0", 1100 | ] 1101 | 1102 | [[package]] 1103 | name = "io-lifetimes" 1104 | version = "1.0.10" 1105 | source = "registry+https://github.com/rust-lang/crates.io-index" 1106 | checksum = "9c66c74d2ae7e79a5a8f7ac924adbe38ee42a859c6539ad869eb51f0b52dc220" 1107 | dependencies = [ 1108 | "hermit-abi 0.3.1", 1109 | "libc", 1110 | "windows-sys 0.48.0", 1111 | ] 1112 | 1113 | [[package]] 1114 | name = "ipnet" 1115 | version = "2.7.2" 1116 | source = "registry+https://github.com/rust-lang/crates.io-index" 1117 | checksum = "12b6ee2129af8d4fb011108c73d99a1b83a85977f23b82460c0ae2e25bb4b57f" 1118 | 1119 | [[package]] 1120 | name = "is-terminal" 1121 | version = "0.4.7" 1122 | source = "registry+https://github.com/rust-lang/crates.io-index" 1123 | checksum = "adcf93614601c8129ddf72e2d5633df827ba6551541c6d8c59520a371475be1f" 1124 | dependencies = [ 1125 | "hermit-abi 0.3.1", 1126 | "io-lifetimes", 1127 | "rustix", 1128 | "windows-sys 0.48.0", 1129 | ] 1130 | 1131 | [[package]] 1132 | name = "itoa" 1133 | version = "1.0.6" 1134 | source = "registry+https://github.com/rust-lang/crates.io-index" 1135 | checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" 1136 | 1137 | [[package]] 1138 | name = "js-sys" 1139 | version = "0.3.61" 1140 | source = "registry+https://github.com/rust-lang/crates.io-index" 1141 | checksum = "445dde2150c55e483f3d8416706b97ec8e8237c307e5b7b4b8dd15e6af2a0730" 1142 | dependencies = [ 1143 | "wasm-bindgen", 1144 | ] 1145 | 1146 | [[package]] 1147 | name = "keccak" 1148 | version = "0.1.4" 1149 | source = "registry+https://github.com/rust-lang/crates.io-index" 1150 | checksum = "8f6d5ed8676d904364de097082f4e7d240b571b67989ced0240f08b7f966f940" 1151 | dependencies = [ 1152 | "cpufeatures", 1153 | ] 1154 | 1155 | [[package]] 1156 | name = "lazy_static" 1157 | version = "1.4.0" 1158 | source = "registry+https://github.com/rust-lang/crates.io-index" 1159 | checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" 1160 | dependencies = [ 1161 | "spin", 1162 | ] 1163 | 1164 | [[package]] 1165 | name = "libc" 1166 | version = "0.2.144" 1167 | source = "registry+https://github.com/rust-lang/crates.io-index" 1168 | checksum = "2b00cc1c228a6782d0f076e7b232802e0c5689d41bb5df366f2a6b6621cfdfe1" 1169 | 1170 | [[package]] 1171 | name = "link-cplusplus" 1172 | version = "1.0.8" 1173 | source = "registry+https://github.com/rust-lang/crates.io-index" 1174 | checksum = "ecd207c9c713c34f95a097a5b029ac2ce6010530c7b49d7fea24d977dede04f5" 1175 | dependencies = [ 1176 | "cc", 1177 | ] 1178 | 1179 | [[package]] 1180 | name = "linux-raw-sys" 1181 | version = "0.3.7" 1182 | source = "registry+https://github.com/rust-lang/crates.io-index" 1183 | checksum = "ece97ea872ece730aed82664c424eb4c8291e1ff2480247ccf7409044bc6479f" 1184 | 1185 | [[package]] 1186 | name = "lock_api" 1187 | version = "0.4.9" 1188 | source = "registry+https://github.com/rust-lang/crates.io-index" 1189 | checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" 1190 | dependencies = [ 1191 | "autocfg", 1192 | "scopeguard", 1193 | ] 1194 | 1195 | [[package]] 1196 | name = "log" 1197 | version = "0.4.17" 1198 | source = "registry+https://github.com/rust-lang/crates.io-index" 1199 | checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" 1200 | dependencies = [ 1201 | "cfg-if 1.0.0", 1202 | ] 1203 | 1204 | [[package]] 1205 | name = "memchr" 1206 | version = "2.5.0" 1207 | source = "registry+https://github.com/rust-lang/crates.io-index" 1208 | checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" 1209 | 1210 | [[package]] 1211 | name = "memory_units" 1212 | version = "0.4.0" 1213 | source = "registry+https://github.com/rust-lang/crates.io-index" 1214 | checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" 1215 | 1216 | [[package]] 1217 | name = "mime" 1218 | version = "0.3.17" 1219 | source = "registry+https://github.com/rust-lang/crates.io-index" 1220 | checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" 1221 | 1222 | [[package]] 1223 | name = "mio" 1224 | version = "0.8.6" 1225 | source = "registry+https://github.com/rust-lang/crates.io-index" 1226 | checksum = "5b9d9a46eff5b4ff64b45a9e316a6d1e0bc719ef429cbec4dc630684212bfdf9" 1227 | dependencies = [ 1228 | "libc", 1229 | "log", 1230 | "wasi 0.11.0+wasi-snapshot-preview1", 1231 | "windows-sys 0.45.0", 1232 | ] 1233 | 1234 | [[package]] 1235 | name = "native-tls" 1236 | version = "0.2.11" 1237 | source = "registry+https://github.com/rust-lang/crates.io-index" 1238 | checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" 1239 | dependencies = [ 1240 | "lazy_static", 1241 | "libc", 1242 | "log", 1243 | "openssl", 1244 | "openssl-probe", 1245 | "openssl-sys", 1246 | "schannel", 1247 | "security-framework", 1248 | "security-framework-sys", 1249 | "tempfile", 1250 | ] 1251 | 1252 | [[package]] 1253 | name = "near-abi" 1254 | version = "0.3.0" 1255 | source = "registry+https://github.com/rust-lang/crates.io-index" 1256 | checksum = "885db39b08518fa700b73fa2214e8adbbfba316ba82dd510f50519173eadaf73" 1257 | dependencies = [ 1258 | "borsh 0.9.3", 1259 | "schemars", 1260 | "semver", 1261 | "serde", 1262 | ] 1263 | 1264 | [[package]] 1265 | name = "near-account-id" 1266 | version = "0.14.0" 1267 | source = "registry+https://github.com/rust-lang/crates.io-index" 1268 | checksum = "71d258582a1878e6db67400b0504a5099db85718d22c2e07f747fe1706ae7150" 1269 | dependencies = [ 1270 | "borsh 0.9.3", 1271 | "serde", 1272 | ] 1273 | 1274 | [[package]] 1275 | name = "near-crypto" 1276 | version = "0.14.0" 1277 | source = "registry+https://github.com/rust-lang/crates.io-index" 1278 | checksum = "1e75673d69fd7365508f3d32483669fe45b03bfb34e4d9363e90adae9dfb416c" 1279 | dependencies = [ 1280 | "arrayref", 1281 | "blake2", 1282 | "borsh 0.9.3", 1283 | "bs58", 1284 | "c2-chacha", 1285 | "curve25519-dalek", 1286 | "derive_more", 1287 | "ed25519-dalek", 1288 | "near-account-id", 1289 | "once_cell", 1290 | "parity-secp256k1", 1291 | "primitive-types", 1292 | "rand 0.7.3", 1293 | "rand_core 0.5.1", 1294 | "serde", 1295 | "serde_json", 1296 | "subtle", 1297 | "thiserror", 1298 | ] 1299 | 1300 | [[package]] 1301 | name = "near-primitives" 1302 | version = "0.14.0" 1303 | source = "registry+https://github.com/rust-lang/crates.io-index" 1304 | checksum = "8ad1a9a1640539c81f065425c31bffcfbf6b31ef1aeaade59ce905f5df6ac860" 1305 | dependencies = [ 1306 | "borsh 0.9.3", 1307 | "byteorder", 1308 | "bytesize", 1309 | "chrono", 1310 | "derive_more", 1311 | "easy-ext", 1312 | "hex", 1313 | "near-crypto", 1314 | "near-primitives-core", 1315 | "near-rpc-error-macro", 1316 | "near-vm-errors", 1317 | "num-rational", 1318 | "once_cell", 1319 | "primitive-types", 1320 | "rand 0.7.3", 1321 | "reed-solomon-erasure", 1322 | "serde", 1323 | "serde_json", 1324 | "smart-default", 1325 | "strum", 1326 | "thiserror", 1327 | ] 1328 | 1329 | [[package]] 1330 | name = "near-primitives-core" 1331 | version = "0.14.0" 1332 | source = "registry+https://github.com/rust-lang/crates.io-index" 1333 | checksum = "91d508f0fc340f6461e4e256417685720d3c4c00bb5a939b105160e49137caba" 1334 | dependencies = [ 1335 | "base64 0.11.0", 1336 | "borsh 0.9.3", 1337 | "bs58", 1338 | "derive_more", 1339 | "near-account-id", 1340 | "num-rational", 1341 | "serde", 1342 | "sha2 0.10.6", 1343 | "strum", 1344 | ] 1345 | 1346 | [[package]] 1347 | name = "near-rewards" 1348 | version = "0.6.1" 1349 | dependencies = [ 1350 | "base64 0.21.0", 1351 | "borsh 0.10.3", 1352 | "clap", 1353 | "colored", 1354 | "dirs", 1355 | "futures", 1356 | "near-sdk", 1357 | "prettytable-rs", 1358 | "reqwest", 1359 | "serde", 1360 | "serde_json", 1361 | "tokio", 1362 | "uint", 1363 | ] 1364 | 1365 | [[package]] 1366 | name = "near-rpc-error-core" 1367 | version = "0.14.0" 1368 | source = "registry+https://github.com/rust-lang/crates.io-index" 1369 | checksum = "93ee0b41c75ef859c193a8ff1dadfa0c8207bc0ac447cc22259721ad769a1408" 1370 | dependencies = [ 1371 | "quote", 1372 | "serde", 1373 | "syn 1.0.109", 1374 | ] 1375 | 1376 | [[package]] 1377 | name = "near-rpc-error-macro" 1378 | version = "0.14.0" 1379 | source = "registry+https://github.com/rust-lang/crates.io-index" 1380 | checksum = "8e837bd4bacd807073ec5ceb85708da7f721b46a4c2a978de86027fb0034ce31" 1381 | dependencies = [ 1382 | "near-rpc-error-core", 1383 | "serde", 1384 | "syn 1.0.109", 1385 | ] 1386 | 1387 | [[package]] 1388 | name = "near-sdk" 1389 | version = "4.1.1" 1390 | source = "registry+https://github.com/rust-lang/crates.io-index" 1391 | checksum = "15eb3de2defe3626260cc209a6cdb985c6b27b0bd4619fad97dcfae002c3c5bd" 1392 | dependencies = [ 1393 | "base64 0.13.1", 1394 | "borsh 0.9.3", 1395 | "bs58", 1396 | "near-abi", 1397 | "near-crypto", 1398 | "near-primitives", 1399 | "near-primitives-core", 1400 | "near-sdk-macros", 1401 | "near-sys", 1402 | "near-vm-logic", 1403 | "once_cell", 1404 | "schemars", 1405 | "serde", 1406 | "serde_json", 1407 | "wee_alloc", 1408 | ] 1409 | 1410 | [[package]] 1411 | name = "near-sdk-macros" 1412 | version = "4.1.1" 1413 | source = "registry+https://github.com/rust-lang/crates.io-index" 1414 | checksum = "4907affc9f5ed559456509188ff0024f1f2099c0830e6bdb66eb61d5b75912c0" 1415 | dependencies = [ 1416 | "Inflector", 1417 | "proc-macro2", 1418 | "quote", 1419 | "syn 1.0.109", 1420 | ] 1421 | 1422 | [[package]] 1423 | name = "near-sys" 1424 | version = "0.2.0" 1425 | source = "registry+https://github.com/rust-lang/crates.io-index" 1426 | checksum = "e307313276eaeced2ca95740b5639e1f3125b7c97f0a1151809d105f1aa8c6d3" 1427 | 1428 | [[package]] 1429 | name = "near-vm-errors" 1430 | version = "0.14.0" 1431 | source = "registry+https://github.com/rust-lang/crates.io-index" 1432 | checksum = "d0da466a30f0446639cbd788c30865086fac3e8dcb07a79e51d2b0775ed4261e" 1433 | dependencies = [ 1434 | "borsh 0.9.3", 1435 | "near-account-id", 1436 | "near-rpc-error-macro", 1437 | "serde", 1438 | ] 1439 | 1440 | [[package]] 1441 | name = "near-vm-logic" 1442 | version = "0.14.0" 1443 | source = "registry+https://github.com/rust-lang/crates.io-index" 1444 | checksum = "81b534828419bacbf1f7b11ef7b00420f248c548c485d3f0cfda8bb6931152f2" 1445 | dependencies = [ 1446 | "base64 0.13.1", 1447 | "borsh 0.9.3", 1448 | "bs58", 1449 | "byteorder", 1450 | "near-account-id", 1451 | "near-crypto", 1452 | "near-primitives", 1453 | "near-primitives-core", 1454 | "near-vm-errors", 1455 | "ripemd", 1456 | "serde", 1457 | "sha2 0.10.6", 1458 | "sha3", 1459 | "zeropool-bn", 1460 | ] 1461 | 1462 | [[package]] 1463 | name = "num-bigint" 1464 | version = "0.3.3" 1465 | source = "registry+https://github.com/rust-lang/crates.io-index" 1466 | checksum = "5f6f7833f2cbf2360a6cfd58cd41a53aa7a90bd4c202f5b1c7dd2ed73c57b2c3" 1467 | dependencies = [ 1468 | "autocfg", 1469 | "num-integer", 1470 | "num-traits", 1471 | ] 1472 | 1473 | [[package]] 1474 | name = "num-integer" 1475 | version = "0.1.45" 1476 | source = "registry+https://github.com/rust-lang/crates.io-index" 1477 | checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" 1478 | dependencies = [ 1479 | "autocfg", 1480 | "num-traits", 1481 | ] 1482 | 1483 | [[package]] 1484 | name = "num-rational" 1485 | version = "0.3.2" 1486 | source = "registry+https://github.com/rust-lang/crates.io-index" 1487 | checksum = "12ac428b1cb17fce6f731001d307d351ec70a6d202fc2e60f7d4c5e42d8f4f07" 1488 | dependencies = [ 1489 | "autocfg", 1490 | "num-bigint", 1491 | "num-integer", 1492 | "num-traits", 1493 | "serde", 1494 | ] 1495 | 1496 | [[package]] 1497 | name = "num-traits" 1498 | version = "0.2.15" 1499 | source = "registry+https://github.com/rust-lang/crates.io-index" 1500 | checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" 1501 | dependencies = [ 1502 | "autocfg", 1503 | ] 1504 | 1505 | [[package]] 1506 | name = "num_cpus" 1507 | version = "1.15.0" 1508 | source = "registry+https://github.com/rust-lang/crates.io-index" 1509 | checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" 1510 | dependencies = [ 1511 | "hermit-abi 0.2.6", 1512 | "libc", 1513 | ] 1514 | 1515 | [[package]] 1516 | name = "once_cell" 1517 | version = "1.17.1" 1518 | source = "registry+https://github.com/rust-lang/crates.io-index" 1519 | checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" 1520 | 1521 | [[package]] 1522 | name = "opaque-debug" 1523 | version = "0.3.0" 1524 | source = "registry+https://github.com/rust-lang/crates.io-index" 1525 | checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" 1526 | 1527 | [[package]] 1528 | name = "openssl" 1529 | version = "0.10.52" 1530 | source = "registry+https://github.com/rust-lang/crates.io-index" 1531 | checksum = "01b8574602df80f7b85fdfc5392fa884a4e3b3f4f35402c070ab34c3d3f78d56" 1532 | dependencies = [ 1533 | "bitflags", 1534 | "cfg-if 1.0.0", 1535 | "foreign-types", 1536 | "libc", 1537 | "once_cell", 1538 | "openssl-macros", 1539 | "openssl-sys", 1540 | ] 1541 | 1542 | [[package]] 1543 | name = "openssl-macros" 1544 | version = "0.1.1" 1545 | source = "registry+https://github.com/rust-lang/crates.io-index" 1546 | checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" 1547 | dependencies = [ 1548 | "proc-macro2", 1549 | "quote", 1550 | "syn 2.0.15", 1551 | ] 1552 | 1553 | [[package]] 1554 | name = "openssl-probe" 1555 | version = "0.1.5" 1556 | source = "registry+https://github.com/rust-lang/crates.io-index" 1557 | checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" 1558 | 1559 | [[package]] 1560 | name = "openssl-sys" 1561 | version = "0.9.87" 1562 | source = "registry+https://github.com/rust-lang/crates.io-index" 1563 | checksum = "8e17f59264b2809d77ae94f0e1ebabc434773f370d6ca667bd223ea10e06cc7e" 1564 | dependencies = [ 1565 | "cc", 1566 | "libc", 1567 | "pkg-config", 1568 | "vcpkg", 1569 | ] 1570 | 1571 | [[package]] 1572 | name = "parity-scale-codec" 1573 | version = "2.3.1" 1574 | source = "registry+https://github.com/rust-lang/crates.io-index" 1575 | checksum = "373b1a4c1338d9cd3d1fa53b3a11bdab5ab6bd80a20f7f7becd76953ae2be909" 1576 | dependencies = [ 1577 | "arrayvec 0.7.2", 1578 | "bitvec", 1579 | "byte-slice-cast", 1580 | "impl-trait-for-tuples", 1581 | "parity-scale-codec-derive", 1582 | "serde", 1583 | ] 1584 | 1585 | [[package]] 1586 | name = "parity-scale-codec-derive" 1587 | version = "2.3.1" 1588 | source = "registry+https://github.com/rust-lang/crates.io-index" 1589 | checksum = "1557010476e0595c9b568d16dcfb81b93cdeb157612726f5170d31aa707bed27" 1590 | dependencies = [ 1591 | "proc-macro-crate 1.3.1", 1592 | "proc-macro2", 1593 | "quote", 1594 | "syn 1.0.109", 1595 | ] 1596 | 1597 | [[package]] 1598 | name = "parity-secp256k1" 1599 | version = "0.7.0" 1600 | source = "registry+https://github.com/rust-lang/crates.io-index" 1601 | checksum = "4fca4f82fccae37e8bbdaeb949a4a218a1bbc485d11598f193d2a908042e5fc1" 1602 | dependencies = [ 1603 | "arrayvec 0.5.2", 1604 | "cc", 1605 | "cfg-if 0.1.10", 1606 | "rand 0.7.3", 1607 | ] 1608 | 1609 | [[package]] 1610 | name = "parking_lot" 1611 | version = "0.12.1" 1612 | source = "registry+https://github.com/rust-lang/crates.io-index" 1613 | checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" 1614 | dependencies = [ 1615 | "lock_api", 1616 | "parking_lot_core", 1617 | ] 1618 | 1619 | [[package]] 1620 | name = "parking_lot_core" 1621 | version = "0.9.7" 1622 | source = "registry+https://github.com/rust-lang/crates.io-index" 1623 | checksum = "9069cbb9f99e3a5083476ccb29ceb1de18b9118cafa53e90c9551235de2b9521" 1624 | dependencies = [ 1625 | "cfg-if 1.0.0", 1626 | "libc", 1627 | "redox_syscall 0.2.16", 1628 | "smallvec", 1629 | "windows-sys 0.45.0", 1630 | ] 1631 | 1632 | [[package]] 1633 | name = "percent-encoding" 1634 | version = "2.2.0" 1635 | source = "registry+https://github.com/rust-lang/crates.io-index" 1636 | checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" 1637 | 1638 | [[package]] 1639 | name = "pin-project-lite" 1640 | version = "0.2.9" 1641 | source = "registry+https://github.com/rust-lang/crates.io-index" 1642 | checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" 1643 | 1644 | [[package]] 1645 | name = "pin-utils" 1646 | version = "0.1.0" 1647 | source = "registry+https://github.com/rust-lang/crates.io-index" 1648 | checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" 1649 | 1650 | [[package]] 1651 | name = "pkg-config" 1652 | version = "0.3.27" 1653 | source = "registry+https://github.com/rust-lang/crates.io-index" 1654 | checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" 1655 | 1656 | [[package]] 1657 | name = "ppv-lite86" 1658 | version = "0.2.17" 1659 | source = "registry+https://github.com/rust-lang/crates.io-index" 1660 | checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" 1661 | 1662 | [[package]] 1663 | name = "prettytable-rs" 1664 | version = "0.10.0" 1665 | source = "registry+https://github.com/rust-lang/crates.io-index" 1666 | checksum = "eea25e07510aa6ab6547308ebe3c036016d162b8da920dbb079e3ba8acf3d95a" 1667 | dependencies = [ 1668 | "csv", 1669 | "encode_unicode", 1670 | "is-terminal", 1671 | "lazy_static", 1672 | "term", 1673 | "unicode-width", 1674 | ] 1675 | 1676 | [[package]] 1677 | name = "primitive-types" 1678 | version = "0.10.1" 1679 | source = "registry+https://github.com/rust-lang/crates.io-index" 1680 | checksum = "05e4722c697a58a99d5d06a08c30821d7c082a4632198de1eaa5a6c22ef42373" 1681 | dependencies = [ 1682 | "fixed-hash", 1683 | "impl-codec", 1684 | "uint", 1685 | ] 1686 | 1687 | [[package]] 1688 | name = "proc-macro-crate" 1689 | version = "0.1.5" 1690 | source = "registry+https://github.com/rust-lang/crates.io-index" 1691 | checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785" 1692 | dependencies = [ 1693 | "toml", 1694 | ] 1695 | 1696 | [[package]] 1697 | name = "proc-macro-crate" 1698 | version = "1.3.1" 1699 | source = "registry+https://github.com/rust-lang/crates.io-index" 1700 | checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" 1701 | dependencies = [ 1702 | "once_cell", 1703 | "toml_edit", 1704 | ] 1705 | 1706 | [[package]] 1707 | name = "proc-macro2" 1708 | version = "1.0.56" 1709 | source = "registry+https://github.com/rust-lang/crates.io-index" 1710 | checksum = "2b63bdb0cd06f1f4dedf69b254734f9b45af66e4a031e42a7480257d9898b435" 1711 | dependencies = [ 1712 | "unicode-ident", 1713 | ] 1714 | 1715 | [[package]] 1716 | name = "quote" 1717 | version = "1.0.26" 1718 | source = "registry+https://github.com/rust-lang/crates.io-index" 1719 | checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc" 1720 | dependencies = [ 1721 | "proc-macro2", 1722 | ] 1723 | 1724 | [[package]] 1725 | name = "radium" 1726 | version = "0.6.2" 1727 | source = "registry+https://github.com/rust-lang/crates.io-index" 1728 | checksum = "643f8f41a8ebc4c5dc4515c82bb8abd397b527fc20fd681b7c011c2aee5d44fb" 1729 | 1730 | [[package]] 1731 | name = "rand" 1732 | version = "0.7.3" 1733 | source = "registry+https://github.com/rust-lang/crates.io-index" 1734 | checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" 1735 | dependencies = [ 1736 | "getrandom 0.1.16", 1737 | "libc", 1738 | "rand_chacha 0.2.2", 1739 | "rand_core 0.5.1", 1740 | "rand_hc", 1741 | ] 1742 | 1743 | [[package]] 1744 | name = "rand" 1745 | version = "0.8.5" 1746 | source = "registry+https://github.com/rust-lang/crates.io-index" 1747 | checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" 1748 | dependencies = [ 1749 | "libc", 1750 | "rand_chacha 0.3.1", 1751 | "rand_core 0.6.4", 1752 | ] 1753 | 1754 | [[package]] 1755 | name = "rand_chacha" 1756 | version = "0.2.2" 1757 | source = "registry+https://github.com/rust-lang/crates.io-index" 1758 | checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" 1759 | dependencies = [ 1760 | "ppv-lite86", 1761 | "rand_core 0.5.1", 1762 | ] 1763 | 1764 | [[package]] 1765 | name = "rand_chacha" 1766 | version = "0.3.1" 1767 | source = "registry+https://github.com/rust-lang/crates.io-index" 1768 | checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" 1769 | dependencies = [ 1770 | "ppv-lite86", 1771 | "rand_core 0.6.4", 1772 | ] 1773 | 1774 | [[package]] 1775 | name = "rand_core" 1776 | version = "0.5.1" 1777 | source = "registry+https://github.com/rust-lang/crates.io-index" 1778 | checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" 1779 | dependencies = [ 1780 | "getrandom 0.1.16", 1781 | ] 1782 | 1783 | [[package]] 1784 | name = "rand_core" 1785 | version = "0.6.4" 1786 | source = "registry+https://github.com/rust-lang/crates.io-index" 1787 | checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" 1788 | dependencies = [ 1789 | "getrandom 0.2.9", 1790 | ] 1791 | 1792 | [[package]] 1793 | name = "rand_hc" 1794 | version = "0.2.0" 1795 | source = "registry+https://github.com/rust-lang/crates.io-index" 1796 | checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" 1797 | dependencies = [ 1798 | "rand_core 0.5.1", 1799 | ] 1800 | 1801 | [[package]] 1802 | name = "redox_syscall" 1803 | version = "0.2.16" 1804 | source = "registry+https://github.com/rust-lang/crates.io-index" 1805 | checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" 1806 | dependencies = [ 1807 | "bitflags", 1808 | ] 1809 | 1810 | [[package]] 1811 | name = "redox_syscall" 1812 | version = "0.3.5" 1813 | source = "registry+https://github.com/rust-lang/crates.io-index" 1814 | checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" 1815 | dependencies = [ 1816 | "bitflags", 1817 | ] 1818 | 1819 | [[package]] 1820 | name = "redox_users" 1821 | version = "0.4.3" 1822 | source = "registry+https://github.com/rust-lang/crates.io-index" 1823 | checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" 1824 | dependencies = [ 1825 | "getrandom 0.2.9", 1826 | "redox_syscall 0.2.16", 1827 | "thiserror", 1828 | ] 1829 | 1830 | [[package]] 1831 | name = "reed-solomon-erasure" 1832 | version = "4.0.2" 1833 | source = "registry+https://github.com/rust-lang/crates.io-index" 1834 | checksum = "a415a013dd7c5d4221382329a5a3482566da675737494935cbbbcdec04662f9d" 1835 | dependencies = [ 1836 | "smallvec", 1837 | ] 1838 | 1839 | [[package]] 1840 | name = "reqwest" 1841 | version = "0.11.17" 1842 | source = "registry+https://github.com/rust-lang/crates.io-index" 1843 | checksum = "13293b639a097af28fc8a90f22add145a9c954e49d77da06263d58cf44d5fb91" 1844 | dependencies = [ 1845 | "base64 0.21.0", 1846 | "bytes", 1847 | "encoding_rs", 1848 | "futures-core", 1849 | "futures-util", 1850 | "h2", 1851 | "http", 1852 | "http-body", 1853 | "hyper", 1854 | "hyper-tls", 1855 | "ipnet", 1856 | "js-sys", 1857 | "log", 1858 | "mime", 1859 | "native-tls", 1860 | "once_cell", 1861 | "percent-encoding", 1862 | "pin-project-lite", 1863 | "serde", 1864 | "serde_json", 1865 | "serde_urlencoded", 1866 | "tokio", 1867 | "tokio-native-tls", 1868 | "tower-service", 1869 | "url", 1870 | "wasm-bindgen", 1871 | "wasm-bindgen-futures", 1872 | "web-sys", 1873 | "winreg", 1874 | ] 1875 | 1876 | [[package]] 1877 | name = "ripemd" 1878 | version = "0.1.3" 1879 | source = "registry+https://github.com/rust-lang/crates.io-index" 1880 | checksum = "bd124222d17ad93a644ed9d011a40f4fb64aa54275c08cc216524a9ea82fb09f" 1881 | dependencies = [ 1882 | "digest 0.10.6", 1883 | ] 1884 | 1885 | [[package]] 1886 | name = "rustc-hex" 1887 | version = "2.1.0" 1888 | source = "registry+https://github.com/rust-lang/crates.io-index" 1889 | checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" 1890 | 1891 | [[package]] 1892 | name = "rustc_version" 1893 | version = "0.4.0" 1894 | source = "registry+https://github.com/rust-lang/crates.io-index" 1895 | checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" 1896 | dependencies = [ 1897 | "semver", 1898 | ] 1899 | 1900 | [[package]] 1901 | name = "rustix" 1902 | version = "0.37.19" 1903 | source = "registry+https://github.com/rust-lang/crates.io-index" 1904 | checksum = "acf8729d8542766f1b2cf77eb034d52f40d375bb8b615d0b147089946e16613d" 1905 | dependencies = [ 1906 | "bitflags", 1907 | "errno", 1908 | "io-lifetimes", 1909 | "libc", 1910 | "linux-raw-sys", 1911 | "windows-sys 0.48.0", 1912 | ] 1913 | 1914 | [[package]] 1915 | name = "rustversion" 1916 | version = "1.0.12" 1917 | source = "registry+https://github.com/rust-lang/crates.io-index" 1918 | checksum = "4f3208ce4d8448b3f3e7d168a73f5e0c43a61e32930de3bceeccedb388b6bf06" 1919 | 1920 | [[package]] 1921 | name = "ryu" 1922 | version = "1.0.13" 1923 | source = "registry+https://github.com/rust-lang/crates.io-index" 1924 | checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" 1925 | 1926 | [[package]] 1927 | name = "schannel" 1928 | version = "0.1.21" 1929 | source = "registry+https://github.com/rust-lang/crates.io-index" 1930 | checksum = "713cfb06c7059f3588fb8044c0fad1d09e3c01d225e25b9220dbfdcf16dbb1b3" 1931 | dependencies = [ 1932 | "windows-sys 0.42.0", 1933 | ] 1934 | 1935 | [[package]] 1936 | name = "schemars" 1937 | version = "0.8.12" 1938 | source = "registry+https://github.com/rust-lang/crates.io-index" 1939 | checksum = "02c613288622e5f0c3fdc5dbd4db1c5fbe752746b1d1a56a0630b78fd00de44f" 1940 | dependencies = [ 1941 | "dyn-clone", 1942 | "schemars_derive", 1943 | "serde", 1944 | "serde_json", 1945 | ] 1946 | 1947 | [[package]] 1948 | name = "schemars_derive" 1949 | version = "0.8.12" 1950 | source = "registry+https://github.com/rust-lang/crates.io-index" 1951 | checksum = "109da1e6b197438deb6db99952990c7f959572794b80ff93707d55a232545e7c" 1952 | dependencies = [ 1953 | "proc-macro2", 1954 | "quote", 1955 | "serde_derive_internals", 1956 | "syn 1.0.109", 1957 | ] 1958 | 1959 | [[package]] 1960 | name = "scopeguard" 1961 | version = "1.1.0" 1962 | source = "registry+https://github.com/rust-lang/crates.io-index" 1963 | checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" 1964 | 1965 | [[package]] 1966 | name = "scratch" 1967 | version = "1.0.5" 1968 | source = "registry+https://github.com/rust-lang/crates.io-index" 1969 | checksum = "1792db035ce95be60c3f8853017b3999209281c24e2ba5bc8e59bf97a0c590c1" 1970 | 1971 | [[package]] 1972 | name = "security-framework" 1973 | version = "2.8.2" 1974 | source = "registry+https://github.com/rust-lang/crates.io-index" 1975 | checksum = "a332be01508d814fed64bf28f798a146d73792121129962fdf335bb3c49a4254" 1976 | dependencies = [ 1977 | "bitflags", 1978 | "core-foundation", 1979 | "core-foundation-sys", 1980 | "libc", 1981 | "security-framework-sys", 1982 | ] 1983 | 1984 | [[package]] 1985 | name = "security-framework-sys" 1986 | version = "2.8.0" 1987 | source = "registry+https://github.com/rust-lang/crates.io-index" 1988 | checksum = "31c9bb296072e961fcbd8853511dd39c2d8be2deb1e17c6860b1d30732b323b4" 1989 | dependencies = [ 1990 | "core-foundation-sys", 1991 | "libc", 1992 | ] 1993 | 1994 | [[package]] 1995 | name = "semver" 1996 | version = "1.0.17" 1997 | source = "registry+https://github.com/rust-lang/crates.io-index" 1998 | checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed" 1999 | 2000 | [[package]] 2001 | name = "serde" 2002 | version = "1.0.162" 2003 | source = "registry+https://github.com/rust-lang/crates.io-index" 2004 | checksum = "71b2f6e1ab5c2b98c05f0f35b236b22e8df7ead6ffbf51d7808da7f8817e7ab6" 2005 | dependencies = [ 2006 | "serde_derive", 2007 | ] 2008 | 2009 | [[package]] 2010 | name = "serde_derive" 2011 | version = "1.0.162" 2012 | source = "registry+https://github.com/rust-lang/crates.io-index" 2013 | checksum = "a2a0814352fd64b58489904a44ea8d90cb1a91dcb6b4f5ebabc32c8318e93cb6" 2014 | dependencies = [ 2015 | "proc-macro2", 2016 | "quote", 2017 | "syn 2.0.15", 2018 | ] 2019 | 2020 | [[package]] 2021 | name = "serde_derive_internals" 2022 | version = "0.26.0" 2023 | source = "registry+https://github.com/rust-lang/crates.io-index" 2024 | checksum = "85bf8229e7920a9f636479437026331ce11aa132b4dde37d121944a44d6e5f3c" 2025 | dependencies = [ 2026 | "proc-macro2", 2027 | "quote", 2028 | "syn 1.0.109", 2029 | ] 2030 | 2031 | [[package]] 2032 | name = "serde_json" 2033 | version = "1.0.96" 2034 | source = "registry+https://github.com/rust-lang/crates.io-index" 2035 | checksum = "057d394a50403bcac12672b2b18fb387ab6d289d957dab67dd201875391e52f1" 2036 | dependencies = [ 2037 | "itoa", 2038 | "ryu", 2039 | "serde", 2040 | ] 2041 | 2042 | [[package]] 2043 | name = "serde_urlencoded" 2044 | version = "0.7.1" 2045 | source = "registry+https://github.com/rust-lang/crates.io-index" 2046 | checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" 2047 | dependencies = [ 2048 | "form_urlencoded", 2049 | "itoa", 2050 | "ryu", 2051 | "serde", 2052 | ] 2053 | 2054 | [[package]] 2055 | name = "sha2" 2056 | version = "0.9.9" 2057 | source = "registry+https://github.com/rust-lang/crates.io-index" 2058 | checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" 2059 | dependencies = [ 2060 | "block-buffer 0.9.0", 2061 | "cfg-if 1.0.0", 2062 | "cpufeatures", 2063 | "digest 0.9.0", 2064 | "opaque-debug", 2065 | ] 2066 | 2067 | [[package]] 2068 | name = "sha2" 2069 | version = "0.10.6" 2070 | source = "registry+https://github.com/rust-lang/crates.io-index" 2071 | checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" 2072 | dependencies = [ 2073 | "cfg-if 1.0.0", 2074 | "cpufeatures", 2075 | "digest 0.10.6", 2076 | ] 2077 | 2078 | [[package]] 2079 | name = "sha3" 2080 | version = "0.10.8" 2081 | source = "registry+https://github.com/rust-lang/crates.io-index" 2082 | checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" 2083 | dependencies = [ 2084 | "digest 0.10.6", 2085 | "keccak", 2086 | ] 2087 | 2088 | [[package]] 2089 | name = "signal-hook-registry" 2090 | version = "1.4.1" 2091 | source = "registry+https://github.com/rust-lang/crates.io-index" 2092 | checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" 2093 | dependencies = [ 2094 | "libc", 2095 | ] 2096 | 2097 | [[package]] 2098 | name = "signature" 2099 | version = "1.6.4" 2100 | source = "registry+https://github.com/rust-lang/crates.io-index" 2101 | checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" 2102 | 2103 | [[package]] 2104 | name = "slab" 2105 | version = "0.4.8" 2106 | source = "registry+https://github.com/rust-lang/crates.io-index" 2107 | checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" 2108 | dependencies = [ 2109 | "autocfg", 2110 | ] 2111 | 2112 | [[package]] 2113 | name = "smallvec" 2114 | version = "1.10.0" 2115 | source = "registry+https://github.com/rust-lang/crates.io-index" 2116 | checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" 2117 | 2118 | [[package]] 2119 | name = "smart-default" 2120 | version = "0.6.0" 2121 | source = "registry+https://github.com/rust-lang/crates.io-index" 2122 | checksum = "133659a15339456eeeb07572eb02a91c91e9815e9cbc89566944d2c8d3efdbf6" 2123 | dependencies = [ 2124 | "proc-macro2", 2125 | "quote", 2126 | "syn 1.0.109", 2127 | ] 2128 | 2129 | [[package]] 2130 | name = "socket2" 2131 | version = "0.4.9" 2132 | source = "registry+https://github.com/rust-lang/crates.io-index" 2133 | checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" 2134 | dependencies = [ 2135 | "libc", 2136 | "winapi", 2137 | ] 2138 | 2139 | [[package]] 2140 | name = "spin" 2141 | version = "0.5.2" 2142 | source = "registry+https://github.com/rust-lang/crates.io-index" 2143 | checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" 2144 | 2145 | [[package]] 2146 | name = "static_assertions" 2147 | version = "1.1.0" 2148 | source = "registry+https://github.com/rust-lang/crates.io-index" 2149 | checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" 2150 | 2151 | [[package]] 2152 | name = "strsim" 2153 | version = "0.10.0" 2154 | source = "registry+https://github.com/rust-lang/crates.io-index" 2155 | checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" 2156 | 2157 | [[package]] 2158 | name = "strum" 2159 | version = "0.24.1" 2160 | source = "registry+https://github.com/rust-lang/crates.io-index" 2161 | checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" 2162 | dependencies = [ 2163 | "strum_macros", 2164 | ] 2165 | 2166 | [[package]] 2167 | name = "strum_macros" 2168 | version = "0.24.3" 2169 | source = "registry+https://github.com/rust-lang/crates.io-index" 2170 | checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" 2171 | dependencies = [ 2172 | "heck", 2173 | "proc-macro2", 2174 | "quote", 2175 | "rustversion", 2176 | "syn 1.0.109", 2177 | ] 2178 | 2179 | [[package]] 2180 | name = "subtle" 2181 | version = "2.5.0" 2182 | source = "registry+https://github.com/rust-lang/crates.io-index" 2183 | checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" 2184 | 2185 | [[package]] 2186 | name = "syn" 2187 | version = "1.0.109" 2188 | source = "registry+https://github.com/rust-lang/crates.io-index" 2189 | checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" 2190 | dependencies = [ 2191 | "proc-macro2", 2192 | "quote", 2193 | "unicode-ident", 2194 | ] 2195 | 2196 | [[package]] 2197 | name = "syn" 2198 | version = "2.0.15" 2199 | source = "registry+https://github.com/rust-lang/crates.io-index" 2200 | checksum = "a34fcf3e8b60f57e6a14301a2e916d323af98b0ea63c599441eec8558660c822" 2201 | dependencies = [ 2202 | "proc-macro2", 2203 | "quote", 2204 | "unicode-ident", 2205 | ] 2206 | 2207 | [[package]] 2208 | name = "tap" 2209 | version = "1.0.1" 2210 | source = "registry+https://github.com/rust-lang/crates.io-index" 2211 | checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" 2212 | 2213 | [[package]] 2214 | name = "tempfile" 2215 | version = "3.5.0" 2216 | source = "registry+https://github.com/rust-lang/crates.io-index" 2217 | checksum = "b9fbec84f381d5795b08656e4912bec604d162bff9291d6189a78f4c8ab87998" 2218 | dependencies = [ 2219 | "cfg-if 1.0.0", 2220 | "fastrand", 2221 | "redox_syscall 0.3.5", 2222 | "rustix", 2223 | "windows-sys 0.45.0", 2224 | ] 2225 | 2226 | [[package]] 2227 | name = "term" 2228 | version = "0.7.0" 2229 | source = "registry+https://github.com/rust-lang/crates.io-index" 2230 | checksum = "c59df8ac95d96ff9bede18eb7300b0fda5e5d8d90960e76f8e14ae765eedbf1f" 2231 | dependencies = [ 2232 | "dirs-next", 2233 | "rustversion", 2234 | "winapi", 2235 | ] 2236 | 2237 | [[package]] 2238 | name = "termcolor" 2239 | version = "1.2.0" 2240 | source = "registry+https://github.com/rust-lang/crates.io-index" 2241 | checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" 2242 | dependencies = [ 2243 | "winapi-util", 2244 | ] 2245 | 2246 | [[package]] 2247 | name = "thiserror" 2248 | version = "1.0.40" 2249 | source = "registry+https://github.com/rust-lang/crates.io-index" 2250 | checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" 2251 | dependencies = [ 2252 | "thiserror-impl", 2253 | ] 2254 | 2255 | [[package]] 2256 | name = "thiserror-impl" 2257 | version = "1.0.40" 2258 | source = "registry+https://github.com/rust-lang/crates.io-index" 2259 | checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" 2260 | dependencies = [ 2261 | "proc-macro2", 2262 | "quote", 2263 | "syn 2.0.15", 2264 | ] 2265 | 2266 | [[package]] 2267 | name = "time" 2268 | version = "0.1.45" 2269 | source = "registry+https://github.com/rust-lang/crates.io-index" 2270 | checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" 2271 | dependencies = [ 2272 | "libc", 2273 | "wasi 0.10.0+wasi-snapshot-preview1", 2274 | "winapi", 2275 | ] 2276 | 2277 | [[package]] 2278 | name = "tinyvec" 2279 | version = "1.6.0" 2280 | source = "registry+https://github.com/rust-lang/crates.io-index" 2281 | checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" 2282 | dependencies = [ 2283 | "tinyvec_macros", 2284 | ] 2285 | 2286 | [[package]] 2287 | name = "tinyvec_macros" 2288 | version = "0.1.1" 2289 | source = "registry+https://github.com/rust-lang/crates.io-index" 2290 | checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" 2291 | 2292 | [[package]] 2293 | name = "tokio" 2294 | version = "1.28.0" 2295 | source = "registry+https://github.com/rust-lang/crates.io-index" 2296 | checksum = "c3c786bf8134e5a3a166db9b29ab8f48134739014a3eca7bc6bfa95d673b136f" 2297 | dependencies = [ 2298 | "autocfg", 2299 | "bytes", 2300 | "libc", 2301 | "mio", 2302 | "num_cpus", 2303 | "parking_lot", 2304 | "pin-project-lite", 2305 | "signal-hook-registry", 2306 | "socket2", 2307 | "tokio-macros", 2308 | "windows-sys 0.48.0", 2309 | ] 2310 | 2311 | [[package]] 2312 | name = "tokio-macros" 2313 | version = "2.1.0" 2314 | source = "registry+https://github.com/rust-lang/crates.io-index" 2315 | checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" 2316 | dependencies = [ 2317 | "proc-macro2", 2318 | "quote", 2319 | "syn 2.0.15", 2320 | ] 2321 | 2322 | [[package]] 2323 | name = "tokio-native-tls" 2324 | version = "0.3.1" 2325 | source = "registry+https://github.com/rust-lang/crates.io-index" 2326 | checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" 2327 | dependencies = [ 2328 | "native-tls", 2329 | "tokio", 2330 | ] 2331 | 2332 | [[package]] 2333 | name = "tokio-util" 2334 | version = "0.7.8" 2335 | source = "registry+https://github.com/rust-lang/crates.io-index" 2336 | checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" 2337 | dependencies = [ 2338 | "bytes", 2339 | "futures-core", 2340 | "futures-sink", 2341 | "pin-project-lite", 2342 | "tokio", 2343 | "tracing", 2344 | ] 2345 | 2346 | [[package]] 2347 | name = "toml" 2348 | version = "0.5.11" 2349 | source = "registry+https://github.com/rust-lang/crates.io-index" 2350 | checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" 2351 | dependencies = [ 2352 | "serde", 2353 | ] 2354 | 2355 | [[package]] 2356 | name = "toml_datetime" 2357 | version = "0.6.1" 2358 | source = "registry+https://github.com/rust-lang/crates.io-index" 2359 | checksum = "3ab8ed2edee10b50132aed5f331333428b011c99402b5a534154ed15746f9622" 2360 | 2361 | [[package]] 2362 | name = "toml_edit" 2363 | version = "0.19.8" 2364 | source = "registry+https://github.com/rust-lang/crates.io-index" 2365 | checksum = "239410c8609e8125456927e6707163a3b1fdb40561e4b803bc041f466ccfdc13" 2366 | dependencies = [ 2367 | "indexmap", 2368 | "toml_datetime", 2369 | "winnow", 2370 | ] 2371 | 2372 | [[package]] 2373 | name = "tower-service" 2374 | version = "0.3.2" 2375 | source = "registry+https://github.com/rust-lang/crates.io-index" 2376 | checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" 2377 | 2378 | [[package]] 2379 | name = "tracing" 2380 | version = "0.1.37" 2381 | source = "registry+https://github.com/rust-lang/crates.io-index" 2382 | checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" 2383 | dependencies = [ 2384 | "cfg-if 1.0.0", 2385 | "pin-project-lite", 2386 | "tracing-core", 2387 | ] 2388 | 2389 | [[package]] 2390 | name = "tracing-core" 2391 | version = "0.1.30" 2392 | source = "registry+https://github.com/rust-lang/crates.io-index" 2393 | checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" 2394 | dependencies = [ 2395 | "once_cell", 2396 | ] 2397 | 2398 | [[package]] 2399 | name = "try-lock" 2400 | version = "0.2.4" 2401 | source = "registry+https://github.com/rust-lang/crates.io-index" 2402 | checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" 2403 | 2404 | [[package]] 2405 | name = "typenum" 2406 | version = "1.16.0" 2407 | source = "registry+https://github.com/rust-lang/crates.io-index" 2408 | checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" 2409 | 2410 | [[package]] 2411 | name = "uint" 2412 | version = "0.9.5" 2413 | source = "registry+https://github.com/rust-lang/crates.io-index" 2414 | checksum = "76f64bba2c53b04fcab63c01a7d7427eadc821e3bc48c34dc9ba29c501164b52" 2415 | dependencies = [ 2416 | "byteorder", 2417 | "crunchy", 2418 | "hex", 2419 | "static_assertions", 2420 | ] 2421 | 2422 | [[package]] 2423 | name = "unicode-bidi" 2424 | version = "0.3.13" 2425 | source = "registry+https://github.com/rust-lang/crates.io-index" 2426 | checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" 2427 | 2428 | [[package]] 2429 | name = "unicode-ident" 2430 | version = "1.0.8" 2431 | source = "registry+https://github.com/rust-lang/crates.io-index" 2432 | checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4" 2433 | 2434 | [[package]] 2435 | name = "unicode-normalization" 2436 | version = "0.1.22" 2437 | source = "registry+https://github.com/rust-lang/crates.io-index" 2438 | checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" 2439 | dependencies = [ 2440 | "tinyvec", 2441 | ] 2442 | 2443 | [[package]] 2444 | name = "unicode-width" 2445 | version = "0.1.10" 2446 | source = "registry+https://github.com/rust-lang/crates.io-index" 2447 | checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" 2448 | 2449 | [[package]] 2450 | name = "url" 2451 | version = "2.3.1" 2452 | source = "registry+https://github.com/rust-lang/crates.io-index" 2453 | checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" 2454 | dependencies = [ 2455 | "form_urlencoded", 2456 | "idna", 2457 | "percent-encoding", 2458 | ] 2459 | 2460 | [[package]] 2461 | name = "utf8parse" 2462 | version = "0.2.1" 2463 | source = "registry+https://github.com/rust-lang/crates.io-index" 2464 | checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" 2465 | 2466 | [[package]] 2467 | name = "vcpkg" 2468 | version = "0.2.15" 2469 | source = "registry+https://github.com/rust-lang/crates.io-index" 2470 | checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" 2471 | 2472 | [[package]] 2473 | name = "version_check" 2474 | version = "0.9.4" 2475 | source = "registry+https://github.com/rust-lang/crates.io-index" 2476 | checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" 2477 | 2478 | [[package]] 2479 | name = "want" 2480 | version = "0.3.0" 2481 | source = "registry+https://github.com/rust-lang/crates.io-index" 2482 | checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" 2483 | dependencies = [ 2484 | "log", 2485 | "try-lock", 2486 | ] 2487 | 2488 | [[package]] 2489 | name = "wasi" 2490 | version = "0.9.0+wasi-snapshot-preview1" 2491 | source = "registry+https://github.com/rust-lang/crates.io-index" 2492 | checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" 2493 | 2494 | [[package]] 2495 | name = "wasi" 2496 | version = "0.10.0+wasi-snapshot-preview1" 2497 | source = "registry+https://github.com/rust-lang/crates.io-index" 2498 | checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" 2499 | 2500 | [[package]] 2501 | name = "wasi" 2502 | version = "0.11.0+wasi-snapshot-preview1" 2503 | source = "registry+https://github.com/rust-lang/crates.io-index" 2504 | checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" 2505 | 2506 | [[package]] 2507 | name = "wasm-bindgen" 2508 | version = "0.2.84" 2509 | source = "registry+https://github.com/rust-lang/crates.io-index" 2510 | checksum = "31f8dcbc21f30d9b8f2ea926ecb58f6b91192c17e9d33594b3df58b2007ca53b" 2511 | dependencies = [ 2512 | "cfg-if 1.0.0", 2513 | "wasm-bindgen-macro", 2514 | ] 2515 | 2516 | [[package]] 2517 | name = "wasm-bindgen-backend" 2518 | version = "0.2.84" 2519 | source = "registry+https://github.com/rust-lang/crates.io-index" 2520 | checksum = "95ce90fd5bcc06af55a641a86428ee4229e44e07033963a2290a8e241607ccb9" 2521 | dependencies = [ 2522 | "bumpalo", 2523 | "log", 2524 | "once_cell", 2525 | "proc-macro2", 2526 | "quote", 2527 | "syn 1.0.109", 2528 | "wasm-bindgen-shared", 2529 | ] 2530 | 2531 | [[package]] 2532 | name = "wasm-bindgen-futures" 2533 | version = "0.4.34" 2534 | source = "registry+https://github.com/rust-lang/crates.io-index" 2535 | checksum = "f219e0d211ba40266969f6dbdd90636da12f75bee4fc9d6c23d1260dadb51454" 2536 | dependencies = [ 2537 | "cfg-if 1.0.0", 2538 | "js-sys", 2539 | "wasm-bindgen", 2540 | "web-sys", 2541 | ] 2542 | 2543 | [[package]] 2544 | name = "wasm-bindgen-macro" 2545 | version = "0.2.84" 2546 | source = "registry+https://github.com/rust-lang/crates.io-index" 2547 | checksum = "4c21f77c0bedc37fd5dc21f897894a5ca01e7bb159884559461862ae90c0b4c5" 2548 | dependencies = [ 2549 | "quote", 2550 | "wasm-bindgen-macro-support", 2551 | ] 2552 | 2553 | [[package]] 2554 | name = "wasm-bindgen-macro-support" 2555 | version = "0.2.84" 2556 | source = "registry+https://github.com/rust-lang/crates.io-index" 2557 | checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6" 2558 | dependencies = [ 2559 | "proc-macro2", 2560 | "quote", 2561 | "syn 1.0.109", 2562 | "wasm-bindgen-backend", 2563 | "wasm-bindgen-shared", 2564 | ] 2565 | 2566 | [[package]] 2567 | name = "wasm-bindgen-shared" 2568 | version = "0.2.84" 2569 | source = "registry+https://github.com/rust-lang/crates.io-index" 2570 | checksum = "0046fef7e28c3804e5e38bfa31ea2a0f73905319b677e57ebe37e49358989b5d" 2571 | 2572 | [[package]] 2573 | name = "web-sys" 2574 | version = "0.3.61" 2575 | source = "registry+https://github.com/rust-lang/crates.io-index" 2576 | checksum = "e33b99f4b23ba3eec1a53ac264e35a755f00e966e0065077d6027c0f575b0b97" 2577 | dependencies = [ 2578 | "js-sys", 2579 | "wasm-bindgen", 2580 | ] 2581 | 2582 | [[package]] 2583 | name = "wee_alloc" 2584 | version = "0.4.5" 2585 | source = "registry+https://github.com/rust-lang/crates.io-index" 2586 | checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" 2587 | dependencies = [ 2588 | "cfg-if 0.1.10", 2589 | "libc", 2590 | "memory_units", 2591 | "winapi", 2592 | ] 2593 | 2594 | [[package]] 2595 | name = "winapi" 2596 | version = "0.3.9" 2597 | source = "registry+https://github.com/rust-lang/crates.io-index" 2598 | checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" 2599 | dependencies = [ 2600 | "winapi-i686-pc-windows-gnu", 2601 | "winapi-x86_64-pc-windows-gnu", 2602 | ] 2603 | 2604 | [[package]] 2605 | name = "winapi-i686-pc-windows-gnu" 2606 | version = "0.4.0" 2607 | source = "registry+https://github.com/rust-lang/crates.io-index" 2608 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 2609 | 2610 | [[package]] 2611 | name = "winapi-util" 2612 | version = "0.1.5" 2613 | source = "registry+https://github.com/rust-lang/crates.io-index" 2614 | checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" 2615 | dependencies = [ 2616 | "winapi", 2617 | ] 2618 | 2619 | [[package]] 2620 | name = "winapi-x86_64-pc-windows-gnu" 2621 | version = "0.4.0" 2622 | source = "registry+https://github.com/rust-lang/crates.io-index" 2623 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 2624 | 2625 | [[package]] 2626 | name = "windows" 2627 | version = "0.48.0" 2628 | source = "registry+https://github.com/rust-lang/crates.io-index" 2629 | checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" 2630 | dependencies = [ 2631 | "windows-targets 0.48.0", 2632 | ] 2633 | 2634 | [[package]] 2635 | name = "windows-sys" 2636 | version = "0.42.0" 2637 | source = "registry+https://github.com/rust-lang/crates.io-index" 2638 | checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" 2639 | dependencies = [ 2640 | "windows_aarch64_gnullvm 0.42.2", 2641 | "windows_aarch64_msvc 0.42.2", 2642 | "windows_i686_gnu 0.42.2", 2643 | "windows_i686_msvc 0.42.2", 2644 | "windows_x86_64_gnu 0.42.2", 2645 | "windows_x86_64_gnullvm 0.42.2", 2646 | "windows_x86_64_msvc 0.42.2", 2647 | ] 2648 | 2649 | [[package]] 2650 | name = "windows-sys" 2651 | version = "0.45.0" 2652 | source = "registry+https://github.com/rust-lang/crates.io-index" 2653 | checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" 2654 | dependencies = [ 2655 | "windows-targets 0.42.2", 2656 | ] 2657 | 2658 | [[package]] 2659 | name = "windows-sys" 2660 | version = "0.48.0" 2661 | source = "registry+https://github.com/rust-lang/crates.io-index" 2662 | checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" 2663 | dependencies = [ 2664 | "windows-targets 0.48.0", 2665 | ] 2666 | 2667 | [[package]] 2668 | name = "windows-targets" 2669 | version = "0.42.2" 2670 | source = "registry+https://github.com/rust-lang/crates.io-index" 2671 | checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" 2672 | dependencies = [ 2673 | "windows_aarch64_gnullvm 0.42.2", 2674 | "windows_aarch64_msvc 0.42.2", 2675 | "windows_i686_gnu 0.42.2", 2676 | "windows_i686_msvc 0.42.2", 2677 | "windows_x86_64_gnu 0.42.2", 2678 | "windows_x86_64_gnullvm 0.42.2", 2679 | "windows_x86_64_msvc 0.42.2", 2680 | ] 2681 | 2682 | [[package]] 2683 | name = "windows-targets" 2684 | version = "0.48.0" 2685 | source = "registry+https://github.com/rust-lang/crates.io-index" 2686 | checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" 2687 | dependencies = [ 2688 | "windows_aarch64_gnullvm 0.48.0", 2689 | "windows_aarch64_msvc 0.48.0", 2690 | "windows_i686_gnu 0.48.0", 2691 | "windows_i686_msvc 0.48.0", 2692 | "windows_x86_64_gnu 0.48.0", 2693 | "windows_x86_64_gnullvm 0.48.0", 2694 | "windows_x86_64_msvc 0.48.0", 2695 | ] 2696 | 2697 | [[package]] 2698 | name = "windows_aarch64_gnullvm" 2699 | version = "0.42.2" 2700 | source = "registry+https://github.com/rust-lang/crates.io-index" 2701 | checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" 2702 | 2703 | [[package]] 2704 | name = "windows_aarch64_gnullvm" 2705 | version = "0.48.0" 2706 | source = "registry+https://github.com/rust-lang/crates.io-index" 2707 | checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" 2708 | 2709 | [[package]] 2710 | name = "windows_aarch64_msvc" 2711 | version = "0.42.2" 2712 | source = "registry+https://github.com/rust-lang/crates.io-index" 2713 | checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" 2714 | 2715 | [[package]] 2716 | name = "windows_aarch64_msvc" 2717 | version = "0.48.0" 2718 | source = "registry+https://github.com/rust-lang/crates.io-index" 2719 | checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" 2720 | 2721 | [[package]] 2722 | name = "windows_i686_gnu" 2723 | version = "0.42.2" 2724 | source = "registry+https://github.com/rust-lang/crates.io-index" 2725 | checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" 2726 | 2727 | [[package]] 2728 | name = "windows_i686_gnu" 2729 | version = "0.48.0" 2730 | source = "registry+https://github.com/rust-lang/crates.io-index" 2731 | checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" 2732 | 2733 | [[package]] 2734 | name = "windows_i686_msvc" 2735 | version = "0.42.2" 2736 | source = "registry+https://github.com/rust-lang/crates.io-index" 2737 | checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" 2738 | 2739 | [[package]] 2740 | name = "windows_i686_msvc" 2741 | version = "0.48.0" 2742 | source = "registry+https://github.com/rust-lang/crates.io-index" 2743 | checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" 2744 | 2745 | [[package]] 2746 | name = "windows_x86_64_gnu" 2747 | version = "0.42.2" 2748 | source = "registry+https://github.com/rust-lang/crates.io-index" 2749 | checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" 2750 | 2751 | [[package]] 2752 | name = "windows_x86_64_gnu" 2753 | version = "0.48.0" 2754 | source = "registry+https://github.com/rust-lang/crates.io-index" 2755 | checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" 2756 | 2757 | [[package]] 2758 | name = "windows_x86_64_gnullvm" 2759 | version = "0.42.2" 2760 | source = "registry+https://github.com/rust-lang/crates.io-index" 2761 | checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" 2762 | 2763 | [[package]] 2764 | name = "windows_x86_64_gnullvm" 2765 | version = "0.48.0" 2766 | source = "registry+https://github.com/rust-lang/crates.io-index" 2767 | checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" 2768 | 2769 | [[package]] 2770 | name = "windows_x86_64_msvc" 2771 | version = "0.42.2" 2772 | source = "registry+https://github.com/rust-lang/crates.io-index" 2773 | checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" 2774 | 2775 | [[package]] 2776 | name = "windows_x86_64_msvc" 2777 | version = "0.48.0" 2778 | source = "registry+https://github.com/rust-lang/crates.io-index" 2779 | checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" 2780 | 2781 | [[package]] 2782 | name = "winnow" 2783 | version = "0.4.6" 2784 | source = "registry+https://github.com/rust-lang/crates.io-index" 2785 | checksum = "61de7bac303dc551fe038e2b3cef0f571087a47571ea6e79a87692ac99b99699" 2786 | dependencies = [ 2787 | "memchr", 2788 | ] 2789 | 2790 | [[package]] 2791 | name = "winreg" 2792 | version = "0.10.1" 2793 | source = "registry+https://github.com/rust-lang/crates.io-index" 2794 | checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" 2795 | dependencies = [ 2796 | "winapi", 2797 | ] 2798 | 2799 | [[package]] 2800 | name = "wyz" 2801 | version = "0.2.0" 2802 | source = "registry+https://github.com/rust-lang/crates.io-index" 2803 | checksum = "85e60b0d1b5f99db2556934e21937020776a5d31520bf169e851ac44e6420214" 2804 | 2805 | [[package]] 2806 | name = "zeroize" 2807 | version = "1.3.0" 2808 | source = "registry+https://github.com/rust-lang/crates.io-index" 2809 | checksum = "4756f7db3f7b5574938c3eb1c117038b8e07f95ee6718c0efad4ac21508f1efd" 2810 | dependencies = [ 2811 | "zeroize_derive", 2812 | ] 2813 | 2814 | [[package]] 2815 | name = "zeroize_derive" 2816 | version = "1.4.2" 2817 | source = "registry+https://github.com/rust-lang/crates.io-index" 2818 | checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" 2819 | dependencies = [ 2820 | "proc-macro2", 2821 | "quote", 2822 | "syn 2.0.15", 2823 | ] 2824 | 2825 | [[package]] 2826 | name = "zeropool-bn" 2827 | version = "0.5.11" 2828 | source = "registry+https://github.com/rust-lang/crates.io-index" 2829 | checksum = "71e61de68ede9ffdd69c01664f65a178c5188b73f78faa21f0936016a888ff7c" 2830 | dependencies = [ 2831 | "borsh 0.9.3", 2832 | "byteorder", 2833 | "crunchy", 2834 | "lazy_static", 2835 | "rand 0.8.5", 2836 | "rustc-hex", 2837 | ] 2838 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "near-rewards" 3 | version = "0.6.1" 4 | authors = ["Bohdan Khorolets "] 5 | edition = "2018" 6 | 7 | [dependencies] 8 | base64 = "0.21.0" 9 | borsh = "0.10.3" 10 | clap = { version = "4.2.7", features = ["derive"] } 11 | colored = "2" 12 | dirs = "3.0.1" 13 | futures = "0.3.28" 14 | near-sdk = "4.1.1" 15 | prettytable-rs = "0.10.0" 16 | reqwest = { version = "0.11.17", features = ["json"] } 17 | serde = { version = "1.0.162", features = ["derive"] } 18 | serde_json = "1.0.96" 19 | tokio = { version = "1.28.0", features = ["full"] } 20 | uint = { version = "0.9.5", default-features = false } -------------------------------------------------------------------------------- /LICENSE-APACHE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright 2019 Near 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /LICENSE-MIT: -------------------------------------------------------------------------------- 1 | Permission is hereby granted, free of charge, to any 2 | person obtaining a copy of this software and associated 3 | documentation files (the "Software"), to deal in the 4 | Software without restriction, including without 5 | limitation the rights to use, copy, modify, merge, 6 | publish, distribute, sublicense, and/or sell copies of 7 | the Software, and to permit persons to whom the Software 8 | is furnished to do so, subject to the following 9 | conditions: 10 | 11 | The above copyright notice and this permission notice 12 | shall be included in all copies or substantial portions 13 | of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF 16 | ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 17 | TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 18 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 19 | SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR 22 | IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 23 | DEALINGS IN THE SOFTWARE. 24 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # near_test 2 | 3 | Small console application to check the staking rewards for ~~lockup~~ accounts on [NEAR protocol](https://near.org) 4 | 5 | ## Example result: 6 | 7 | ![near_reward result example](docs/near_rewards.png) 8 | 9 | ## Prerequisites 10 | 11 | This utility requires Rust. To install, run: 12 | 13 | ```bash 14 | curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh 15 | ``` 16 | 17 | ([Official documentation](https://www.rust-lang.org/tools/install)) 18 | 19 | Follow the directions which includes running: 20 | 21 | ```bash 22 | source $HOME/.cargo/env 23 | ``` 24 | 25 | ## Usage 26 | 27 | 1. Create a `near_rewards` folder inside your home directory. 28 | 29 | 2. In `near_rewards` create a file `accounts.json` with the following structure: 30 | 31 | ```json 32 | [ 33 | { 34 | "account_id": "account.near", 35 | "pool_account_id": "pool.poolv1.near" 36 | } 37 | ] 38 | ``` 39 | 40 | OR 41 | 42 | ```json 43 | [ 44 | { 45 | "account_id": "account.lockup.near", 46 | "key": "ed25519:FQxoGzhKW129Vq8Uk8WqeSV1e8z3oJFMC1UbN6z6yBHT" 47 | } 48 | ] 49 | ``` 50 | 51 | ~~_**Note:** This tool only works for lockup accounts._~~ 52 | 53 | The tool works for any account in NEAR 54 | 55 | 3. Run `cargo install --git https://github.com/khorolets/near_rewards` in your terminal. 56 | 4. Run `near-rewards` in your terminal. 57 | -------------------------------------------------------------------------------- /docs/near_rewards.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terabyte-sourcer/Rust-Near-Test/8c2c16c4f3d6e293589ee14fa925f8fb7b24f1dc/docs/near_rewards.png -------------------------------------------------------------------------------- /rust_toolchain: -------------------------------------------------------------------------------- 1 | 1.55.0 2 | -------------------------------------------------------------------------------- /src/configs.rs: -------------------------------------------------------------------------------- 1 | use clap::Parser; 2 | 3 | /// NEAR Rewards 4 | /// Checks the rewards of lockup accounts 5 | #[derive(Parser, Debug)] 6 | #[command(author, about, version, long_about = None)] 7 | pub(crate) struct Opts { 8 | /// Sets a custom near_rewards dir. Defaults to ~/near_rewards 9 | #[arg(long)] 10 | pub home_dir: Option, 11 | #[arg(short, long)] 12 | pub verbose: bool, 13 | /// Provide a custom RPC server URL 14 | #[arg(long, default_value = "https://rpc.mainnet.near.org")] 15 | pub rpc_url: String, 16 | } 17 | -------------------------------------------------------------------------------- /src/main.rs: -------------------------------------------------------------------------------- 1 | use std::collections::HashSet; 2 | 3 | use clap::Parser; 4 | 5 | #[macro_use] 6 | extern crate prettytable; 7 | use prettytable::{color, Attr, Cell, Row, Table}; 8 | 9 | use near_jsonrpc_client::NearJsonRpcClient; 10 | use primitives::Account; 11 | use utils::{collect_account_data, reward_diff}; 12 | 13 | mod configs; 14 | mod near_jsonrpc_client; 15 | mod primitives; 16 | mod utils; 17 | 18 | const EPOCH_LENGTH: u64 = 43200; 19 | 20 | fn print_table(table: &Table, reward_sum: f64, liquid_balance_sum: f64, price: f32) { 21 | let mut table = table.clone(); 22 | 23 | table.add_row(Row::new(vec![ 24 | Cell::new(format!("{:.2}", (reward_sum as f32)).as_str()) 25 | .with_hspan(2) 26 | .style_spec("brFg"), 27 | Cell::new(format!("{:.2}", (liquid_balance_sum as f32)).as_str()) 28 | .with_hspan(4) 29 | .style_spec("bFc"), 30 | ])); 31 | 32 | table.add_row(Row::new(vec![ 33 | Cell::new(format!("${:.2}", price * (reward_sum as f32)).as_str()) 34 | .with_hspan(2) 35 | .style_spec("brFg"), 36 | Cell::new(format!("${:.2}", price * (liquid_balance_sum as f32)).as_str()) 37 | .with_hspan(4) 38 | .style_spec("bFc"), 39 | ])); 40 | 41 | table.printstd(); 42 | } 43 | 44 | #[tokio::main] 45 | async fn main() -> Result<(), Box> { 46 | let opts: configs::Opts = configs::Opts::parse(); 47 | 48 | let home_dir = opts 49 | .home_dir 50 | .unwrap_or_else(|| match dirs::home_dir() { 51 | Some(path) => path.join("near_rewards"), 52 | None => panic!("Unavailable to use default path ~/near_rewards/. Try to run `near_rewards --home-dir ~/near_rewards`"), 53 | }); 54 | 55 | let mut accounts_file: Vec = match utils::read_accounts(home_dir) { 56 | Ok(s) => serde_json::from_str(&s).unwrap(), 57 | Err(err) => { 58 | panic!("File read error: {}", err); 59 | } 60 | }; 61 | 62 | let client = NearJsonRpcClient::new(opts.rpc_url); 63 | 64 | let current_block = match client.get_final_block().await { 65 | Ok(block) => block, 66 | Err(err) => panic!("Error: {}", err), 67 | }; 68 | 69 | let epoch_start_height = match client.get_validators().await { 70 | Ok(validators) => validators.epoch_start_height, 71 | Err(err) => panic!("Error: {}", err), 72 | }; 73 | 74 | // TODO: Improve this, we may end up in missing block so we want 75 | // somehow to increment the amount of block we subtract from epoch_start_height 76 | let prev_epoch_block = match client.get_block(epoch_start_height - 6).await { 77 | Ok(block) => block, 78 | Err(err) => panic!("Error: {}", err), 79 | }; 80 | 81 | let current_position_in_epoch = 82 | utils::current_position_in_epoch(epoch_start_height, current_block.header.height); 83 | 84 | let mut reward_sum = 0_f64; 85 | let mut liquid_balance_sum = 0_f64; 86 | 87 | let price = utils::binance_price().await.unwrap_or(0.0); 88 | 89 | let mut table = Table::new(); 90 | table.add_row(Row::new(vec![ 91 | Cell::new(format!("Epoch progress: {}%", current_position_in_epoch).as_str()).with_hspan(2), 92 | Cell::new("NEAR-USDT (Binance)").with_hspan(2), 93 | Cell::new(format!("${}", price).as_str()) 94 | .with_hspan(1) 95 | .with_style(Attr::ForegroundColor(color::GREEN)), 96 | ])); 97 | 98 | table.add_row(row![ 99 | "LOCKUP ACCOUNT", 100 | "REWARD", 101 | "LIQUID", 102 | "UNSTAKED", 103 | "NATIVE", 104 | "POOL", 105 | ]); 106 | 107 | println!("Fetching accounts data..."); 108 | 109 | let mut alredy_fetched_liquid_balance_accounts: HashSet = HashSet::new(); 110 | 111 | accounts_file.sort_by(|a, b| a.key.cmp(&b.key)); 112 | 113 | for mut account in accounts_file { 114 | let account_at_current_block = 115 | collect_account_data(&client, &mut account, current_block.clone()).await; 116 | 117 | let account_at_prev_epoch = 118 | collect_account_data(&client, &mut account, prev_epoch_block.clone()).await; 119 | 120 | reward_sum += utils::human(account_at_current_block.reward); 121 | 122 | let liquid_balance = if alredy_fetched_liquid_balance_accounts 123 | .get(&account.account_id) 124 | .is_none() 125 | { 126 | alredy_fetched_liquid_balance_accounts.insert(account.account_id.clone()); 127 | account_at_current_block.liquid_balance 128 | } else { 129 | 0 130 | }; 131 | 132 | liquid_balance_sum += utils::human(liquid_balance); 133 | 134 | table.add_row(Row::new(vec![ 135 | Cell::new( 136 | account 137 | .account_id 138 | .chars() 139 | .take(14) 140 | .collect::() 141 | .as_str(), 142 | ) 143 | .with_style(Attr::Bold) 144 | .with_style(Attr::ForegroundColor(color::WHITE)), 145 | Cell::new(&format!( 146 | "{} {}", 147 | utils::current_reward(account_at_current_block.reward), 148 | &reward_diff( 149 | account_at_current_block.reward, 150 | account_at_prev_epoch.reward, 151 | ), 152 | )), 153 | Cell::new(&format!( 154 | "{:.2}", 155 | utils::human(account_at_current_block.liquid_balance) 156 | )) 157 | .with_style(Attr::ForegroundColor(color::CYAN)), 158 | Cell::new(&format!( 159 | "{:.2}", 160 | utils::human( 161 | account_at_current_block 162 | .account_in_pool 163 | .get_unstaked_balance(), 164 | ) 165 | )) 166 | .style_spec(if account_at_current_block.account_in_pool.can_withdraw { 167 | "Fy" 168 | } else { 169 | "Fr" 170 | }), 171 | Cell::new(&format!( 172 | "{:.2}", 173 | utils::human(account_at_current_block.native_balance) 174 | )), 175 | Cell::new(account.get_pool_account_id(&client).await.unwrap().as_str()), 176 | ])); 177 | if opts.verbose { 178 | print_table(&table, reward_sum, liquid_balance_sum, price); 179 | } 180 | } 181 | if !opts.verbose { 182 | print_table(&table, reward_sum, liquid_balance_sum, price); 183 | } 184 | Ok(()) 185 | } 186 | -------------------------------------------------------------------------------- /src/near_jsonrpc_client.rs: -------------------------------------------------------------------------------- 1 | use base64::Engine; 2 | use serde_json::json; 3 | 4 | use crate::primitives::{ 5 | AccountInPoolResponse, AccountInPoolResult, Block, BlockResponse, Response, Validators, 6 | ValidatorsResponse, ViewAccountResponse, 7 | }; 8 | 9 | #[derive(Debug)] 10 | pub(crate) struct NearJsonRpcClient { 11 | endpoint: String, 12 | } 13 | 14 | impl NearJsonRpcClient { 15 | pub fn new(endpoint: String) -> Self { 16 | NearJsonRpcClient { endpoint } 17 | } 18 | 19 | pub async fn get_locked_amount( 20 | &self, 21 | account_id: String, 22 | block_height: u64, 23 | ) -> Result { 24 | let params = json!({ 25 | "jsonrpc": "2.0", 26 | "id": "dontcare", 27 | "method": "query", 28 | "params": json!({ 29 | "request_type": "call_function", 30 | "block_id": block_height, 31 | "account_id": account_id, 32 | "method_name": "get_locked_amount", 33 | "args_base64": "" 34 | }) 35 | }); 36 | 37 | let client = reqwest::Client::new(); 38 | let res = client.post(&self.endpoint).json(¶ms).send().await?; 39 | 40 | let body: Response = res.json().await?; 41 | 42 | Ok(body.result.get_amount()) 43 | } 44 | 45 | pub async fn get_liquid_owners_balance( 46 | &self, 47 | account_id: String, 48 | block_height: u64, 49 | ) -> Result { 50 | let params = json!({ 51 | "jsonrpc": "2.0", 52 | "id": "dontcare", 53 | "method": "query", 54 | "params": json!({ 55 | "request_type": "call_function", 56 | "block_id": block_height, 57 | "account_id": account_id, 58 | "method_name": "get_liquid_owners_balance", 59 | "args_base64": "" 60 | }) 61 | }); 62 | 63 | let client = reqwest::Client::new(); 64 | let res = client.post(&self.endpoint).json(¶ms).send().await?; 65 | 66 | let body: Response = res.json().await?; 67 | 68 | Ok(body.result.get_amount()) 69 | } 70 | 71 | pub async fn get_account_in_pool( 72 | &self, 73 | account_id: String, 74 | pool_account_id: String, 75 | block_height: u64, 76 | ) -> Result { 77 | let params = json!({ 78 | "jsonrpc": "2.0", 79 | "id": "dontcare", 80 | "method": "query", 81 | "params": json!({ 82 | "request_type": "call_function", 83 | "block_id": block_height, 84 | "account_id": pool_account_id, 85 | "method_name": "get_account", 86 | "args_base64": base64::engine::general_purpose::STANDARD.encode(json!({"account_id": account_id}).to_string()), 87 | }) 88 | }); 89 | 90 | let client = reqwest::Client::new(); 91 | let res = client.post(&self.endpoint).json(¶ms).send().await?; 92 | 93 | let body: AccountInPoolResponse = res.json().await?; 94 | 95 | let account_in_pool: AccountInPoolResult = 96 | serde_json::from_slice(&body.result.result[..]).unwrap(); 97 | 98 | Ok(account_in_pool) 99 | } 100 | 101 | pub async fn get_native_balance( 102 | &self, 103 | account_id: String, 104 | block_height: u64, 105 | ) -> Result { 106 | let params = json!({ 107 | "jsonrpc": "2.0", 108 | "id": "dontcare", 109 | "method": "query", 110 | "params": json!({ 111 | "request_type": "view_account", 112 | "block_id": block_height, 113 | "account_id": account_id, 114 | }) 115 | }); 116 | 117 | let client = reqwest::Client::new(); 118 | let res = client.post(&self.endpoint).json(¶ms).send().await?; 119 | 120 | let body: ViewAccountResponse = res.json().await?; 121 | 122 | Ok(body.result.get_amount()) 123 | } 124 | 125 | pub async fn get_validators(&self) -> Result { 126 | let params = json!({ 127 | "jsonrpc": "2.0", 128 | "id": "dontcare", 129 | "method": "validators", 130 | "params": json!({"latest": null}), 131 | }); 132 | 133 | let client = reqwest::Client::new(); 134 | 135 | let res = client.post(&self.endpoint).json(¶ms).send().await?; 136 | 137 | let body: ValidatorsResponse = res.json().await?; 138 | 139 | Ok(body.result) 140 | } 141 | 142 | pub async fn get_block(&self, block_height: u64) -> Result { 143 | let params = json!({ 144 | "jsonrpc": "2.0", 145 | "id": "dontcare", 146 | "method": "block", 147 | "params": json!({"block_id": block_height}), 148 | }); 149 | 150 | let client = reqwest::Client::new(); 151 | 152 | let res = client.post(&self.endpoint).json(¶ms).send().await?; 153 | 154 | let body: BlockResponse = res.json().await?; 155 | 156 | Ok(body.result) 157 | } 158 | 159 | pub async fn get_final_block(&self) -> Result { 160 | let params = json!({ 161 | "jsonrpc": "2.0", 162 | "id": "dontcare", 163 | "method": "block", 164 | "params": json!({"finality": "final"}), 165 | }); 166 | 167 | let client = reqwest::Client::new(); 168 | 169 | let res = client.post(&self.endpoint).json(¶ms).send().await?; 170 | 171 | let body: BlockResponse = res.json().await?; 172 | 173 | Ok(body.result) 174 | } 175 | pub async fn get_staking_pool_account_id( 176 | &self, 177 | account_id: String, 178 | ) -> Result { 179 | let params = json!({ 180 | "jsonrpc": "2.0", 181 | "id": "dontcare", 182 | "method": "query", 183 | "params": json!({ 184 | "request_type": "call_function", 185 | "finality": "final", 186 | "account_id": account_id, 187 | "method_name": "get_staking_pool_account_id", 188 | "args_base64": "e30=" 189 | }) 190 | }); 191 | 192 | let client = reqwest::Client::new(); 193 | let res = client.post(&self.endpoint).json(¶ms).send().await?; 194 | 195 | let body: AccountInPoolResponse = res.json().await?; 196 | 197 | let pool_account_id: String = serde_json::from_slice(&body.result.result[..]).unwrap(); 198 | Ok(pool_account_id) 199 | } 200 | } 201 | -------------------------------------------------------------------------------- /src/primitives.rs: -------------------------------------------------------------------------------- 1 | use crate::near_jsonrpc_client::NearJsonRpcClient; 2 | use borsh::{self, BorshDeserialize, BorshSerialize}; 3 | use serde::{self, Deserialize}; 4 | 5 | #[derive(Debug, Deserialize, BorshDeserialize, Clone)] 6 | pub(crate) struct Response { 7 | pub result: ResponseResult, 8 | } 9 | 10 | #[derive(Debug, Deserialize, BorshDeserialize, Clone)] 11 | pub(crate) struct ResponseResult { 12 | pub result: Vec, 13 | } 14 | 15 | impl ResponseResult { 16 | pub fn get_amount(self) -> u128 { 17 | String::from_utf8(self.result) 18 | .unwrap() 19 | .trim_matches('"') 20 | .parse::() 21 | .unwrap() 22 | } 23 | } 24 | 25 | #[derive(Debug, Deserialize, BorshDeserialize)] 26 | pub(crate) struct ViewAccountResponse { 27 | pub result: ViewAccountResult, 28 | } 29 | 30 | #[derive(Debug, Deserialize, BorshDeserialize)] 31 | pub(crate) struct ViewAccountResult { 32 | pub amount: String, 33 | } 34 | 35 | impl ViewAccountResult { 36 | pub fn get_amount(self) -> u128 { 37 | self.amount.trim_matches('"').parse::().unwrap() 38 | } 39 | } 40 | 41 | #[derive(Debug, Deserialize, BorshDeserialize)] 42 | pub(crate) struct AccountInPoolResponse { 43 | pub result: ResponseResult, 44 | } 45 | 46 | #[derive(Debug, Deserialize, BorshSerialize, BorshDeserialize)] 47 | pub(crate) struct AccountInPoolResult { 48 | pub account_id: String, 49 | pub unstaked_balance: String, 50 | pub staked_balance: String, 51 | pub can_withdraw: bool, 52 | } 53 | 54 | impl AccountInPoolResult { 55 | pub fn get_staked_balance(&self) -> u128 { 56 | self.staked_balance 57 | .trim_matches('"') 58 | .parse::() 59 | .unwrap() 60 | } 61 | 62 | pub fn get_unstaked_balance(&self) -> u128 { 63 | self.unstaked_balance 64 | .trim_matches('"') 65 | .parse::() 66 | .unwrap() 67 | } 68 | } 69 | 70 | #[derive(Debug, Deserialize, Clone)] 71 | pub(crate) struct Account { 72 | /// Value used to identify the account. 73 | pub key: Option, 74 | pub account_id: String, 75 | pub pool_account_id: Option, 76 | pub locked_amount: Option, 77 | } 78 | 79 | impl Account { 80 | pub async fn get_pool_account_id(&mut self, client: &NearJsonRpcClient) -> Option { 81 | if self.pool_account_id.is_none() { 82 | self.pool_account_id = client 83 | .get_staking_pool_account_id(self.account_id.clone()) 84 | .await 85 | .ok(); 86 | } 87 | self.pool_account_id.clone() 88 | } 89 | } 90 | 91 | #[derive(Debug, Deserialize)] 92 | pub(crate) struct ValidatorsResponse { 93 | pub result: Validators, 94 | } 95 | 96 | #[derive(Debug, Deserialize)] 97 | pub(crate) struct Validators { 98 | pub epoch_start_height: u64, 99 | } 100 | 101 | #[derive(Debug, Deserialize)] 102 | pub(crate) struct BlockResponse { 103 | pub result: Block, 104 | } 105 | 106 | #[derive(Debug, Deserialize, Clone)] 107 | pub(crate) struct Block { 108 | pub header: BlockHeader, 109 | } 110 | 111 | #[derive(Debug, Deserialize, Clone)] 112 | pub(crate) struct BlockHeader { 113 | pub height: u64, 114 | } 115 | 116 | #[derive(Debug)] 117 | pub(crate) struct AccountBalancesAtBlock { 118 | pub account_in_pool: AccountInPoolResult, 119 | pub native_balance: u128, 120 | pub liquid_balance: u128, 121 | pub reward: u128, 122 | } 123 | -------------------------------------------------------------------------------- /src/utils/accounts.rs: -------------------------------------------------------------------------------- 1 | use colored::*; 2 | 3 | use crate::near_jsonrpc_client::NearJsonRpcClient; 4 | use crate::primitives::{Account, AccountBalancesAtBlock, Block}; 5 | use crate::utils; 6 | 7 | pub(crate) async fn collect_account_data( 8 | client: &NearJsonRpcClient, 9 | account: &mut Account, 10 | block: Block, 11 | ) -> AccountBalancesAtBlock { 12 | let account_in_pool = match client 13 | .get_account_in_pool( 14 | account.clone().account_id, 15 | account 16 | .get_pool_account_id(client) 17 | .await 18 | .expect("Unable to get the pool"), 19 | block.header.height, 20 | ) 21 | .await 22 | { 23 | Ok(account) => account, 24 | Err(err) => { 25 | panic!("Error: {}", err); 26 | } 27 | }; 28 | let locked_amount: u128 = if let Some(amount) = &account.locked_amount { 29 | if let Ok(amount) = amount.parse() { 30 | amount 31 | } else { 32 | 0 33 | } 34 | } else { 35 | match client 36 | .get_locked_amount(account.clone().account_id, block.header.height) 37 | .await 38 | { 39 | Ok(amount) => amount, 40 | Err(_err) => 0, 41 | } 42 | }; 43 | let native_balance = match client 44 | .get_native_balance(account.clone().account_id, block.header.height) 45 | .await 46 | { 47 | Ok(amount) => amount, 48 | Err(err) => { 49 | panic!("Reqwest Error: {}", err); 50 | } 51 | }; 52 | let liquid_balance = match client 53 | .get_liquid_owners_balance(account.clone().account_id, block.header.height) 54 | .await 55 | { 56 | Ok(amount) => amount, 57 | Err(_err) => native_balance, 58 | }; 59 | let reward = account_in_pool 60 | .get_staked_balance() 61 | .saturating_add(account_in_pool.get_unstaked_balance()) 62 | .saturating_add(if locked_amount > 0 { native_balance } else { 0 }) 63 | .saturating_sub(locked_amount); 64 | 65 | AccountBalancesAtBlock { 66 | account_in_pool, 67 | native_balance, 68 | liquid_balance, 69 | reward, 70 | } 71 | } 72 | 73 | pub(crate) fn reward_diff(current_reward: u128, prev_reward: u128) -> String { 74 | if current_reward > prev_reward { 75 | format!("+{:.2}", utils::human(current_reward - prev_reward)) 76 | .blue() 77 | .to_string() 78 | } else { 79 | format!("-{:.2}", utils::human(prev_reward - current_reward)) 80 | .red() 81 | .to_string() 82 | } 83 | } 84 | 85 | pub(crate) fn current_reward(current_reward: u128) -> String { 86 | format!("{:.2}", utils::human(current_reward)) 87 | .green() 88 | .to_string() 89 | } 90 | -------------------------------------------------------------------------------- /src/utils/binance.rs: -------------------------------------------------------------------------------- 1 | use serde::{self, Deserialize}; 2 | 3 | #[derive(Deserialize, Debug)] 4 | struct BinanceResponse { 5 | price: String, 6 | } 7 | 8 | impl BinanceResponse { 9 | fn get_price(&self) -> f32 { 10 | self.price.parse::().unwrap() 11 | } 12 | } 13 | 14 | pub(crate) async fn binance_price() -> Result { 15 | print!("Fetching NEAR-USDT price from Binance..."); 16 | let body: BinanceResponse = 17 | reqwest::get("https://api.binance.com/api/v3/ticker/price?symbol=NEARUSDT") 18 | .await? 19 | .json() 20 | .await?; 21 | println!(" {}", &body.get_price()); 22 | Ok(body.get_price()) 23 | } 24 | -------------------------------------------------------------------------------- /src/utils/human.rs: -------------------------------------------------------------------------------- 1 | pub(crate) fn human(yocto: u128) -> f64 { 2 | yocto as f64 / 1000000000000000000000000_f64 3 | } 4 | 5 | pub(crate) fn current_position_in_epoch(start: u64, current: u64) -> u64 { 6 | (current - start) * 100 / crate::EPOCH_LENGTH 7 | } 8 | -------------------------------------------------------------------------------- /src/utils/mod.rs: -------------------------------------------------------------------------------- 1 | use std::fs::File; 2 | use std::io::prelude::*; 3 | 4 | pub(crate) use accounts::{collect_account_data, current_reward, reward_diff}; 5 | pub(crate) use binance::binance_price; 6 | pub(crate) use human::{current_position_in_epoch, human}; 7 | 8 | mod accounts; 9 | mod binance; 10 | mod human; 11 | 12 | pub(crate) fn read_accounts(home_dir: std::path::PathBuf) -> Result { 13 | let accounts_list_path = home_dir.join("accounts.json"); 14 | if !accounts_list_path.exists() { 15 | panic!( 16 | "You must create {:?} with list of accounts to check. Example:\n {}", 17 | &home_dir, 18 | " 19 | [\n \ 20 | {\n \ 21 | \"account_id\": \"accountid.near\",\n \ 22 | \"pool_account_id\": \"nameofpool.poolv1.near\"\n \ 23 | }\n\ 24 | ]\n", 25 | ); 26 | } 27 | println!( 28 | "Reading accounts from {}...", 29 | &accounts_list_path.to_string_lossy() 30 | ); 31 | let mut file = File::open(accounts_list_path)?; 32 | let mut contents = String::new(); 33 | file.read_to_string(&mut contents)?; 34 | Ok(contents) 35 | } 36 | --------------------------------------------------------------------------------