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