github.com/klaytn/klaytn@v1.12.1/console/web3ext/web3ext.go (about) 1 // Modifications Copyright 2018 The klaytn Authors 2 // Copyright 2015 The go-ethereum Authors 3 // This file is part of the go-ethereum library. 4 // 5 // The go-ethereum library is free software: you can redistribute it and/or modify 6 // it under the terms of the GNU Lesser General Public License as published by 7 // the Free Software Foundation, either version 3 of the License, or 8 // (at your option) any later version. 9 // 10 // The go-ethereum library is distributed in the hope that it will be useful, 11 // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 // GNU Lesser General Public License for more details. 14 // 15 // You should have received a copy of the GNU Lesser General Public License 16 // along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>. 17 // 18 // This file is derived from internal/web3ext/web3ext.go (2018/06/04). 19 // Modified and improved for the klaytn development. 20 21 package web3ext 22 23 var Modules = map[string]string{ 24 "admin": Admin_JS, 25 "debug": Debug_JS, 26 "klay": Klay_JS, 27 "net": Net_JS, 28 "personal": Personal_JS, 29 "rpc": RPC_JS, 30 "txpool": TxPool_JS, 31 "istanbul": Istanbul_JS, 32 "mainbridge": MainBridge_JS, 33 "subbridge": SubBridge_JS, 34 "clique": CliqueJs, 35 "governance": Governance_JS, 36 "bootnode": Bootnode_JS, 37 "chaindatafetcher": ChainDataFetcher_JS, 38 "eth": Eth_JS, 39 } 40 41 const Eth_JS = ` 42 web3._extend({ 43 property: 'eth', 44 methods: [ 45 new web3._extend.Method({ 46 name: 'chainId', 47 call: 'eth_chainId', 48 params: 0 49 }), 50 new web3._extend.Method({ 51 name: 'sign', 52 call: 'eth_sign', 53 params: 2, 54 inputFormatter: [web3._extend.formatters.inputAddressFormatter, null] 55 }), 56 new web3._extend.Method({ 57 name: 'resend', 58 call: 'eth_resend', 59 params: 3, 60 inputFormatter: [web3._extend.formatters.inputTransactionFormatter, web3._extend.utils.fromDecimal, web3._extend.utils.fromDecimal] 61 }), 62 new web3._extend.Method({ 63 name: 'signTransaction', 64 call: 'eth_signTransaction', 65 params: 1, 66 inputFormatter: [web3._extend.formatters.inputTransactionFormatter] 67 }), 68 new web3._extend.Method({ 69 name: 'estimateGas', 70 call: 'eth_estimateGas', 71 params: 2, 72 inputFormatter: [web3._extend.formatters.inputCallFormatter, web3._extend.formatters.inputBlockNumberFormatter], 73 outputFormatter: web3._extend.utils.toDecimal 74 }), 75 new web3._extend.Method({ 76 name: 'submitTransaction', 77 call: 'eth_submitTransaction', 78 params: 1, 79 inputFormatter: [web3._extend.formatters.inputTransactionFormatter] 80 }), 81 new web3._extend.Method({ 82 name: 'fillTransaction', 83 call: 'eth_fillTransaction', 84 params: 1, 85 inputFormatter: [web3._extend.formatters.inputTransactionFormatter] 86 }), 87 new web3._extend.Method({ 88 name: 'getHeaderByNumber', 89 call: 'eth_getHeaderByNumber', 90 params: 1, 91 inputFormatter: [web3._extend.formatters.inputBlockNumberFormatter] 92 }), 93 new web3._extend.Method({ 94 name: 'getHeaderByHash', 95 call: 'eth_getHeaderByHash', 96 params: 1 97 }), 98 new web3._extend.Method({ 99 name: 'getBlockByNumber', 100 call: 'eth_getBlockByNumber', 101 params: 2, 102 inputFormatter: [web3._extend.formatters.inputBlockNumberFormatter, function (val) { return !!val; }] 103 }), 104 new web3._extend.Method({ 105 name: 'getBlockByHash', 106 call: 'eth_getBlockByHash', 107 params: 2, 108 inputFormatter: [null, function (val) { return !!val; }] 109 }), 110 new web3._extend.Method({ 111 name: 'getBlockReceipts', 112 call: 'eth_getBlockReceipts', 113 params: 1, 114 outputFormatter: function(receipts) { 115 return receipts.map(web3._extend.formatters.outputTransactionReceiptFormatter); 116 } 117 }), 118 new web3._extend.Method({ 119 name: 'getRawTransaction', 120 call: 'eth_getRawTransactionByHash', 121 params: 1 122 }), 123 new web3._extend.Method({ 124 name: 'getRawTransactionFromBlock', 125 call: function(args) { 126 return (web3._extend.utils.isString(args[0]) && args[0].indexOf('0x') === 0) ? 'eth_getRawTransactionByBlockHashAndIndex' : 'eth_getRawTransactionByBlockNumberAndIndex'; 127 }, 128 params: 2, 129 inputFormatter: [web3._extend.formatters.inputBlockNumberFormatter, web3._extend.utils.toHex] 130 }), 131 new web3._extend.Method({ 132 name: 'getProof', 133 call: 'eth_getProof', 134 params: 3, 135 inputFormatter: [web3._extend.formatters.inputAddressFormatter, null, web3._extend.formatters.inputBlockNumberFormatter] 136 }), 137 new web3._extend.Method({ 138 name: 'createAccessList', 139 call: 'eth_createAccessList', 140 params: 2, 141 inputFormatter: [web3._extend.formatters.inputCallFormatter, web3._extend.formatters.inputBlockNumberFormatter], 142 }), 143 new web3._extend.Method({ 144 name: 'feeHistory', 145 call: 'eth_feeHistory', 146 params: 3, 147 inputFormatter: [null, web3._extend.formatters.inputBlockNumberFormatter, null] 148 }), 149 ], 150 properties: [ 151 new web3._extend.Property({ 152 name: 'pendingTransactions', 153 getter: 'eth_pendingTransactions', 154 outputFormatter: function(txs) { 155 var formatted = []; 156 for (var i = 0; i < txs.length; i++) { 157 formatted.push(web3._extend.formatters.outputTransactionFormatter(txs[i])); 158 formatted[i].blockHash = null; 159 } 160 return formatted; 161 } 162 }), 163 new web3._extend.Property({ 164 name: 'maxPriorityFeePerGas', 165 getter: 'eth_maxPriorityFeePerGas', 166 outputFormatter: web3._extend.utils.toBigNumber 167 }), 168 ] 169 }); 170 ` 171 172 const ChainDataFetcher_JS = ` 173 web3._extend({ 174 property: 'chaindatafetcher', 175 methods: [ 176 new web3._extend.Method({ 177 name: 'startFetching', 178 call: 'chaindatafetcher_startFetching', 179 params: 0 180 }), 181 new web3._extend.Method({ 182 name: 'stopFetching', 183 call: 'chaindatafetcher_stopFetching', 184 params: 0 185 }), 186 new web3._extend.Method({ 187 name: 'startRangeFetching', 188 call: 'chaindatafetcher_startRangeFetching', 189 params: 3 190 }), 191 new web3._extend.Method({ 192 name: 'stopRangeFetching', 193 call: 'chaindatafetcher_stopRangeFetching', 194 params: 0 195 }), 196 new web3._extend.Method({ 197 name: 'readCheckpoint', 198 call: 'chaindatafetcher_readCheckpoint', 199 params: 0 200 }), 201 new web3._extend.Method({ 202 name: 'status', 203 call: 'chaindatafetcher_status', 204 params: 0 205 }), 206 new web3._extend.Method({ 207 name: 'writeCheckpoint', 208 call: 'chaindatafetcher_writeCheckpoint', 209 params: 1 210 }), 211 new web3._extend.Method({ 212 name: 'getConfig', 213 call: 'chaindatafetcher_getConfig', 214 params: 0 215 }) 216 ], 217 properties: [] 218 }); 219 ` 220 221 const Bootnode_JS = ` 222 web3._extend({ 223 property: 'bootnode', 224 methods: [ 225 new web3._extend.Method({ 226 name: 'createUpdateNodeOnDB', 227 call: 'bootnode_createUpdateNodeOnDB', 228 params: 1 229 }), 230 new web3._extend.Method({ 231 name: 'createUpdateNodeOnTable', 232 call: 'bootnode_createUpdateNodeOnTable', 233 params: 1 234 }), 235 new web3._extend.Method({ 236 name: 'getNodeFromDB', 237 call: 'bootnode_getNodeFromDB', 238 params: 1 239 }), 240 new web3._extend.Method({ 241 name: 'getTableEntries', 242 call: 'bootnode_getTableEntries' 243 }), 244 new web3._extend.Method({ 245 name: 'getTableReplacements', 246 call: 'bootnode_getTableReplacements' 247 }), 248 new web3._extend.Method({ 249 name: 'deleteNodeFromDB', 250 call: 'bootnode_deleteNodeFromDB', 251 params: 1 252 }), 253 new web3._extend.Method({ 254 name: 'deleteNodeFromTable', 255 call: 'bootnode_deleteNodeFromTable', 256 params: 1 257 }), 258 new web3._extend.Method({ 259 name: 'name', 260 call: 'bootnode_name', 261 params: 0 262 }), 263 new web3._extend.Method({ 264 name: 'resolve', 265 call: 'bootnode_resolve', 266 params: 2 267 }), 268 new web3._extend.Method({ 269 name: 'lookup', 270 call: 'bootnode_lookup', 271 params: 2 272 }), 273 new web3._extend.Method({ 274 name: 'readRandomNodes', 275 call: 'bootnode_readRandomNodes', 276 params: 1 277 }), 278 new web3._extend.Method({ 279 name: 'getAuthorizedNodes', 280 call: 'bootnode_getAuthorizedNodes', 281 params: 0 282 }), 283 new web3._extend.Method({ 284 name: 'putAuthorizedNodes', 285 call: 'bootnode_putAuthorizedNodes', 286 params: 1 287 }), 288 new web3._extend.Method({ 289 name: 'deleteAuthorizedNodes', 290 call: 'bootnode_deleteAuthorizedNodes', 291 params: 1 292 }) 293 ], 294 properties: [] 295 }); 296 ` 297 298 const Governance_JS = ` 299 web3._extend({ 300 property: 'governance', 301 methods: [ 302 new web3._extend.Method({ 303 name: 'vote', 304 call: 'governance_vote', 305 params: 2 306 }), 307 new web3._extend.Method({ 308 name: 'getParams', 309 call: 'governance_getParams', 310 params: 1, 311 inputFormatter: [web3._extend.formatters.inputBlockNumberFormatter] 312 }), 313 new web3._extend.Method({ 314 name: 'itemCacheFromDb', 315 call: 'governance_itemCacheFromDb', 316 params: 1, 317 inputFormatter: [web3._extend.formatters.inputBlockNumberFormatter] 318 }), 319 new web3._extend.Method({ 320 name: 'getStakingInfo', 321 call: 'governance_getStakingInfo', 322 params: 1, 323 inputFormatter: [web3._extend.formatters.inputBlockNumberFormatter] 324 }), 325 new web3._extend.Method({ 326 name: 'getChainConfig', 327 call: 'governance_getChainConfig', 328 params: 1, 329 inputFormatter: [web3._extend.formatters.inputBlockNumberFormatter] 330 }), 331 new web3._extend.Method({ 332 name: 'getRewardsAccumulated', 333 call: 'governance_getRewardsAccumulated', 334 params: 2, 335 inputFormatter: [web3._extend.formatters.inputBlockNumberFormatter, web3._extend.formatters.inputBlockNumberFormatter] 336 }) 337 ], 338 properties: [ 339 new web3._extend.Property({ 340 name: 'showTally', 341 getter: 'governance_showTally', 342 }), 343 new web3._extend.Property({ 344 name: 'totalVotingPower', 345 getter: 'governance_totalVotingPower', 346 }), 347 new web3._extend.Property({ 348 name: 'myVotes', 349 getter: 'governance_myVotes', 350 }), 351 new web3._extend.Property({ 352 name: 'myVotingPower', 353 getter: 'governance_myVotingPower', 354 }), 355 new web3._extend.Property({ 356 name: 'nodeAddress', 357 getter: 'governance_nodeAddress', 358 }), 359 new web3._extend.Property({ 360 name: 'pendingChanges', 361 getter: 'governance_pendingChanges', 362 }), 363 new web3._extend.Property({ 364 name: 'votes', 365 getter: 'governance_votes', 366 }), 367 new web3._extend.Property({ 368 name: 'idxCache', 369 getter: 'governance_idxCache', 370 }), 371 new web3._extend.Property({ 372 name: 'idxCacheFromDb', 373 getter: 'governance_idxCacheFromDb', 374 }) 375 ] 376 }); 377 ` 378 379 const Admin_JS = ` 380 web3._extend({ 381 property: 'admin', 382 methods: [ 383 new web3._extend.Method({ 384 name: 'addPeer', 385 call: 'admin_addPeer', 386 params: 1 387 }), 388 new web3._extend.Method({ 389 name: 'removePeer', 390 call: 'admin_removePeer', 391 params: 1 392 }), 393 new web3._extend.Method({ 394 name: 'exportChain', 395 call: 'admin_exportChain', 396 params: 3, 397 inputFormatter: [null, web3._extend.formatters.inputBlockNumberFormatter, web3._extend.formatters.inputBlockNumberFormatter], 398 }), 399 new web3._extend.Method({ 400 name: 'importChain', 401 call: 'admin_importChain', 402 params: 1 403 }), 404 new web3._extend.Method({ 405 name: 'importChainFromString', 406 call: 'admin_importChainFromString', 407 params: 1 408 }), 409 new web3._extend.Method({ 410 name: 'sleepBlocks', 411 call: 'admin_sleepBlocks', 412 params: 2 413 }), 414 new web3._extend.Method({ 415 name: 'startHTTP', 416 call: 'admin_startHTTP', 417 params: 5, 418 inputFormatter: [null, null, null, null, null] 419 }), 420 new web3._extend.Method({ 421 name: 'stopHTTP', 422 call: 'admin_stopHTTP' 423 }), 424 // This method is deprecated. 425 new web3._extend.Method({ 426 name: 'startRPC', 427 call: 'admin_startRPC', 428 params: 5, 429 inputFormatter: [null, null, null, null, null] 430 }), 431 // This method is deprecated. 432 new web3._extend.Method({ 433 name: 'stopRPC', 434 call: 'admin_stopRPC' 435 }), 436 new web3._extend.Method({ 437 name: 'startWS', 438 call: 'admin_startWS', 439 params: 4, 440 inputFormatter: [null, null, null, null] 441 }), 442 new web3._extend.Method({ 443 name: 'stopWS', 444 call: 'admin_stopWS' 445 }), 446 new web3._extend.Method({ 447 name: 'startStateMigration', 448 call: 'admin_startStateMigration', 449 }), 450 new web3._extend.Method({ 451 name: 'stopStateMigration', 452 call: 'admin_stopStateMigration', 453 }), 454 new web3._extend.Method({ 455 name: 'saveTrieNodeCacheToDisk', 456 call: 'admin_saveTrieNodeCacheToDisk', 457 }), 458 new web3._extend.Method({ 459 name: 'setMaxSubscriptionPerWSConn', 460 call: 'admin_setMaxSubscriptionPerWSConn', 461 params: 1 462 }), 463 new web3._extend.Method({ 464 name: 'startSpamThrottler', 465 call: 'admin_startSpamThrottler', 466 params: 1, 467 inputFormatter: [null] 468 }), 469 new web3._extend.Method({ 470 name: 'stopSpamThrottler', 471 call: 'admin_stopSpamThrottler', 472 }), 473 new web3._extend.Method({ 474 name: 'setSpamThrottlerWhiteList', 475 call: 'admin_setSpamThrottlerWhiteList', 476 params: 1, 477 }), 478 new web3._extend.Method({ 479 name: 'getSpamThrottlerWhiteList', 480 call: 'admin_getSpamThrottlerWhiteList', 481 }), 482 new web3._extend.Method({ 483 name: 'getSpamThrottlerThrottleList', 484 call: 'admin_getSpamThrottlerThrottleList', 485 }), 486 new web3._extend.Method({ 487 name: 'getSpamThrottlerCandidateList', 488 call: 'admin_getSpamThrottlerCandidateList', 489 }), 490 new web3._extend.Method({ 491 name: 'syncStakingInfo', 492 call: 'admin_syncStakingInfo', 493 params: 3, 494 }), 495 new web3._extend.Method({ 496 name: 'syncStakingInfoStatus', 497 call: 'admin_syncStakingInfoStatus', 498 }), 499 ], 500 properties: [ 501 new web3._extend.Property({ 502 name: 'nodeInfo', 503 getter: 'admin_nodeInfo' 504 }), 505 new web3._extend.Property({ 506 name: 'peers', 507 getter: 'admin_peers' 508 }), 509 new web3._extend.Property({ 510 name: 'datadir', 511 getter: 'admin_datadir' 512 }), 513 new web3._extend.Property({ 514 name: 'stateMigrationStatus', 515 getter: 'admin_stateMigrationStatus' 516 }), 517 new web3._extend.Property({ 518 name: 'spamThrottlerConfig', 519 getter: 'admin_spamThrottlerConfig' 520 }), 521 new web3._extend.Property({ 522 name: 'nodeConfig', 523 getter: 'admin_nodeConfig', 524 }), 525 ] 526 }); 527 ` 528 529 const Debug_JS = ` 530 web3._extend({ 531 property: 'debug', 532 methods: [ 533 new web3._extend.Method({ 534 name: 'dumpBlock', 535 call: 'debug_dumpBlock', 536 params: 1 537 }), 538 new web3._extend.Method({ 539 name: 'dumpStateTrie', 540 call: 'debug_dumpStateTrie', 541 params: 1 542 }), 543 new web3._extend.Method({ 544 name: 'getBlockRlp', 545 call: 'debug_getBlockRlp', 546 params: 1 547 }), 548 new web3._extend.Method({ 549 name: 'getModifiedAccountsByNumber', 550 call: 'debug_getModifiedAccountsByNumber', 551 params: 2, 552 inputFormatter: [null, null], 553 }), 554 new web3._extend.Method({ 555 name: 'getModifiedAccountsByHash', 556 call: 'debug_getModifiedAccountsByHash', 557 params: 2, 558 inputFormatter:[null, null], 559 }), 560 new web3._extend.Method({ 561 name: 'getModifiedStorageNodesByNumber', 562 call: 'debug_getModifiedStorageNodesByNumber', 563 params: 4, 564 inputFormatter: [null, null, null, null], 565 }), 566 new web3._extend.Method({ 567 name: 'getBadBlocks', 568 call: 'debug_getBadBlocks', 569 params: 0, 570 }), 571 new web3._extend.Method({ 572 name: 'printBlock', 573 call: 'debug_printBlock', 574 params: 1 575 }), 576 new web3._extend.Method({ 577 name: 'setHead', 578 call: 'debug_setHead', 579 params: 1, 580 inputFormatter: [web3._extend.formatters.inputBlockNumberFormatter] 581 }), 582 new web3._extend.Method({ 583 name: 'startWarmUp', 584 call: 'debug_startWarmUp', 585 params: 1, 586 inputFormatter: [null] 587 }), 588 new web3._extend.Method({ 589 name: 'startContractWarmUp', 590 call: 'debug_startContractWarmUp', 591 params: 2, 592 inputFormatter: [web3._extend.formatters.inputAddressFormatter, null] 593 }), 594 new web3._extend.Method({ 595 name: 'stopWarmUp', 596 call: 'debug_stopWarmUp', 597 }), 598 new web3._extend.Method({ 599 name: 'startCollectingTrieStats', 600 call: 'debug_startCollectingTrieStats', 601 params: 1, 602 }), 603 new web3._extend.Method({ 604 name: 'chaindbProperty', 605 call: 'debug_chaindbProperty', 606 params: 1, 607 outputFormatter: console.log 608 }), 609 new web3._extend.Method({ 610 name: 'chaindbCompact', 611 call: 'debug_chaindbCompact', 612 }), 613 new web3._extend.Method({ 614 name: 'metrics', 615 call: 'debug_metrics', 616 params: 1 617 }), 618 new web3._extend.Method({ 619 name: 'verbosity', 620 call: 'debug_verbosity', 621 params: 1 622 }), 623 new web3._extend.Method({ 624 name: 'verbosityByName', 625 call: 'debug_verbosityByName', 626 params: 2 627 }), 628 new web3._extend.Method({ 629 name: 'verbosityByID', 630 call: 'debug_verbosityByID', 631 params: 2 632 }), 633 new web3._extend.Method({ 634 name: 'vmodule', 635 call: 'debug_vmodule', 636 params: 1 637 }), 638 new web3._extend.Method({ 639 name: 'backtraceAt', 640 call: 'debug_backtraceAt', 641 params: 1, 642 }), 643 new web3._extend.Method({ 644 name: 'stacks', 645 call: 'debug_stacks', 646 params: 0, 647 outputFormatter: console.log 648 }), 649 new web3._extend.Method({ 650 name: 'freeOSMemory', 651 call: 'debug_freeOSMemory', 652 params: 0, 653 }), 654 new web3._extend.Method({ 655 name: 'setGCPercent', 656 call: 'debug_setGCPercent', 657 params: 1, 658 }), 659 new web3._extend.Method({ 660 name: 'memStats', 661 call: 'debug_memStats', 662 params: 0, 663 }), 664 new web3._extend.Method({ 665 name: 'gcStats', 666 call: 'debug_gcStats', 667 params: 0, 668 }), 669 new web3._extend.Method({ 670 name: 'startPProf', 671 call: 'debug_startPProf', 672 params: 2, 673 inputFormatter: [null, null] 674 }), 675 new web3._extend.Method({ 676 name: 'stopPProf', 677 call: 'debug_stopPProf', 678 params: 0 679 }), 680 new web3._extend.Method({ 681 name: 'isPProfRunning', 682 call: 'debug_isPProfRunning', 683 params: 0 684 }), 685 new web3._extend.Method({ 686 name: 'cpuProfile', 687 call: 'debug_cpuProfile', 688 params: 2 689 }), 690 new web3._extend.Method({ 691 name: 'startCPUProfile', 692 call: 'debug_startCPUProfile', 693 params: 1 694 }), 695 new web3._extend.Method({ 696 name: 'stopCPUProfile', 697 call: 'debug_stopCPUProfile', 698 params: 0 699 }), 700 new web3._extend.Method({ 701 name: 'goTrace', 702 call: 'debug_goTrace', 703 params: 2 704 }), 705 new web3._extend.Method({ 706 name: 'startGoTrace', 707 call: 'debug_startGoTrace', 708 params: 1 709 }), 710 new web3._extend.Method({ 711 name: 'stopGoTrace', 712 call: 'debug_stopGoTrace', 713 params: 0 714 }), 715 new web3._extend.Method({ 716 name: 'blockProfile', 717 call: 'debug_blockProfile', 718 params: 2 719 }), 720 new web3._extend.Method({ 721 name: 'setBlockProfileRate', 722 call: 'debug_setBlockProfileRate', 723 params: 1 724 }), 725 new web3._extend.Method({ 726 name: 'writeBlockProfile', 727 call: 'debug_writeBlockProfile', 728 params: 1 729 }), 730 new web3._extend.Method({ 731 name: 'mutexProfile', 732 call: 'debug_mutexProfile', 733 params: 2 734 }), 735 new web3._extend.Method({ 736 name: 'setMutexProfileRate', 737 call: 'debug_setMutexProfileRate', 738 params: 1 739 }), 740 new web3._extend.Method({ 741 name: 'writeMutexProfile', 742 call: 'debug_writeMutexProfile', 743 params: 1 744 }), 745 new web3._extend.Method({ 746 name: 'writeMemProfile', 747 call: 'debug_writeMemProfile', 748 params: 1 749 }), 750 new web3._extend.Method({ 751 name: 'traceBlock', 752 call: 'debug_traceBlock', 753 params: 2, 754 inputFormatter: [null, null] 755 }), 756 new web3._extend.Method({ 757 name: 'traceBlockFromFile', 758 call: 'debug_traceBlockFromFile', 759 params: 2, 760 inputFormatter: [null, null] 761 }), 762 new web3._extend.Method({ 763 name: 'traceBadBlock', 764 call: 'debug_traceBadBlock', 765 params: 1, 766 inputFormatter: [null] 767 }), 768 new web3._extend.Method({ 769 name: 'standardTraceBadBlockToFile', 770 call: 'debug_standardTraceBadBlockToFile', 771 params: 2, 772 inputFormatter: [null, null] 773 }), 774 new web3._extend.Method({ 775 name: 'standardTraceBlockToFile', 776 call: 'debug_standardTraceBlockToFile', 777 params: 2, 778 inputFormatter: [null, null] 779 }), 780 new web3._extend.Method({ 781 name: 'traceBlockByNumber', 782 call: 'debug_traceBlockByNumber', 783 params: 2, 784 inputFormatter: [web3._extend.formatters.inputBlockNumberFormatter, null] 785 }), 786 new web3._extend.Method({ 787 name: 'traceBlockByNumberRange', 788 call: 'debug_traceBlockByNumberRange', 789 params: 3, 790 inputFormatter: [web3._extend.formatters.inputBlockNumberFormatter, web3._extend.formatters.inputBlockNumberFormatter, null] 791 }), 792 new web3._extend.Method({ 793 name: 'traceBlockByHash', 794 call: 'debug_traceBlockByHash', 795 params: 2, 796 inputFormatter: [null, null] 797 }), 798 new web3._extend.Method({ 799 name: 'traceTransaction', 800 call: 'debug_traceTransaction', 801 params: 2, 802 inputFormatter: [null, null] 803 }), 804 new web3._extend.Method({ 805 name: 'traceCall', 806 call: 'debug_traceCall', 807 params: 3, 808 inputFormatter: [null, null, null] 809 }), 810 new web3._extend.Method({ 811 name: 'preimage', 812 call: 'debug_preimage', 813 params: 1, 814 inputFormatter: [null] 815 }), 816 new web3._extend.Method({ 817 name: 'storageRangeAt', 818 call: 'debug_storageRangeAt', 819 params: 5, 820 }), 821 new web3._extend.Method({ 822 name: 'setVMLogTarget', 823 call: 'debug_setVMLogTarget', 824 params: 1 825 }), 826 ], 827 properties: [] 828 }); 829 ` 830 831 const Klay_JS = ` 832 var blockWithConsensusInfoCall = function (args) { 833 return (web3._extend.utils.isString(args[0]) && args[0].indexOf('0x') === 0) ? "klay_getBlockWithConsensusInfoByHash" : "klay_getBlockWithConsensusInfoByNumber"; 834 }; 835 836 web3._extend({ 837 property: 'klay', 838 methods: [ 839 new web3._extend.Method({ 840 name: 'clientVersion', 841 call: 'klay_clientVersion', 842 }), 843 new web3._extend.Method({ 844 name: 'getBlockReceipts', 845 call: 'klay_getBlockReceipts', 846 params: 1, 847 outputFormatter: function(receipts) { 848 return receipts.map(web3._extend.formatters.outputTransactionReceiptFormatter); 849 } 850 }), 851 new web3._extend.Method({ 852 name: 'sign', 853 call: 'klay_sign', 854 params: 2, 855 inputFormatter: [web3._extend.formatters.inputAddressFormatter, null] 856 }), 857 new web3._extend.Method({ 858 name: 'resend', 859 call: 'klay_resend', 860 params: 3, 861 inputFormatter: [web3._extend.formatters.inputTransactionFormatter, web3._extend.utils.fromDecimal, web3._extend.utils.fromDecimal] 862 }), 863 new web3._extend.Method({ 864 name: 'signTransaction', 865 call: 'klay_signTransaction', 866 params: 1, 867 inputFormatter: [web3._extend.formatters.inputTransactionFormatter] 868 }), 869 new web3._extend.Method({ 870 name: 'signTransactionAsFeePayer', 871 call: 'klay_signTransactionAsFeePayer', 872 params: 1, 873 inputFormatter: [web3._extend.formatters.inputTransactionFormatter] 874 }), 875 new web3._extend.Method({ 876 name: 'sendTransactionAsFeePayer', 877 call: 'klay_sendTransactionAsFeePayer', 878 params: 1, 879 inputFormatter: [web3._extend.formatters.inputTransactionFormatter] 880 }), 881 new web3._extend.Method({ 882 name: 'getCouncil', 883 call: 'klay_getCouncil', 884 params: 1, 885 inputFormatter: [web3._extend.formatters.inputBlockNumberFormatter] 886 }), 887 new web3._extend.Method({ 888 name: 'getCouncilSize', 889 call: 'klay_getCouncilSize', 890 params: 1, 891 inputFormatter: [web3._extend.formatters.inputBlockNumberFormatter] 892 }), 893 new web3._extend.Method({ 894 name: 'getCommittee', 895 call: 'klay_getCommittee', 896 params: 1, 897 inputFormatter: [web3._extend.formatters.inputBlockNumberFormatter] 898 }), 899 new web3._extend.Method({ 900 name: 'getCommitteeSize', 901 call: 'klay_getCommitteeSize', 902 params: 1, 903 inputFormatter: [web3._extend.formatters.inputBlockNumberFormatter] 904 }), 905 new web3._extend.Method({ 906 name: 'getRewards', 907 call: 'klay_getRewards', 908 params: 1, 909 inputFormatter: [web3._extend.formatters.inputBlockNumberFormatter], 910 }), 911 new web3._extend.Method({ 912 name: 'getStakingInfo', 913 call: 'klay_getStakingInfo', 914 params: 1, 915 inputFormatter: [web3._extend.formatters.inputBlockNumberFormatter] 916 }), 917 new web3._extend.Method({ 918 name: 'getParams', 919 call: 'klay_getParams', 920 params: 1, 921 inputFormatter: [web3._extend.formatters.inputBlockNumberFormatter] 922 }), 923 new web3._extend.Method({ 924 name: 'getChainConfig', 925 call: 'klay_getChainConfig', 926 params: 1, 927 inputFormatter: [web3._extend.formatters.inputBlockNumberFormatter], 928 }), 929 new web3._extend.Method({ 930 name: 'accountCreated', 931 call: 'klay_accountCreated', 932 params: 2, 933 inputFormatter: [web3._extend.formatters.inputAddressFormatter, web3._extend.formatters.inputDefaultBlockNumberFormatter], 934 }), 935 new web3._extend.Method({ 936 name: 'getAccount', 937 call: 'klay_getAccount', 938 params: 2, 939 inputFormatter: [web3._extend.formatters.inputAddressFormatter, web3._extend.formatters.inputDefaultBlockNumberFormatter], 940 }), 941 new web3._extend.Method({ 942 name: 'getHeaderByNumber', 943 call: 'klay_getHeaderByNumber', 944 params: 1, 945 inputFormatter: [web3._extend.formatters.inputBlockNumberFormatter] 946 }), 947 new web3._extend.Method({ 948 name: 'getHeaderByHash', 949 call: 'klay_getHeaderByHash', 950 params: 1 951 }), 952 new web3._extend.Method({ 953 name: 'getBlockWithConsensusInfo', 954 call: blockWithConsensusInfoCall, 955 params: 1, 956 inputFormatter: [web3._extend.formatters.inputBlockNumberFormatter] 957 }), 958 new web3._extend.Method({ 959 name: 'getBlockWithConsensusInfoRange', 960 call: 'klay_getBlockWithConsensusInfoByNumberRange', 961 params: 2, 962 inputFormatter: [web3._extend.formatters.inputBlockNumberFormatter, web3._extend.formatters.inputBlockNumberFormatter] 963 }), 964 new web3._extend.Method({ 965 name: 'isContractAccount', 966 call: 'klay_isContractAccount', 967 params: 2, 968 inputFormatter: [web3._extend.formatters.inputAddressFormatter, web3._extend.formatters.inputDefaultBlockNumberFormatter] 969 }), 970 new web3._extend.Method({ 971 name: 'submitTransaction', 972 call: 'klay_submitTransaction', 973 params: 1, 974 inputFormatter: [web3._extend.formatters.inputTransactionFormatter] 975 }), 976 new web3._extend.Method({ 977 name: 'getRawTransaction', 978 call: 'klay_getRawTransactionByHash', 979 params: 1 980 }), 981 new web3._extend.Method({ 982 name: 'estimateComputationCost', 983 call: 'klay_estimateComputationCost', 984 params: 2, 985 inputFormatter: [web3._extend.formatters.inputCallFormatter, web3._extend.formatters.inputDefaultBlockNumberFormatter] 986 }), 987 new web3._extend.Method({ 988 name: 'getAccountKey', 989 call: 'klay_getAccountKey', 990 params: 2, 991 inputFormatter: [web3._extend.formatters.inputAddressFormatter, web3._extend.formatters.inputDefaultBlockNumberFormatter] 992 }), 993 new web3._extend.Method({ 994 name: 'getRawTransactionFromBlock', 995 call: function(args) { 996 return (web3._extend.utils.isString(args[0]) && args[0].indexOf('0x') === 0) ? 'klay_getRawTransactionByBlockHashAndIndex' : 'klay_getRawTransactionByBlockNumberAndIndex'; 997 }, 998 params: 2, 999 inputFormatter: [web3._extend.formatters.inputBlockNumberFormatter, web3._extend.utils.toHex] 1000 }), 1001 new web3._extend.Method({ 1002 name: 'isParallelDBWrite', 1003 call: 'klay_isParallelDBWrite', 1004 }), 1005 new web3._extend.Method({ 1006 name: 'isSenderTxHashIndexingEnabled', 1007 call: 'klay_isSenderTxHashIndexingEnabled', 1008 }), 1009 new web3._extend.Method({ 1010 name: 'getTransactionBySenderTxHash', 1011 call: 'klay_getTransactionBySenderTxHash', 1012 params: 1 1013 }), 1014 new web3._extend.Method({ 1015 name: 'getTransactionReceiptBySenderTxHash', 1016 call: 'klay_getTransactionReceiptBySenderTxHash', 1017 params: 1 1018 }), 1019 new web3._extend.Method({ 1020 name: 'recoverFromTransaction', 1021 call: 'klay_recoverFromTransaction', 1022 params: 2 1023 }), 1024 new web3._extend.Method({ 1025 name: 'recoverFromMessage', 1026 call: 'klay_recoverFromMessage', 1027 params: 4 1028 }), 1029 new web3._extend.Method({ 1030 name: 'getCypressCredit', 1031 call: 'klay_getCypressCredit', 1032 }), 1033 new web3._extend.Method({ 1034 name: 'sha3', 1035 call: 'klay_sha3', 1036 params: 1, 1037 inputFormatter: [web3._extend.utils.toHex], 1038 }), 1039 new web3._extend.Method({ 1040 name: 'forkStatus', 1041 call: 'klay_forkStatus', 1042 params: 1, 1043 inputFormatter: [web3._extend.formatters.inputBlockNumberFormatter] 1044 }), 1045 new web3._extend.Method({ 1046 name: 'encodeAccountKey', 1047 call: 'klay_encodeAccountKey', 1048 params: 1, 1049 }), 1050 new web3._extend.Method({ 1051 name: 'decodeAccountKey', 1052 call: 'klay_decodeAccountKey', 1053 params: 1, 1054 }), 1055 new web3._extend.Method({ 1056 name: 'createAccessList', 1057 call: 'klay_createAccessList', 1058 params: 2, 1059 inputFormatter: [web3._extend.formatters.inputCallFormatter, web3._extend.formatters.inputBlockNumberFormatter], 1060 }), 1061 new web3._extend.Method({ 1062 name: 'feeHistory', 1063 call: 'klay_feeHistory', 1064 params: 3, 1065 inputFormatter: [null, web3._extend.formatters.inputBlockNumberFormatter, null] 1066 }), 1067 new web3._extend.Method({ 1068 name: 'getProof', 1069 call: 'klay_getProof', 1070 params: 3, 1071 inputFormatter: [web3._extend.formatters.inputAddressFormatter, null, web3._extend.formatters.inputBlockNumberFormatter] 1072 }), 1073 ], 1074 properties: [ 1075 new web3._extend.Property({ 1076 name: 'pendingTransactions', 1077 getter: 'klay_pendingTransactions', 1078 outputFormatter: function(txs) { 1079 var formatted = []; 1080 for (var i = 0; i < txs.length; i++) { 1081 formatted.push(web3._extend.formatters.outputTransactionFormatter(txs[i])); 1082 formatted[i].blockHash = null; 1083 } 1084 return formatted; 1085 } 1086 }), 1087 new web3._extend.Property({ 1088 name: 'nodeAddress', 1089 getter: 'klay_nodeAddress', 1090 }), 1091 new web3._extend.Property({ 1092 name : 'rewardbase', 1093 getter: 'klay_rewardbase' 1094 }), 1095 new web3._extend.Property({ 1096 name : 'gasPrice', 1097 getter: 'klay_gasPrice', 1098 outputFormatter: web3._extend.formatters.outputBigNumberFormatter 1099 }), 1100 new web3._extend.Property({ 1101 name : 'upperBoundGasPrice', 1102 getter: 'klay_upperBoundGasPrice', 1103 outputFormatter: web3._extend.formatters.outputBigNumberFormatter 1104 }), 1105 new web3._extend.Property({ 1106 name : 'lowerBoundGasPrice', 1107 getter: 'klay_lowerBoundGasPrice', 1108 outputFormatter: web3._extend.formatters.outputBigNumberFormatter 1109 }), 1110 new web3._extend.Property({ 1111 name: 'maxPriorityFeePerGas', 1112 getter: 'klay_maxPriorityFeePerGas', 1113 outputFormatter: web3._extend.utils.toBigNumber 1114 }), 1115 ] 1116 }); 1117 ` 1118 1119 const Net_JS = ` 1120 web3._extend({ 1121 property: 'net', 1122 methods: [ 1123 new web3._extend.Method({ 1124 name: 'peerCountByType', 1125 call: 'net_peerCountByType', 1126 params: 0, 1127 }), 1128 ], 1129 properties: [ 1130 new web3._extend.Property({ 1131 name: 'version', 1132 getter: 'net_version' 1133 }), 1134 new web3._extend.Property({ 1135 name: 'networkID', 1136 getter: 'net_networkID' 1137 }), 1138 ] 1139 }); 1140 ` 1141 1142 const Personal_JS = ` 1143 web3._extend({ 1144 property: 'personal', 1145 methods: [ 1146 new web3._extend.Method({ 1147 name: 'importRawKey', 1148 call: 'personal_importRawKey', 1149 params: 2 1150 }), 1151 new web3._extend.Method({ 1152 name: 'replaceRawKey', 1153 call: 'personal_replaceRawKey', 1154 params: 3 1155 }), 1156 new web3._extend.Method({ 1157 name: 'sign', 1158 call: 'personal_sign', 1159 params: 3, 1160 inputFormatter: [null, web3._extend.formatters.inputAddressFormatter, null] 1161 }), 1162 new web3._extend.Method({ 1163 name: 'ecRecover', 1164 call: 'personal_ecRecover', 1165 params: 2 1166 }), 1167 new web3._extend.Method({ 1168 name: 'openWallet', 1169 call: 'personal_openWallet', 1170 params: 2 1171 }), 1172 new web3._extend.Method({ 1173 name: 'deriveAccount', 1174 call: 'personal_deriveAccount', 1175 params: 3 1176 }), 1177 new web3._extend.Method({ 1178 name: 'sendValueTransfer', 1179 call: 'personal_sendValueTransfer', 1180 params: 2, 1181 inputFormatter: [web3._extend.formatters.inputTransactionFormatter, null] 1182 }), 1183 new web3._extend.Method({ 1184 name: 'sendAccountUpdate', 1185 call: 'personal_sendAccountUpdate', 1186 params: 2, 1187 inputFormatter: [web3._extend.formatters.inputTransactionFormatter, null] 1188 }), 1189 new web3._extend.Method({ 1190 name: 'signTransaction', 1191 call: 'personal_signTransaction', 1192 params: 2, 1193 inputFormatter: [web3._extend.formatters.inputTransactionFormatter, null] 1194 }), 1195 ], 1196 properties: [ 1197 new web3._extend.Property({ 1198 name: 'listWallets', 1199 getter: 'personal_listWallets' 1200 }), 1201 ] 1202 }) 1203 ` 1204 1205 const RPC_JS = ` 1206 web3._extend({ 1207 property: 'rpc', 1208 methods: [], 1209 properties: [ 1210 new web3._extend.Property({ 1211 name: 'modules', 1212 getter: 'rpc_modules' 1213 }), 1214 ] 1215 }); 1216 ` 1217 1218 const TxPool_JS = ` 1219 web3._extend({ 1220 property: 'txpool', 1221 methods: [], 1222 properties: 1223 [ 1224 new web3._extend.Property({ 1225 name: 'content', 1226 getter: 'txpool_content' 1227 }), 1228 new web3._extend.Property({ 1229 name: 'inspect', 1230 getter: 'txpool_inspect' 1231 }), 1232 new web3._extend.Property({ 1233 name: 'status', 1234 getter: 'txpool_status', 1235 outputFormatter: function(status) { 1236 status.pending = web3._extend.utils.toDecimal(status.pending); 1237 status.queued = web3._extend.utils.toDecimal(status.queued); 1238 return status; 1239 } 1240 }), 1241 ] 1242 }); 1243 ` 1244 1245 const Istanbul_JS = ` 1246 web3._extend({ 1247 property: 'istanbul', 1248 methods: 1249 [ 1250 new web3._extend.Method({ 1251 name: 'getSnapshot', 1252 call: 'istanbul_getSnapshot', 1253 params: 1, 1254 inputFormatter: [null] 1255 }), 1256 new web3._extend.Method({ 1257 name: 'getSnapshotAtHash', 1258 call: 'istanbul_getSnapshotAtHash', 1259 params: 1 1260 }), 1261 new web3._extend.Method({ 1262 name: 'getValidators', 1263 call: 'istanbul_getValidators', 1264 params: 1, 1265 inputFormatter: [null] 1266 }), 1267 new web3._extend.Method({ 1268 name: 'getValidatorsAtHash', 1269 call: 'istanbul_getValidatorsAtHash', 1270 params: 1 1271 }), 1272 new web3._extend.Method({ 1273 name: 'getDemotedValidators', 1274 call: 'istanbul_getDemotedValidators', 1275 params: 1, 1276 inputFormatter: [null] 1277 }), 1278 new web3._extend.Method({ 1279 name: 'getDemotedValidatorsAtHash', 1280 call: 'istanbul_getDemotedValidatorsAtHash', 1281 params: 1 1282 }), 1283 new web3._extend.Method({ 1284 name: 'discard', 1285 call: 'istanbul_discard', 1286 params: 1 1287 }) 1288 ], 1289 properties: 1290 [ 1291 new web3._extend.Property({ 1292 name: 'candidates', 1293 getter: 'istanbul_candidates' 1294 }), 1295 new web3._extend.Property({ 1296 name: 'timeout', 1297 getter: 'istanbul_getTimeout' 1298 }) 1299 ] 1300 }); 1301 ` 1302 1303 const MainBridge_JS = ` 1304 web3._extend({ 1305 property: 'mainbridge', 1306 methods: 1307 [ 1308 new web3._extend.Method({ 1309 name: 'getChildChainIndexingEnabled', 1310 call: 'mainbridge_getChildChainIndexingEnabled' 1311 }), 1312 new web3._extend.Method({ 1313 name: 'convertChildChainBlockHashToParentChainTxHash', 1314 call: 'mainbridge_convertChildChainBlockHashToParentChainTxHash', 1315 params: 1 1316 }), 1317 ], 1318 properties: [ 1319 new web3._extend.Property({ 1320 name: 'nodeInfo', 1321 getter: 'mainbridge_nodeInfo' 1322 }), 1323 new web3._extend.Property({ 1324 name: 'peers', 1325 getter: 'mainbridge_peers' 1326 }), 1327 ] 1328 }); 1329 ` 1330 1331 const SubBridge_JS = ` 1332 web3._extend({ 1333 property: 'subbridge', 1334 methods: 1335 [ 1336 new web3._extend.Method({ 1337 name: 'addPeer', 1338 call: 'subbridge_addPeer', 1339 params: 1 1340 }), 1341 new web3._extend.Method({ 1342 name: 'removePeer', 1343 call: 'subbridge_removePeer', 1344 params: 1 1345 }), 1346 new web3._extend.Method({ 1347 name: 'getReceiptFromParentChain', 1348 call: 'subbridge_getReceiptFromParentChain', 1349 params: 1 1350 }), 1351 new web3._extend.Method({ 1352 name: 'getAnchoringTxHashByBlockNumber', 1353 call: 'subbridge_getAnchoringTxHashByBlockNumber', 1354 params: 1 1355 }), 1356 new web3._extend.Method({ 1357 name: 'registerOperator', 1358 call: 'subbridge_registerOperator', 1359 params: 2 1360 }), 1361 new web3._extend.Method({ 1362 name: 'getOperators', 1363 call: 'subbridge_getRegisteredOperators', 1364 params: 1 1365 }), 1366 new web3._extend.Method({ 1367 name: 'getValueTransferOperatorThreshold', 1368 call: 'subbridge_getValueTransferOperatorThreshold', 1369 params: 1 1370 }), 1371 new web3._extend.Method({ 1372 name: 'setValueTransferOperatorThreshold', 1373 call: 'subbridge_setValueTransferOperatorThreshold', 1374 params: 2 1375 }), 1376 new web3._extend.Method({ 1377 name: 'deployBridge', 1378 call: 'subbridge_deployBridge', 1379 params: 0 1380 }), 1381 new web3._extend.Method({ 1382 name: 'subscribeBridge', 1383 call: 'subbridge_subscribeBridge', 1384 params: 2, 1385 inputFormatter: [null, web3._extend.formatters.inputEmptyFormatter] 1386 }), 1387 new web3._extend.Method({ 1388 name: 'unsubscribeBridge', 1389 call: 'subbridge_unsubscribeBridge', 1390 params: 2, 1391 inputFormatter: [null, web3._extend.formatters.inputEmptyFormatter] 1392 }), 1393 new web3._extend.Method({ 1394 name: 'KASAnchor', 1395 call: 'subbridge_kASAnchor', 1396 params: 1 1397 }), 1398 new web3._extend.Method({ 1399 name: 'anchoring', 1400 call: 'subbridge_anchoring', 1401 params: 1 1402 }), 1403 new web3._extend.Method({ 1404 name: 'registerBridge', 1405 call: 'subbridge_registerBridge', 1406 params: 3, 1407 inputFormatter: [null, null, web3._extend.formatters.inputEmptyFormatter] 1408 }), 1409 new web3._extend.Method({ 1410 name: 'deregisterBridge', 1411 call: 'subbridge_deregisterBridge', 1412 params: 2, 1413 inputFormatter: [null, web3._extend.formatters.inputEmptyFormatter] 1414 }), 1415 new web3._extend.Method({ 1416 name: 'registerToken', 1417 call: 'subbridge_registerToken', 1418 params: 4, 1419 inputFormatter: [null, null, null, web3._extend.formatters.inputEmptyFormatter] 1420 }), 1421 new web3._extend.Method({ 1422 name: 'deregisterToken', 1423 call: 'subbridge_deregisterToken', 1424 params: 4, 1425 inputFormatter: [null, null, null, web3._extend.formatters.inputEmptyFormatter] 1426 }), 1427 new web3._extend.Method({ 1428 name: 'convertRequestTxHashToHandleTxHash', 1429 call: 'subbridge_convertRequestTxHashToHandleTxHash', 1430 params: 1 1431 }), 1432 new web3._extend.Method({ 1433 name: 'getBridgeInformation', 1434 call: 'subbridge_getBridgeInformation', 1435 params: 1 1436 }), 1437 new web3._extend.Method({ 1438 name: 'getParentTransactionReceipt', 1439 call: 'subbridge_getParentTransactionReceipt', 1440 params: 1 1441 }), 1442 new web3._extend.Method({ 1443 name: 'setKLAYFee', 1444 call: 'subbridge_setKLAYFee', 1445 params: 2 1446 }), 1447 new web3._extend.Method({ 1448 name: 'setERC20Fee', 1449 call: 'subbridge_setERC20Fee', 1450 params: 3 1451 }), 1452 new web3._extend.Method({ 1453 name: 'setFeeReceiver', 1454 call: 'subbridge_setFeeReceiver', 1455 params: 2 1456 }), 1457 new web3._extend.Method({ 1458 name: 'getKLAYFee', 1459 call: 'subbridge_getKLAYFee', 1460 params: 1 1461 }), 1462 new web3._extend.Method({ 1463 name: 'getERC20Fee', 1464 call: 'subbridge_getERC20Fee', 1465 params: 2 1466 }), 1467 new web3._extend.Method({ 1468 name: 'getFeeReceiver', 1469 call: 'subbridge_getFeeReceiver', 1470 params: 1 1471 }), 1472 new web3._extend.Method({ 1473 name: 'lockParentOperator', 1474 call: 'subbridge_lockParentOperator' 1475 }), 1476 new web3._extend.Method({ 1477 name: 'lockChildOperator', 1478 call: 'subbridge_lockChildOperator' 1479 }), 1480 new web3._extend.Method({ 1481 name: 'unlockParentOperator', 1482 call: 'subbridge_unlockParentOperator', 1483 params: 2 1484 }), 1485 new web3._extend.Method({ 1486 name: 'unlockChildOperator', 1487 call: 'subbridge_unlockChildOperator', 1488 params: 2 1489 }), 1490 new web3._extend.Method({ 1491 name: 'setParentOperatorFeePayer', 1492 call: 'subbridge_setParentOperatorFeePayer', 1493 params: 1 1494 }), 1495 new web3._extend.Method({ 1496 name: 'setChildOperatorFeePayer', 1497 call: 'subbridge_setChildOperatorFeePayer', 1498 params: 1 1499 }), 1500 new web3._extend.Method({ 1501 name: 'getBridgePairByAlias', 1502 call: 'subbridge_getBridgePairByAlias', 1503 params: 1 1504 }), 1505 new web3._extend.Method({ 1506 name: 'changeBridgeAlias', 1507 call: 'subbridge_changeBridgeAlias', 1508 params: 2 1509 }), 1510 new web3._extend.Method({ 1511 name: 'setParentBridgeOperatorGasLimit', 1512 call: 'subbridge_setParentBridgeOperatorGasLimit', 1513 params: 1 1514 }), 1515 new web3._extend.Method({ 1516 name: 'setChildBridgeOperatorGasLimit', 1517 call: 'subbridge_setChildBridgeOperatorGasLimit', 1518 params: 1 1519 }), 1520 new web3._extend.Method({ 1521 name: 'getParentBridgeContractBalance', 1522 call: 'subbridge_getParentBridgeContractBalance', 1523 params: 1, 1524 outputFormatter: web3._extend.formatters.outputBigNumberFormatter 1525 }), 1526 new web3._extend.Method({ 1527 name: 'getChildBridgeContractBalance', 1528 call: 'subbridge_getChildBridgeContractBalance', 1529 params: 1, 1530 outputFormatter: web3._extend.formatters.outputBigNumberFormatter 1531 }), 1532 new web3._extend.Method({ 1533 name: 'requestParentSync', 1534 call: 'subbridge_requestParentSync', 1535 params: 0, 1536 }) 1537 ], 1538 properties: [ 1539 new web3._extend.Property({ 1540 name: 'nodeInfo', 1541 getter: 'subbridge_nodeInfo' 1542 }), 1543 new web3._extend.Property({ 1544 name: 'peers', 1545 getter: 'subbridge_peers' 1546 }), 1547 new web3._extend.Property({ 1548 name: 'parentOperator', 1549 getter: 'subbridge_getParentOperatorAddr' 1550 }), 1551 new web3._extend.Property({ 1552 name: 'childOperator', 1553 getter: 'subbridge_getChildOperatorAddr' 1554 }), 1555 new web3._extend.Property({ 1556 name: 'operators', 1557 getter: 'subbridge_getOperators' 1558 }), 1559 new web3._extend.Property({ 1560 name: 'anchoringPeriod', 1561 getter: 'subbridge_getAnchoringPeriod' 1562 }), 1563 new web3._extend.Property({ 1564 name: 'sendChainTxslimit', 1565 getter: 'subbridge_getSentChainTxsLimit' 1566 }), 1567 new web3._extend.Property({ 1568 name: 'parentOperatorNonce', 1569 getter: 'subbridge_getParentOperatorNonce' 1570 }), 1571 new web3._extend.Property({ 1572 name: 'childOperatorNonce', 1573 getter: 'subbridge_getChildOperatorNonce' 1574 }), 1575 new web3._extend.Property({ 1576 name: 'parentOperatorBalance', 1577 getter: 'subbridge_getParentOperatorBalance', 1578 outputFormatter: web3._extend.formatters.outputBigNumberFormatter 1579 }), 1580 new web3._extend.Property({ 1581 name: 'childOperatorBalance', 1582 getter: 'subbridge_getChildOperatorBalance', 1583 outputFormatter: web3._extend.formatters.outputBigNumberFormatter 1584 }), 1585 new web3._extend.Property({ 1586 name: 'listBridge', 1587 getter: 'subbridge_listBridge' 1588 }), 1589 new web3._extend.Property({ 1590 name: 'txPendingCount', 1591 getter: 'subbridge_txPendingCount' 1592 }), 1593 new web3._extend.Property({ 1594 name: 'txPending', 1595 getter: 'subbridge_txPending' 1596 }), 1597 new web3._extend.Property({ 1598 name: 'latestAnchoredBlockNumber', 1599 getter: 'subbridge_getLatestAnchoredBlockNumber' 1600 }), 1601 new web3._extend.Property({ 1602 name: 'parentOperatorFeePayer', 1603 getter: 'subbridge_getParentOperatorFeePayer', 1604 }), 1605 new web3._extend.Property({ 1606 name: 'childOperatorFeePayer', 1607 getter: 'subbridge_getChildOperatorFeePayer', 1608 }), 1609 new web3._extend.Property({ 1610 name: 'parentBridgeOperatorGasLimit', 1611 getter: 'subbridge_getParentBridgeOperatorGasLimit', 1612 }), 1613 new web3._extend.Property({ 1614 name: 'childBridgeOperatorGasLimit', 1615 getter: 'subbridge_getChildBridgeOperatorGasLimit', 1616 }), 1617 1618 new web3._extend.Property({ 1619 name: 'parentGasPrice', 1620 getter: 'subbridge_getParentGasPrice', 1621 }), 1622 new web3._extend.Property({ 1623 name: 'parentKIP71Config', 1624 getter: 'subbridge_getParentKIP71Config', 1625 }), 1626 ] 1627 }); 1628 ` 1629 1630 const CliqueJs = ` 1631 web3._extend({ 1632 property: 'clique', 1633 methods: [ 1634 new web3._extend.Method({ 1635 name: 'getSnapshot', 1636 call: 'clique_getSnapshot', 1637 params: 1, 1638 inputFormatter: [null] 1639 }), 1640 new web3._extend.Method({ 1641 name: 'getSnapshotAtHash', 1642 call: 'clique_getSnapshotAtHash', 1643 params: 1 1644 }), 1645 new web3._extend.Method({ 1646 name: 'getSigners', 1647 call: 'clique_getSigners', 1648 params: 1, 1649 inputFormatter: [null] 1650 }), 1651 new web3._extend.Method({ 1652 name: 'getSignersAtHash', 1653 call: 'clique_getSignersAtHash', 1654 params: 1 1655 }), 1656 new web3._extend.Method({ 1657 name: 'propose', 1658 call: 'clique_propose', 1659 params: 2 1660 }), 1661 new web3._extend.Method({ 1662 name: 'discard', 1663 call: 'clique_discard', 1664 params: 1 1665 }), 1666 ], 1667 properties: [ 1668 new web3._extend.Property({ 1669 name: 'proposals', 1670 getter: 'clique_proposals' 1671 }), 1672 ] 1673 }); 1674 `