github.com/hyperion-hyn/go-ethereum@v2.4.0+incompatible/internal/web3ext/web3ext.go (about) 1 // Copyright 2015 The go-ethereum Authors 2 // This file is part of the go-ethereum library. 3 // 4 // The go-ethereum library is free software: you can redistribute it and/or modify 5 // it under the terms of the GNU Lesser General Public License as published by 6 // the Free Software Foundation, either version 3 of the License, or 7 // (at your option) any later version. 8 // 9 // The go-ethereum library is distributed in the hope that it will be useful, 10 // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 // GNU Lesser General Public License for more details. 13 // 14 // You should have received a copy of the GNU Lesser General Public License 15 // along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>. 16 17 // package web3ext contains geth specific web3.js extensions. 18 package web3ext 19 20 var Modules = map[string]string{ 21 "admin": Admin_JS, 22 "chequebook": Chequebook_JS, 23 "clique": Clique_JS, 24 "ethash": Ethash_JS, 25 "debug": Debug_JS, 26 "eth": Eth_JS, 27 "miner": Miner_JS, 28 "net": Net_JS, 29 "personal": Personal_JS, 30 "rpc": RPC_JS, 31 "shh": Shh_JS, 32 "swarmfs": SWARMFS_JS, 33 "txpool": TxPool_JS, 34 "raft": Raft_JS, 35 "istanbul": Istanbul_JS, 36 "quorumPermission": QUORUM_NODE_JS, 37 } 38 39 const Chequebook_JS = ` 40 web3._extend({ 41 property: 'chequebook', 42 methods: [ 43 new web3._extend.Method({ 44 name: 'deposit', 45 call: 'chequebook_deposit', 46 params: 1, 47 inputFormatter: [null] 48 }), 49 new web3._extend.Property({ 50 name: 'balance', 51 getter: 'chequebook_balance', 52 outputFormatter: web3._extend.utils.toDecimal 53 }), 54 new web3._extend.Method({ 55 name: 'cash', 56 call: 'chequebook_cash', 57 params: 1, 58 inputFormatter: [null] 59 }), 60 new web3._extend.Method({ 61 name: 'issue', 62 call: 'chequebook_issue', 63 params: 2, 64 inputFormatter: [null, null] 65 }), 66 ] 67 }); 68 ` 69 70 const Clique_JS = ` 71 web3._extend({ 72 property: 'clique', 73 methods: [ 74 new web3._extend.Method({ 75 name: 'getSnapshot', 76 call: 'clique_getSnapshot', 77 params: 1, 78 inputFormatter: [null] 79 }), 80 new web3._extend.Method({ 81 name: 'getSnapshotAtHash', 82 call: 'clique_getSnapshotAtHash', 83 params: 1 84 }), 85 new web3._extend.Method({ 86 name: 'getSigners', 87 call: 'clique_getSigners', 88 params: 1, 89 inputFormatter: [null] 90 }), 91 new web3._extend.Method({ 92 name: 'getSignersAtHash', 93 call: 'clique_getSignersAtHash', 94 params: 1 95 }), 96 new web3._extend.Method({ 97 name: 'propose', 98 call: 'clique_propose', 99 params: 2 100 }), 101 new web3._extend.Method({ 102 name: 'discard', 103 call: 'clique_discard', 104 params: 1 105 }), 106 ], 107 properties: [ 108 new web3._extend.Property({ 109 name: 'proposals', 110 getter: 'clique_proposals' 111 }), 112 ] 113 }); 114 ` 115 116 const Ethash_JS = ` 117 web3._extend({ 118 property: 'ethash', 119 methods: [ 120 new web3._extend.Method({ 121 name: 'getWork', 122 call: 'ethash_getWork', 123 params: 0 124 }), 125 new web3._extend.Method({ 126 name: 'getHashrate', 127 call: 'ethash_getHashrate', 128 params: 0 129 }), 130 new web3._extend.Method({ 131 name: 'submitWork', 132 call: 'ethash_submitWork', 133 params: 3, 134 }), 135 new web3._extend.Method({ 136 name: 'submitHashRate', 137 call: 'ethash_submitHashRate', 138 params: 2, 139 }), 140 ] 141 }); 142 ` 143 144 const Admin_JS = ` 145 web3._extend({ 146 property: 'admin', 147 methods: [ 148 new web3._extend.Method({ 149 name: 'addPeer', 150 call: 'admin_addPeer', 151 params: 1 152 }), 153 new web3._extend.Method({ 154 name: 'removePeer', 155 call: 'admin_removePeer', 156 params: 1 157 }), 158 new web3._extend.Method({ 159 name: 'addTrustedPeer', 160 call: 'admin_addTrustedPeer', 161 params: 1 162 }), 163 new web3._extend.Method({ 164 name: 'removeTrustedPeer', 165 call: 'admin_removeTrustedPeer', 166 params: 1 167 }), 168 new web3._extend.Method({ 169 name: 'exportChain', 170 call: 'admin_exportChain', 171 params: 1, 172 inputFormatter: [null] 173 }), 174 new web3._extend.Method({ 175 name: 'importChain', 176 call: 'admin_importChain', 177 params: 1 178 }), 179 new web3._extend.Method({ 180 name: 'sleepBlocks', 181 call: 'admin_sleepBlocks', 182 params: 2 183 }), 184 new web3._extend.Method({ 185 name: 'startRPC', 186 call: 'admin_startRPC', 187 params: 4, 188 inputFormatter: [null, null, null, null] 189 }), 190 new web3._extend.Method({ 191 name: 'stopRPC', 192 call: 'admin_stopRPC' 193 }), 194 new web3._extend.Method({ 195 name: 'startWS', 196 call: 'admin_startWS', 197 params: 4, 198 inputFormatter: [null, null, null, null] 199 }), 200 new web3._extend.Method({ 201 name: 'stopWS', 202 call: 'admin_stopWS' 203 }), 204 ], 205 properties: [ 206 new web3._extend.Property({ 207 name: 'nodeInfo', 208 getter: 'admin_nodeInfo' 209 }), 210 new web3._extend.Property({ 211 name: 'peers', 212 getter: 'admin_peers' 213 }), 214 new web3._extend.Property({ 215 name: 'datadir', 216 getter: 'admin_datadir' 217 }), 218 ] 219 }); 220 ` 221 222 const Debug_JS = ` 223 web3._extend({ 224 property: 'debug', 225 methods: [ 226 new web3._extend.Method({ 227 name: 'printBlock', 228 call: 'debug_printBlock', 229 params: 1 230 }), 231 new web3._extend.Method({ 232 name: 'getBlockRlp', 233 call: 'debug_getBlockRlp', 234 params: 1 235 }), 236 new web3._extend.Method({ 237 name: 'setHead', 238 call: 'debug_setHead', 239 params: 1 240 }), 241 new web3._extend.Method({ 242 name: 'seedHash', 243 call: 'debug_seedHash', 244 params: 1 245 }), 246 new web3._extend.Method({ 247 name: 'dumpBlock', 248 call: 'debug_dumpBlock', 249 params: 1 250 }), 251 new web3._extend.Method({ 252 name: 'chaindbProperty', 253 call: 'debug_chaindbProperty', 254 params: 1, 255 outputFormatter: console.log 256 }), 257 new web3._extend.Method({ 258 name: 'chaindbCompact', 259 call: 'debug_chaindbCompact', 260 }), 261 new web3._extend.Method({ 262 name: 'metrics', 263 call: 'debug_metrics', 264 params: 1 265 }), 266 new web3._extend.Method({ 267 name: 'verbosity', 268 call: 'debug_verbosity', 269 params: 1 270 }), 271 new web3._extend.Method({ 272 name: 'vmodule', 273 call: 'debug_vmodule', 274 params: 1 275 }), 276 new web3._extend.Method({ 277 name: 'backtraceAt', 278 call: 'debug_backtraceAt', 279 params: 1, 280 }), 281 new web3._extend.Method({ 282 name: 'stacks', 283 call: 'debug_stacks', 284 params: 0, 285 outputFormatter: console.log 286 }), 287 new web3._extend.Method({ 288 name: 'freeOSMemory', 289 call: 'debug_freeOSMemory', 290 params: 0, 291 }), 292 new web3._extend.Method({ 293 name: 'setGCPercent', 294 call: 'debug_setGCPercent', 295 params: 1, 296 }), 297 new web3._extend.Method({ 298 name: 'memStats', 299 call: 'debug_memStats', 300 params: 0, 301 }), 302 new web3._extend.Method({ 303 name: 'gcStats', 304 call: 'debug_gcStats', 305 params: 0, 306 }), 307 new web3._extend.Method({ 308 name: 'cpuProfile', 309 call: 'debug_cpuProfile', 310 params: 2 311 }), 312 new web3._extend.Method({ 313 name: 'startCPUProfile', 314 call: 'debug_startCPUProfile', 315 params: 1 316 }), 317 new web3._extend.Method({ 318 name: 'stopCPUProfile', 319 call: 'debug_stopCPUProfile', 320 params: 0 321 }), 322 new web3._extend.Method({ 323 name: 'goTrace', 324 call: 'debug_goTrace', 325 params: 2 326 }), 327 new web3._extend.Method({ 328 name: 'startGoTrace', 329 call: 'debug_startGoTrace', 330 params: 1 331 }), 332 new web3._extend.Method({ 333 name: 'stopGoTrace', 334 call: 'debug_stopGoTrace', 335 params: 0 336 }), 337 new web3._extend.Method({ 338 name: 'blockProfile', 339 call: 'debug_blockProfile', 340 params: 2 341 }), 342 new web3._extend.Method({ 343 name: 'setBlockProfileRate', 344 call: 'debug_setBlockProfileRate', 345 params: 1 346 }), 347 new web3._extend.Method({ 348 name: 'writeBlockProfile', 349 call: 'debug_writeBlockProfile', 350 params: 1 351 }), 352 new web3._extend.Method({ 353 name: 'mutexProfile', 354 call: 'debug_mutexProfile', 355 params: 2 356 }), 357 new web3._extend.Method({ 358 name: 'setMutexProfileFraction', 359 call: 'debug_setMutexProfileFraction', 360 params: 1 361 }), 362 new web3._extend.Method({ 363 name: 'writeMutexProfile', 364 call: 'debug_writeMutexProfile', 365 params: 1 366 }), 367 new web3._extend.Method({ 368 name: 'writeMemProfile', 369 call: 'debug_writeMemProfile', 370 params: 1 371 }), 372 new web3._extend.Method({ 373 name: 'traceBlock', 374 call: 'debug_traceBlock', 375 params: 2, 376 inputFormatter: [null, null] 377 }), 378 new web3._extend.Method({ 379 name: 'traceBlockFromFile', 380 call: 'debug_traceBlockFromFile', 381 params: 2, 382 inputFormatter: [null, null] 383 }), 384 new web3._extend.Method({ 385 name: 'traceBadBlock', 386 call: 'debug_traceBadBlock', 387 params: 1, 388 inputFormatter: [null] 389 }), 390 new web3._extend.Method({ 391 name: 'traceBlockByNumber', 392 call: 'debug_traceBlockByNumber', 393 params: 2, 394 inputFormatter: [null, null] 395 }), 396 new web3._extend.Method({ 397 name: 'traceBlockByHash', 398 call: 'debug_traceBlockByHash', 399 params: 2, 400 inputFormatter: [null, null] 401 }), 402 new web3._extend.Method({ 403 name: 'traceTransaction', 404 call: 'debug_traceTransaction', 405 params: 2, 406 inputFormatter: [null, null] 407 }), 408 new web3._extend.Method({ 409 name: 'preimage', 410 call: 'debug_preimage', 411 params: 1, 412 inputFormatter: [null] 413 }), 414 new web3._extend.Method({ 415 name: 'getBadBlocks', 416 call: 'debug_getBadBlocks', 417 params: 0, 418 }), 419 new web3._extend.Method({ 420 name: 'storageRangeAt', 421 call: 'debug_storageRangeAt', 422 params: 5, 423 }), 424 new web3._extend.Method({ 425 name: 'getModifiedAccountsByNumber', 426 call: 'debug_getModifiedAccountsByNumber', 427 params: 2, 428 inputFormatter: [null, null], 429 }), 430 new web3._extend.Method({ 431 name: 'getModifiedAccountsByHash', 432 call: 'debug_getModifiedAccountsByHash', 433 params: 2, 434 inputFormatter:[null, null], 435 }), 436 ], 437 properties: [] 438 }); 439 ` 440 441 const Eth_JS = ` 442 web3._extend({ 443 property: 'eth', 444 methods: [ 445 new web3._extend.Method({ 446 name: 'sendRawPrivateTransaction', 447 call: 'eth_sendRawPrivateTransaction', 448 params: 2, 449 inputFormatter: [null, null] 450 }), 451 new web3._extend.Method({ 452 name: 'chainId', 453 call: 'eth_chainId', 454 params: 0 455 }), 456 new web3._extend.Method({ 457 name: 'sign', 458 call: 'eth_sign', 459 params: 2, 460 inputFormatter: [web3._extend.formatters.inputAddressFormatter, null] 461 }), 462 new web3._extend.Method({ 463 name: 'resend', 464 call: 'eth_resend', 465 params: 3, 466 inputFormatter: [web3._extend.formatters.inputTransactionFormatter, web3._extend.utils.fromDecimal, web3._extend.utils.fromDecimal] 467 }), 468 new web3._extend.Method({ 469 name: 'signTransaction', 470 call: 'eth_signTransaction', 471 params: 1, 472 inputFormatter: [web3._extend.formatters.inputTransactionFormatter] 473 }), 474 new web3._extend.Method({ 475 name: 'submitTransaction', 476 call: 'eth_submitTransaction', 477 params: 1, 478 inputFormatter: [web3._extend.formatters.inputTransactionFormatter] 479 }), 480 new web3._extend.Method({ 481 name: 'getRawTransaction', 482 call: 'eth_getRawTransactionByHash', 483 params: 1 484 }), 485 new web3._extend.Method({ 486 name: 'getRawTransactionFromBlock', 487 call: function(args) { 488 return (web3._extend.utils.isString(args[0]) && args[0].indexOf('0x') === 0) ? 'eth_getRawTransactionByBlockHashAndIndex' : 'eth_getRawTransactionByBlockNumberAndIndex'; 489 }, 490 params: 2, 491 inputFormatter: [web3._extend.formatters.inputBlockNumberFormatter, web3._extend.utils.toHex] 492 }), 493 new web3._extend.Method({ 494 name: 'getProof', 495 call: 'eth_getProof', 496 params: 3, 497 inputFormatter: [web3._extend.formatters.inputAddressFormatter, null, web3._extend.formatters.inputBlockNumberFormatter] 498 }), 499 new web3._extend.Method({ 500 name: 'storageRoot', 501 call: 'eth_storageRoot', 502 params: 2, 503 inputFormatter: [web3._extend.formatters.inputAddressFormatter, null] 504 }) 505 ], 506 properties: [ 507 new web3._extend.Property({ 508 name: 'pendingTransactions', 509 getter: 'eth_pendingTransactions', 510 outputFormatter: function(txs) { 511 var formatted = []; 512 for (var i = 0; i < txs.length; i++) { 513 formatted.push(web3._extend.formatters.outputTransactionFormatter(txs[i])); 514 formatted[i].blockHash = null; 515 } 516 return formatted; 517 } 518 }), 519 ] 520 }); 521 ` 522 523 const Miner_JS = ` 524 web3._extend({ 525 property: 'miner', 526 methods: [ 527 new web3._extend.Method({ 528 name: 'start', 529 call: 'miner_start', 530 params: 1, 531 inputFormatter: [null] 532 }), 533 new web3._extend.Method({ 534 name: 'stop', 535 call: 'miner_stop' 536 }), 537 new web3._extend.Method({ 538 name: 'setEtherbase', 539 call: 'miner_setEtherbase', 540 params: 1, 541 inputFormatter: [web3._extend.formatters.inputAddressFormatter] 542 }), 543 new web3._extend.Method({ 544 name: 'setExtra', 545 call: 'miner_setExtra', 546 params: 1 547 }), 548 new web3._extend.Method({ 549 name: 'setGasPrice', 550 call: 'miner_setGasPrice', 551 params: 1, 552 inputFormatter: [web3._extend.utils.fromDecimal] 553 }), 554 new web3._extend.Method({ 555 name: 'setRecommitInterval', 556 call: 'miner_setRecommitInterval', 557 params: 1, 558 }), 559 new web3._extend.Method({ 560 name: 'getHashrate', 561 call: 'miner_getHashrate' 562 }), 563 ], 564 properties: [] 565 }); 566 ` 567 568 const Net_JS = ` 569 web3._extend({ 570 property: 'net', 571 methods: [], 572 properties: [ 573 new web3._extend.Property({ 574 name: 'version', 575 getter: 'net_version' 576 }), 577 ] 578 }); 579 ` 580 581 const Personal_JS = ` 582 web3._extend({ 583 property: 'personal', 584 methods: [ 585 new web3._extend.Method({ 586 name: 'importRawKey', 587 call: 'personal_importRawKey', 588 params: 2 589 }), 590 new web3._extend.Method({ 591 name: 'sign', 592 call: 'personal_sign', 593 params: 3, 594 inputFormatter: [null, web3._extend.formatters.inputAddressFormatter, null] 595 }), 596 new web3._extend.Method({ 597 name: 'ecRecover', 598 call: 'personal_ecRecover', 599 params: 2 600 }), 601 new web3._extend.Method({ 602 name: 'openWallet', 603 call: 'personal_openWallet', 604 params: 2 605 }), 606 new web3._extend.Method({ 607 name: 'deriveAccount', 608 call: 'personal_deriveAccount', 609 params: 3 610 }), 611 new web3._extend.Method({ 612 name: 'signTransaction', 613 call: 'personal_signTransaction', 614 params: 2, 615 inputFormatter: [web3._extend.formatters.inputTransactionFormatter, null] 616 }), 617 ], 618 properties: [ 619 new web3._extend.Property({ 620 name: 'listWallets', 621 getter: 'personal_listWallets' 622 }), 623 ] 624 }) 625 ` 626 627 const RPC_JS = ` 628 web3._extend({ 629 property: 'rpc', 630 methods: [], 631 properties: [ 632 new web3._extend.Property({ 633 name: 'modules', 634 getter: 'rpc_modules' 635 }), 636 ] 637 }); 638 ` 639 640 const Shh_JS = ` 641 web3._extend({ 642 property: 'shh', 643 methods: [ 644 ], 645 properties: 646 [ 647 new web3._extend.Property({ 648 name: 'version', 649 getter: 'shh_version', 650 outputFormatter: web3._extend.utils.toDecimal 651 }), 652 new web3._extend.Property({ 653 name: 'info', 654 getter: 'shh_info' 655 }), 656 ] 657 }); 658 ` 659 660 const SWARMFS_JS = ` 661 web3._extend({ 662 property: 'swarmfs', 663 methods: 664 [ 665 new web3._extend.Method({ 666 name: 'mount', 667 call: 'swarmfs_mount', 668 params: 2 669 }), 670 new web3._extend.Method({ 671 name: 'unmount', 672 call: 'swarmfs_unmount', 673 params: 1 674 }), 675 new web3._extend.Method({ 676 name: 'listmounts', 677 call: 'swarmfs_listmounts', 678 params: 0 679 }), 680 ] 681 }); 682 ` 683 684 const TxPool_JS = ` 685 web3._extend({ 686 property: 'txpool', 687 methods: [], 688 properties: 689 [ 690 new web3._extend.Property({ 691 name: 'content', 692 getter: 'txpool_content' 693 }), 694 new web3._extend.Property({ 695 name: 'inspect', 696 getter: 'txpool_inspect' 697 }), 698 new web3._extend.Property({ 699 name: 'status', 700 getter: 'txpool_status', 701 outputFormatter: function(status) { 702 status.pending = web3._extend.utils.toDecimal(status.pending); 703 status.queued = web3._extend.utils.toDecimal(status.queued); 704 return status; 705 } 706 }), 707 ] 708 }); 709 ` 710 711 const Raft_JS = ` 712 web3._extend({ 713 property: 'raft', 714 methods: 715 [ 716 ], 717 properties: 718 [ 719 new web3._extend.Property({ 720 name: 'role', 721 getter: 'raft_role' 722 }), 723 new web3._extend.Method({ 724 name: 'addPeer', 725 call: 'raft_addPeer', 726 params: 1 727 }), 728 new web3._extend.Method({ 729 name: 'addLearner', 730 call: 'raft_addLearner', 731 params: 1 732 }), 733 new web3._extend.Method({ 734 name: 'promoteToPeer', 735 call: 'raft_promoteToPeer', 736 params: 1 737 }), 738 new web3._extend.Method({ 739 name: 'removePeer', 740 call: 'raft_removePeer', 741 params: 1 742 }), 743 new web3._extend.Property({ 744 name: 'leader', 745 getter: 'raft_leader' 746 }), 747 new web3._extend.Property({ 748 name: 'cluster', 749 getter: 'raft_cluster' 750 }), 751 ] 752 }) 753 ` 754 755 const QUORUM_NODE_JS = ` 756 web3._extend({ 757 property: 'quorumPermission', 758 methods: 759 [ 760 new web3._extend.Method({ 761 name: 'addOrg', 762 call: 'quorumPermission_addOrg', 763 params: 4, 764 inputFormatter: [null,null,web3._extend.formatters.inputAddressFormatter,web3._extend.formatters.inputTransactionFormatter] 765 }), 766 new web3._extend.Method({ 767 name: 'approveOrg', 768 call: 'quorumPermission_approveOrg', 769 params: 4, 770 inputFormatter: [null,null,web3._extend.formatters.inputAddressFormatter,web3._extend.formatters.inputTransactionFormatter] 771 }), 772 new web3._extend.Method({ 773 name: 'addSubOrg', 774 call: 'quorumPermission_addSubOrg', 775 params: 4, 776 inputFormatter: [null,null,null,web3._extend.formatters.inputTransactionFormatter] 777 }), 778 new web3._extend.Method({ 779 name: 'updateOrgStatus', 780 call: 'quorumPermission_updateOrgStatus', 781 params: 3, 782 inputFormatter: [null,null,web3._extend.formatters.inputTransactionFormatter] 783 }), 784 new web3._extend.Method({ 785 name: 'approveOrgStatus', 786 call: 'quorumPermission_approveOrgStatus', 787 params: 3, 788 inputFormatter: [null,null,web3._extend.formatters.inputTransactionFormatter] 789 }), 790 new web3._extend.Method({ 791 name: 'addNode', 792 call: 'quorumPermission_addNode', 793 params: 3, 794 inputFormatter: [null,null,web3._extend.formatters.inputTransactionFormatter] 795 }), 796 new web3._extend.Method({ 797 name: 'updateNodeStatus', 798 call: 'quorumPermission_updateNodeStatus', 799 params: 4, 800 inputFormatter: [null,null,null,web3._extend.formatters.inputTransactionFormatter] 801 }), 802 new web3._extend.Method({ 803 name: 'assignAdminRole', 804 call: 'quorumPermission_assignAdminRole', 805 params: 4, 806 inputFormatter: [null,web3._extend.formatters.inputAddressFormatter,null, web3._extend.formatters.inputTransactionFormatter] 807 }), 808 new web3._extend.Method({ 809 name: 'approveAdminRole', 810 call: 'quorumPermission_approveAdminRole', 811 params: 3, 812 inputFormatter: [null, web3._extend.formatters.inputAddressFormatter,web3._extend.formatters.inputTransactionFormatter] 813 }), 814 new web3._extend.Method({ 815 name: 'addNewRole', 816 call: 'quorumPermission_addNewRole', 817 params: 6, 818 inputFormatter: [null,null,null,null,null,web3._extend.formatters.inputTransactionFormatter] 819 }), 820 new web3._extend.Method({ 821 name: 'removeRole', 822 call: 'quorumPermission_removeRole', 823 params: 3, 824 inputFormatter: [null,null,web3._extend.formatters.inputTransactionFormatter] 825 }), 826 new web3._extend.Method({ 827 name: 'addAccountToOrg', 828 call: 'quorumPermission_addAccountToOrg', 829 params: 4, 830 inputFormatter: [web3._extend.formatters.inputAddressFormatter,null,null,web3._extend.formatters.inputTransactionFormatter] 831 }), 832 new web3._extend.Method({ 833 name: 'changeAccountRole', 834 call: 'quorumPermission_changeAccountRole', 835 params: 4, 836 inputFormatter: [web3._extend.formatters.inputAddressFormatter,null,null,web3._extend.formatters.inputTransactionFormatter] 837 }), 838 new web3._extend.Method({ 839 name: 'updateAccountStatus', 840 call: 'quorumPermission_updateAccountStatus', 841 params: 4, 842 inputFormatter: [null, web3._extend.formatters.inputAddressFormatter,null,web3._extend.formatters.inputTransactionFormatter] 843 }), 844 new web3._extend.Method({ 845 name: 'recoverBlackListedNode', 846 call: 'quorumPermission_recoverBlackListedNode', 847 params: 3, 848 inputFormatter: [null, null, web3._extend.formatters.inputTransactionFormatter] 849 }), 850 new web3._extend.Method({ 851 name: 'approveBlackListedNodeRecovery', 852 call: 'quorumPermission_approveBlackListedNodeRecovery', 853 params: 3, 854 inputFormatter: [null, null, web3._extend.formatters.inputTransactionFormatter] 855 }), 856 new web3._extend.Method({ 857 name: 'recoverBlackListedAccount', 858 call: 'quorumPermission_recoverBlackListedAccount', 859 params: 3, 860 inputFormatter: [null, web3._extend.formatters.inputAddressFormatter, web3._extend.formatters.inputTransactionFormatter] 861 }), 862 new web3._extend.Method({ 863 name: 'approveBlackListedAccountRecovery', 864 call: 'quorumPermission_approveBlackListedAccountRecovery', 865 params: 3, 866 inputFormatter: [null, web3._extend.formatters.inputAddressFormatter, web3._extend.formatters.inputTransactionFormatter] 867 }), 868 new web3._extend.Method({ 869 name: 'getOrgDetails', 870 call: 'quorumPermission_getOrgDetails', 871 params: 1, 872 inputFormatter: [null] 873 }), 874 875 ], 876 properties: 877 [ 878 new web3._extend.Property({ 879 name: 'orgList', 880 getter: 'quorumPermission_orgList' 881 }), 882 new web3._extend.Property({ 883 name: 'nodeList', 884 getter: 'quorumPermission_nodeList' 885 }), 886 new web3._extend.Property({ 887 name: 'roleList', 888 getter: 'quorumPermission_roleList' 889 }), 890 new web3._extend.Property({ 891 name: 'acctList', 892 getter: 'quorumPermission_acctList' 893 }), 894 ] 895 }) 896 ` 897 898 const Istanbul_JS = ` 899 web3._extend({ 900 property: 'istanbul', 901 methods: 902 [ 903 new web3._extend.Method({ 904 name: 'getSnapshot', 905 call: 'istanbul_getSnapshot', 906 params: 1, 907 inputFormatter: [null] 908 }), 909 new web3._extend.Method({ 910 name: 'getSnapshotAtHash', 911 call: 'istanbul_getSnapshotAtHash', 912 params: 1 913 }), 914 new web3._extend.Method({ 915 name: 'getValidators', 916 call: 'istanbul_getValidators', 917 params: 1, 918 inputFormatter: [null] 919 }), 920 new web3._extend.Method({ 921 name: 'getValidatorsAtHash', 922 call: 'istanbul_getValidatorsAtHash', 923 params: 1 924 }), 925 new web3._extend.Method({ 926 name: 'propose', 927 call: 'istanbul_propose', 928 params: 2 929 }), 930 new web3._extend.Method({ 931 name: 'discard', 932 call: 'istanbul_discard', 933 params: 1 934 }), 935 936 new web3._extend.Method({ 937 name: 'getSignersFromBlock', 938 call: 'istanbul_getSignersFromBlock', 939 params: 1, 940 inputFormatter: [web3._extend.formatters.inputBlockNumberFormatter] 941 }), 942 new web3._extend.Method({ 943 name: 'getSignersFromBlockByHash', 944 call: 'istanbul_getSignersFromBlockByHash', 945 params: 1 946 }), 947 ], 948 properties: 949 [ 950 new web3._extend.Property({ 951 name: 'candidates', 952 getter: 'istanbul_candidates' 953 }), 954 new web3._extend.Property({ 955 name: 'nodeAddress', 956 getter: 'istanbul_nodeAddress' 957 }), 958 ] 959 }); 960 `