github.com/sexdefi/go-ethereum@v0.0.0-20230807164010-b4cd42fe399f/internal/web3ext/web3ext.go (about)

     1  // Copyright 2015 The go-ethereum Authors
     2  // This file is part of the go-ethereum library.
     3  //
     4  // The go-ethereum library is free software: you can redistribute it and/or modify
     5  // it under the terms of the GNU Lesser General Public License as published by
     6  // the Free Software Foundation, either version 3 of the License, or
     7  // (at your option) any later version.
     8  //
     9  // The go-ethereum library is distributed in the hope that it will be useful,
    10  // but WITHOUT ANY WARRANTY; without even the implied warranty of
    11  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    12  // GNU Lesser General Public License for more details.
    13  //
    14  // You should have received a copy of the GNU Lesser General Public License
    15  // along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
    16  
    17  // package web3ext contains geth specific web3.js extensions.
    18  package web3ext
    19  
    20  var Modules = map[string]string{
    21  	"admin":    AdminJs,
    22  	"clique":   CliqueJs,
    23  	"ethash":   EthashJs,
    24  	"debug":    DebugJs,
    25  	"eth":      EthJs,
    26  	"miner":    MinerJs,
    27  	"net":      NetJs,
    28  	"personal": PersonalJs,
    29  	"rpc":      RpcJs,
    30  	"txpool":   TxpoolJs,
    31  	"les":      LESJs,
    32  	"vflux":    VfluxJs,
    33  }
    34  
    35  const CliqueJs = `
    36  web3._extend({
    37  	property: 'clique',
    38  	methods: [
    39  		new web3._extend.Method({
    40  			name: 'getSnapshot',
    41  			call: 'clique_getSnapshot',
    42  			params: 1,
    43  			inputFormatter: [web3._extend.formatters.inputBlockNumberFormatter]
    44  		}),
    45  		new web3._extend.Method({
    46  			name: 'getSnapshotAtHash',
    47  			call: 'clique_getSnapshotAtHash',
    48  			params: 1
    49  		}),
    50  		new web3._extend.Method({
    51  			name: 'getSigners',
    52  			call: 'clique_getSigners',
    53  			params: 1,
    54  			inputFormatter: [web3._extend.formatters.inputBlockNumberFormatter]
    55  		}),
    56  		new web3._extend.Method({
    57  			name: 'getSignersAtHash',
    58  			call: 'clique_getSignersAtHash',
    59  			params: 1
    60  		}),
    61  		new web3._extend.Method({
    62  			name: 'propose',
    63  			call: 'clique_propose',
    64  			params: 2
    65  		}),
    66  		new web3._extend.Method({
    67  			name: 'discard',
    68  			call: 'clique_discard',
    69  			params: 1
    70  		}),
    71  		new web3._extend.Method({
    72  			name: 'status',
    73  			call: 'clique_status',
    74  			params: 0
    75  		}),
    76  		new web3._extend.Method({
    77  			name: 'getSigner',
    78  			call: 'clique_getSigner',
    79  			params: 1,
    80  			inputFormatter: [null]
    81  		}),
    82  	],
    83  	properties: [
    84  		new web3._extend.Property({
    85  			name: 'proposals',
    86  			getter: 'clique_proposals'
    87  		}),
    88  	]
    89  });
    90  `
    91  
    92  const EthashJs = `
    93  web3._extend({
    94  	property: 'ethash',
    95  	methods: [
    96  		new web3._extend.Method({
    97  			name: 'getWork',
    98  			call: 'ethash_getWork',
    99  			params: 0
   100  		}),
   101  		new web3._extend.Method({
   102  			name: 'getHashrate',
   103  			call: 'ethash_getHashrate',
   104  			params: 0
   105  		}),
   106  		new web3._extend.Method({
   107  			name: 'submitWork',
   108  			call: 'ethash_submitWork',
   109  			params: 3,
   110  		}),
   111  		new web3._extend.Method({
   112  			name: 'submitHashrate',
   113  			call: 'ethash_submitHashrate',
   114  			params: 2,
   115  		}),
   116  	]
   117  });
   118  `
   119  
   120  const AdminJs = `
   121  web3._extend({
   122  	property: 'admin',
   123  	methods: [
   124  		new web3._extend.Method({
   125  			name: 'addPeer',
   126  			call: 'admin_addPeer',
   127  			params: 1
   128  		}),
   129  		new web3._extend.Method({
   130  			name: 'removePeer',
   131  			call: 'admin_removePeer',
   132  			params: 1
   133  		}),
   134  		new web3._extend.Method({
   135  			name: 'addTrustedPeer',
   136  			call: 'admin_addTrustedPeer',
   137  			params: 1
   138  		}),
   139  		new web3._extend.Method({
   140  			name: 'removeTrustedPeer',
   141  			call: 'admin_removeTrustedPeer',
   142  			params: 1
   143  		}),
   144  		new web3._extend.Method({
   145  			name: 'exportChain',
   146  			call: 'admin_exportChain',
   147  			params: 3,
   148  			inputFormatter: [null, null, null]
   149  		}),
   150  		new web3._extend.Method({
   151  			name: 'importChain',
   152  			call: 'admin_importChain',
   153  			params: 1
   154  		}),
   155  		new web3._extend.Method({
   156  			name: 'sleepBlocks',
   157  			call: 'admin_sleepBlocks',
   158  			params: 2
   159  		}),
   160  		new web3._extend.Method({
   161  			name: 'startHTTP',
   162  			call: 'admin_startHTTP',
   163  			params: 5,
   164  			inputFormatter: [null, null, null, null, null]
   165  		}),
   166  		new web3._extend.Method({
   167  			name: 'stopHTTP',
   168  			call: 'admin_stopHTTP'
   169  		}),
   170  		// This method is deprecated.
   171  		new web3._extend.Method({
   172  			name: 'startRPC',
   173  			call: 'admin_startRPC',
   174  			params: 5,
   175  			inputFormatter: [null, null, null, null, null]
   176  		}),
   177  		// This method is deprecated.
   178  		new web3._extend.Method({
   179  			name: 'stopRPC',
   180  			call: 'admin_stopRPC'
   181  		}),
   182  		new web3._extend.Method({
   183  			name: 'startWS',
   184  			call: 'admin_startWS',
   185  			params: 4,
   186  			inputFormatter: [null, null, null, null]
   187  		}),
   188  		new web3._extend.Method({
   189  			name: 'stopWS',
   190  			call: 'admin_stopWS'
   191  		}),
   192  	],
   193  	properties: [
   194  		new web3._extend.Property({
   195  			name: 'nodeInfo',
   196  			getter: 'admin_nodeInfo'
   197  		}),
   198  		new web3._extend.Property({
   199  			name: 'peers',
   200  			getter: 'admin_peers'
   201  		}),
   202  		new web3._extend.Property({
   203  			name: 'datadir',
   204  			getter: 'admin_datadir'
   205  		}),
   206  	]
   207  });
   208  `
   209  
   210  const DebugJs = `
   211  web3._extend({
   212  	property: 'debug',
   213  	methods: [
   214  		new web3._extend.Method({
   215  			name: 'accountRange',
   216  			call: 'debug_accountRange',
   217  			params: 6,
   218  			inputFormatter: [web3._extend.formatters.inputDefaultBlockNumberFormatter, null, null, null, null, null],
   219  		}),
   220  		new web3._extend.Method({
   221  			name: 'printBlock',
   222  			call: 'debug_printBlock',
   223  			params: 1,
   224  			outputFormatter: console.log
   225  		}),
   226  		new web3._extend.Method({
   227  			name: 'getHeaderRlp',
   228  			call: 'debug_getHeaderRlp',
   229  			params: 1
   230  		}),
   231  		new web3._extend.Method({
   232  			name: 'getBlockRlp',
   233  			call: 'debug_getBlockRlp',
   234  			params: 1
   235  		}),
   236  		new web3._extend.Method({
   237  			name: 'getRawReceipts',
   238  			call: 'debug_getRawReceipts',
   239  			params: 1
   240  		}),
   241  		new web3._extend.Method({
   242  			name: 'setHead',
   243  			call: 'debug_setHead',
   244  			params: 1
   245  		}),
   246  		new web3._extend.Method({
   247  			name: 'seedHash',
   248  			call: 'debug_seedHash',
   249  			params: 1
   250  		}),
   251  		new web3._extend.Method({
   252  			name: 'dumpBlock',
   253  			call: 'debug_dumpBlock',
   254  			params: 1,
   255  			inputFormatter: [web3._extend.formatters.inputBlockNumberFormatter]
   256  		}),
   257  		new web3._extend.Method({
   258  			name: 'chaindbProperty',
   259  			call: 'debug_chaindbProperty',
   260  			params: 1,
   261  			outputFormatter: console.log
   262  		}),
   263  		new web3._extend.Method({
   264  			name: 'chaindbCompact',
   265  			call: 'debug_chaindbCompact',
   266  		}),
   267  		new web3._extend.Method({
   268  			name: 'verbosity',
   269  			call: 'debug_verbosity',
   270  			params: 1
   271  		}),
   272  		new web3._extend.Method({
   273  			name: 'vmodule',
   274  			call: 'debug_vmodule',
   275  			params: 1
   276  		}),
   277  		new web3._extend.Method({
   278  			name: 'backtraceAt',
   279  			call: 'debug_backtraceAt',
   280  			params: 1,
   281  		}),
   282  		new web3._extend.Method({
   283  			name: 'stacks',
   284  			call: 'debug_stacks',
   285  			params: 1,
   286  			inputFormatter: [null],
   287  			outputFormatter: console.log
   288  		}),
   289  		new web3._extend.Method({
   290  			name: 'freeOSMemory',
   291  			call: 'debug_freeOSMemory',
   292  			params: 0,
   293  		}),
   294  		new web3._extend.Method({
   295  			name: 'setGCPercent',
   296  			call: 'debug_setGCPercent',
   297  			params: 1,
   298  		}),
   299  		new web3._extend.Method({
   300  			name: 'memStats',
   301  			call: 'debug_memStats',
   302  			params: 0,
   303  		}),
   304  		new web3._extend.Method({
   305  			name: 'gcStats',
   306  			call: 'debug_gcStats',
   307  			params: 0,
   308  		}),
   309  		new web3._extend.Method({
   310  			name: 'cpuProfile',
   311  			call: 'debug_cpuProfile',
   312  			params: 2
   313  		}),
   314  		new web3._extend.Method({
   315  			name: 'startCPUProfile',
   316  			call: 'debug_startCPUProfile',
   317  			params: 1
   318  		}),
   319  		new web3._extend.Method({
   320  			name: 'stopCPUProfile',
   321  			call: 'debug_stopCPUProfile',
   322  			params: 0
   323  		}),
   324  		new web3._extend.Method({
   325  			name: 'goTrace',
   326  			call: 'debug_goTrace',
   327  			params: 2
   328  		}),
   329  		new web3._extend.Method({
   330  			name: 'startGoTrace',
   331  			call: 'debug_startGoTrace',
   332  			params: 1
   333  		}),
   334  		new web3._extend.Method({
   335  			name: 'stopGoTrace',
   336  			call: 'debug_stopGoTrace',
   337  			params: 0
   338  		}),
   339  		new web3._extend.Method({
   340  			name: 'blockProfile',
   341  			call: 'debug_blockProfile',
   342  			params: 2
   343  		}),
   344  		new web3._extend.Method({
   345  			name: 'setBlockProfileRate',
   346  			call: 'debug_setBlockProfileRate',
   347  			params: 1
   348  		}),
   349  		new web3._extend.Method({
   350  			name: 'writeBlockProfile',
   351  			call: 'debug_writeBlockProfile',
   352  			params: 1
   353  		}),
   354  		new web3._extend.Method({
   355  			name: 'mutexProfile',
   356  			call: 'debug_mutexProfile',
   357  			params: 2
   358  		}),
   359  		new web3._extend.Method({
   360  			name: 'setMutexProfileFraction',
   361  			call: 'debug_setMutexProfileFraction',
   362  			params: 1
   363  		}),
   364  		new web3._extend.Method({
   365  			name: 'writeMutexProfile',
   366  			call: 'debug_writeMutexProfile',
   367  			params: 1
   368  		}),
   369  		new web3._extend.Method({
   370  			name: 'writeMemProfile',
   371  			call: 'debug_writeMemProfile',
   372  			params: 1
   373  		}),
   374  		new web3._extend.Method({
   375  			name: 'traceBlock',
   376  			call: 'debug_traceBlock',
   377  			params: 2,
   378  			inputFormatter: [null, null]
   379  		}),
   380  		new web3._extend.Method({
   381  			name: 'traceBlockFromFile',
   382  			call: 'debug_traceBlockFromFile',
   383  			params: 2,
   384  			inputFormatter: [null, null]
   385  		}),
   386  		new web3._extend.Method({
   387  			name: 'traceBadBlock',
   388  			call: 'debug_traceBadBlock',
   389  			params: 1,
   390  			inputFormatter: [null]
   391  		}),
   392  		new web3._extend.Method({
   393  			name: 'standardTraceBadBlockToFile',
   394  			call: 'debug_standardTraceBadBlockToFile',
   395  			params: 2,
   396  			inputFormatter: [null, null]
   397  		}),
   398  		new web3._extend.Method({
   399  			name: 'intermediateRoots',
   400  			call: 'debug_intermediateRoots',
   401  			params: 2,
   402  			inputFormatter: [null, null]
   403  		}),
   404  		new web3._extend.Method({
   405  			name: 'standardTraceBlockToFile',
   406  			call: 'debug_standardTraceBlockToFile',
   407  			params: 2,
   408  			inputFormatter: [null, null]
   409  		}),
   410  		new web3._extend.Method({
   411  			name: 'traceBlockByNumber',
   412  			call: 'debug_traceBlockByNumber',
   413  			params: 2,
   414  			inputFormatter: [web3._extend.formatters.inputBlockNumberFormatter, null]
   415  		}),
   416  		new web3._extend.Method({
   417  			name: 'traceBlockByHash',
   418  			call: 'debug_traceBlockByHash',
   419  			params: 2,
   420  			inputFormatter: [null, null]
   421  		}),
   422  		new web3._extend.Method({
   423  			name: 'traceTransaction',
   424  			call: 'debug_traceTransaction',
   425  			params: 2,
   426  			inputFormatter: [null, null]
   427  		}),
   428  		new web3._extend.Method({
   429  			name: 'traceCall',
   430  			call: 'debug_traceCall',
   431  			params: 3,
   432  			inputFormatter: [null, null, null]
   433  		}),
   434  		new web3._extend.Method({
   435  			name: 'preimage',
   436  			call: 'debug_preimage',
   437  			params: 1,
   438  			inputFormatter: [null]
   439  		}),
   440  		new web3._extend.Method({
   441  			name: 'getBadBlocks',
   442  			call: 'debug_getBadBlocks',
   443  			params: 0,
   444  		}),
   445  		new web3._extend.Method({
   446  			name: 'storageRangeAt',
   447  			call: 'debug_storageRangeAt',
   448  			params: 5,
   449  		}),
   450  		new web3._extend.Method({
   451  			name: 'getModifiedAccountsByNumber',
   452  			call: 'debug_getModifiedAccountsByNumber',
   453  			params: 2,
   454  			inputFormatter: [null, null],
   455  		}),
   456  		new web3._extend.Method({
   457  			name: 'getModifiedAccountsByHash',
   458  			call: 'debug_getModifiedAccountsByHash',
   459  			params: 2,
   460  			inputFormatter:[null, null],
   461  		}),
   462  		new web3._extend.Method({
   463  			name: 'freezeClient',
   464  			call: 'debug_freezeClient',
   465  			params: 1,
   466  		}),
   467  		new web3._extend.Method({
   468  			name: 'getAccessibleState',
   469  			call: 'debug_getAccessibleState',
   470  			params: 2,
   471  			inputFormatter:[web3._extend.formatters.inputBlockNumberFormatter, web3._extend.formatters.inputBlockNumberFormatter],
   472  		}),
   473  		new web3._extend.Method({
   474  			name: 'dbGet',
   475  			call: 'debug_dbGet',
   476  			params: 1
   477  		}),
   478  		new web3._extend.Method({
   479  			name: 'dbAncient',
   480  			call: 'debug_dbAncient',
   481  			params: 2
   482  		}),
   483  		new web3._extend.Method({
   484  			name: 'dbAncients',
   485  			call: 'debug_dbAncients',
   486  			params: 0
   487  		}),
   488  	],
   489  	properties: []
   490  });
   491  `
   492  
   493  const EthJs = `
   494  web3._extend({
   495  	property: 'eth',
   496  	methods: [
   497  		new web3._extend.Method({
   498  			name: 'chainId',
   499  			call: 'eth_chainId',
   500  			params: 0
   501  		}),
   502  		new web3._extend.Method({
   503  			name: 'sign',
   504  			call: 'eth_sign',
   505  			params: 2,
   506  			inputFormatter: [web3._extend.formatters.inputAddressFormatter, null]
   507  		}),
   508  		new web3._extend.Method({
   509  			name: 'resend',
   510  			call: 'eth_resend',
   511  			params: 3,
   512  			inputFormatter: [web3._extend.formatters.inputTransactionFormatter, web3._extend.utils.fromDecimal, web3._extend.utils.fromDecimal]
   513  		}),
   514  		new web3._extend.Method({
   515  			name: 'signTransaction',
   516  			call: 'eth_signTransaction',
   517  			params: 1,
   518  			inputFormatter: [web3._extend.formatters.inputTransactionFormatter]
   519  		}),
   520  		new web3._extend.Method({
   521  			name: 'estimateGas',
   522  			call: 'eth_estimateGas',
   523  			params: 2,
   524  			inputFormatter: [web3._extend.formatters.inputCallFormatter, web3._extend.formatters.inputBlockNumberFormatter],
   525  			outputFormatter: web3._extend.utils.toDecimal
   526  		}),
   527  		new web3._extend.Method({
   528  			name: 'submitTransaction',
   529  			call: 'eth_submitTransaction',
   530  			params: 1,
   531  			inputFormatter: [web3._extend.formatters.inputTransactionFormatter]
   532  		}),
   533  		new web3._extend.Method({
   534  			name: 'fillTransaction',
   535  			call: 'eth_fillTransaction',
   536  			params: 1,
   537  			inputFormatter: [web3._extend.formatters.inputTransactionFormatter]
   538  		}),
   539  		new web3._extend.Method({
   540  			name: 'getHeaderByNumber',
   541  			call: 'eth_getHeaderByNumber',
   542  			params: 1,
   543  			inputFormatter: [web3._extend.formatters.inputBlockNumberFormatter]
   544  		}),
   545  		new web3._extend.Method({
   546  			name: 'getHeaderByHash',
   547  			call: 'eth_getHeaderByHash',
   548  			params: 1
   549  		}),
   550  		new web3._extend.Method({
   551  			name: 'getBlockByNumber',
   552  			call: 'eth_getBlockByNumber',
   553  			params: 2,
   554  			inputFormatter: [web3._extend.formatters.inputBlockNumberFormatter, function (val) { return !!val; }]
   555  		}),
   556  		new web3._extend.Method({
   557  			name: 'getBlockByHash',
   558  			call: 'eth_getBlockByHash',
   559  			params: 2,
   560  			inputFormatter: [null, function (val) { return !!val; }]
   561  		}),
   562  		new web3._extend.Method({
   563  			name: 'getRawTransaction',
   564  			call: 'eth_getRawTransactionByHash',
   565  			params: 1
   566  		}),
   567  		new web3._extend.Method({
   568  			name: 'getRawTransactionFromBlock',
   569  			call: function(args) {
   570  				return (web3._extend.utils.isString(args[0]) && args[0].indexOf('0x') === 0) ? 'eth_getRawTransactionByBlockHashAndIndex' : 'eth_getRawTransactionByBlockNumberAndIndex';
   571  			},
   572  			params: 2,
   573  			inputFormatter: [web3._extend.formatters.inputBlockNumberFormatter, web3._extend.utils.toHex]
   574  		}),
   575  		new web3._extend.Method({
   576  			name: 'getProof',
   577  			call: 'eth_getProof',
   578  			params: 3,
   579  			inputFormatter: [web3._extend.formatters.inputAddressFormatter, null, web3._extend.formatters.inputBlockNumberFormatter]
   580  		}),
   581  		new web3._extend.Method({
   582  			name: 'createAccessList',
   583  			call: 'eth_createAccessList',
   584  			params: 2,
   585  			inputFormatter: [null, web3._extend.formatters.inputBlockNumberFormatter],
   586  		}),
   587  		new web3._extend.Method({
   588  			name: 'feeHistory',
   589  			call: 'eth_feeHistory',
   590  			params: 3,
   591  			inputFormatter: [null, web3._extend.formatters.inputBlockNumberFormatter, null]
   592  		}),
   593  		new web3._extend.Method({
   594  			name: 'getLogs',
   595  			call: 'eth_getLogs',
   596  			params: 1,
   597  		}),
   598  	],
   599  	properties: [
   600  		new web3._extend.Property({
   601  			name: 'pendingTransactions',
   602  			getter: 'eth_pendingTransactions',
   603  			outputFormatter: function(txs) {
   604  				var formatted = [];
   605  				for (var i = 0; i < txs.length; i++) {
   606  					formatted.push(web3._extend.formatters.outputTransactionFormatter(txs[i]));
   607  					formatted[i].blockHash = null;
   608  				}
   609  				return formatted;
   610  			}
   611  		}),
   612  		new web3._extend.Property({
   613  			name: 'maxPriorityFeePerGas',
   614  			getter: 'eth_maxPriorityFeePerGas',
   615  			outputFormatter: web3._extend.utils.toBigNumber
   616  		}),
   617  	]
   618  });
   619  `
   620  
   621  const MinerJs = `
   622  web3._extend({
   623  	property: 'miner',
   624  	methods: [
   625  		new web3._extend.Method({
   626  			name: 'start',
   627  			call: 'miner_start',
   628  			params: 1,
   629  			inputFormatter: [null]
   630  		}),
   631  		new web3._extend.Method({
   632  			name: 'stop',
   633  			call: 'miner_stop'
   634  		}),
   635  		new web3._extend.Method({
   636  			name: 'setEtherbase',
   637  			call: 'miner_setEtherbase',
   638  			params: 1,
   639  			inputFormatter: [web3._extend.formatters.inputAddressFormatter]
   640  		}),
   641  		new web3._extend.Method({
   642  			name: 'setExtra',
   643  			call: 'miner_setExtra',
   644  			params: 1
   645  		}),
   646  		new web3._extend.Method({
   647  			name: 'setGasPrice',
   648  			call: 'miner_setGasPrice',
   649  			params: 1,
   650  			inputFormatter: [web3._extend.utils.fromDecimal]
   651  		}),
   652  		new web3._extend.Method({
   653  			name: 'setGasLimit',
   654  			call: 'miner_setGasLimit',
   655  			params: 1,
   656  			inputFormatter: [web3._extend.utils.fromDecimal]
   657  		}),
   658  		new web3._extend.Method({
   659  			name: 'setRecommitInterval',
   660  			call: 'miner_setRecommitInterval',
   661  			params: 1,
   662  		}),
   663  		new web3._extend.Method({
   664  			name: 'getHashrate',
   665  			call: 'miner_getHashrate'
   666  		}),
   667  	],
   668  	properties: []
   669  });
   670  `
   671  
   672  const NetJs = `
   673  web3._extend({
   674  	property: 'net',
   675  	methods: [],
   676  	properties: [
   677  		new web3._extend.Property({
   678  			name: 'version',
   679  			getter: 'net_version'
   680  		}),
   681  	]
   682  });
   683  `
   684  
   685  const PersonalJs = `
   686  web3._extend({
   687  	property: 'personal',
   688  	methods: [
   689  		new web3._extend.Method({
   690  			name: 'importRawKey',
   691  			call: 'personal_importRawKey',
   692  			params: 2
   693  		}),
   694  		new web3._extend.Method({
   695  			name: 'sign',
   696  			call: 'personal_sign',
   697  			params: 3,
   698  			inputFormatter: [null, web3._extend.formatters.inputAddressFormatter, null]
   699  		}),
   700  		new web3._extend.Method({
   701  			name: 'ecRecover',
   702  			call: 'personal_ecRecover',
   703  			params: 2
   704  		}),
   705  		new web3._extend.Method({
   706  			name: 'openWallet',
   707  			call: 'personal_openWallet',
   708  			params: 2
   709  		}),
   710  		new web3._extend.Method({
   711  			name: 'deriveAccount',
   712  			call: 'personal_deriveAccount',
   713  			params: 3
   714  		}),
   715  		new web3._extend.Method({
   716  			name: 'signTransaction',
   717  			call: 'personal_signTransaction',
   718  			params: 2,
   719  			inputFormatter: [web3._extend.formatters.inputTransactionFormatter, null]
   720  		}),
   721  		new web3._extend.Method({
   722  			name: 'unpair',
   723  			call: 'personal_unpair',
   724  			params: 2
   725  		}),
   726  		new web3._extend.Method({
   727  			name: 'initializeWallet',
   728  			call: 'personal_initializeWallet',
   729  			params: 1
   730  		})
   731  	],
   732  	properties: [
   733  		new web3._extend.Property({
   734  			name: 'listWallets',
   735  			getter: 'personal_listWallets'
   736  		}),
   737  	]
   738  })
   739  `
   740  
   741  const RpcJs = `
   742  web3._extend({
   743  	property: 'rpc',
   744  	methods: [],
   745  	properties: [
   746  		new web3._extend.Property({
   747  			name: 'modules',
   748  			getter: 'rpc_modules'
   749  		}),
   750  	]
   751  });
   752  `
   753  
   754  const TxpoolJs = `
   755  web3._extend({
   756  	property: 'txpool',
   757  	methods: [],
   758  	properties:
   759  	[
   760  		new web3._extend.Property({
   761  			name: 'content',
   762  			getter: 'txpool_content'
   763  		}),
   764  		new web3._extend.Property({
   765  			name: 'inspect',
   766  			getter: 'txpool_inspect'
   767  		}),
   768  		new web3._extend.Property({
   769  			name: 'status',
   770  			getter: 'txpool_status',
   771  			outputFormatter: function(status) {
   772  				status.pending = web3._extend.utils.toDecimal(status.pending);
   773  				status.queued = web3._extend.utils.toDecimal(status.queued);
   774  				return status;
   775  			}
   776  		}),
   777  		new web3._extend.Method({
   778  			name: 'contentFrom',
   779  			call: 'txpool_contentFrom',
   780  			params: 1,
   781  		}),
   782  	]
   783  });
   784  `
   785  
   786  const LESJs = `
   787  web3._extend({
   788  	property: 'les',
   789  	methods:
   790  	[
   791  		new web3._extend.Method({
   792  			name: 'getCheckpoint',
   793  			call: 'les_getCheckpoint',
   794  			params: 1
   795  		}),
   796  		new web3._extend.Method({
   797  			name: 'clientInfo',
   798  			call: 'les_clientInfo',
   799  			params: 1
   800  		}),
   801  		new web3._extend.Method({
   802  			name: 'priorityClientInfo',
   803  			call: 'les_priorityClientInfo',
   804  			params: 3
   805  		}),
   806  		new web3._extend.Method({
   807  			name: 'setClientParams',
   808  			call: 'les_setClientParams',
   809  			params: 2
   810  		}),
   811  		new web3._extend.Method({
   812  			name: 'setDefaultParams',
   813  			call: 'les_setDefaultParams',
   814  			params: 1
   815  		}),
   816  		new web3._extend.Method({
   817  			name: 'addBalance',
   818  			call: 'les_addBalance',
   819  			params: 2
   820  		}),
   821  	],
   822  	properties:
   823  	[
   824  		new web3._extend.Property({
   825  			name: 'latestCheckpoint',
   826  			getter: 'les_latestCheckpoint'
   827  		}),
   828  		new web3._extend.Property({
   829  			name: 'checkpointContractAddress',
   830  			getter: 'les_getCheckpointContractAddress'
   831  		}),
   832  		new web3._extend.Property({
   833  			name: 'serverInfo',
   834  			getter: 'les_serverInfo'
   835  		}),
   836  	]
   837  });
   838  `
   839  
   840  const VfluxJs = `
   841  web3._extend({
   842  	property: 'vflux',
   843  	methods:
   844  	[
   845  		new web3._extend.Method({
   846  			name: 'distribution',
   847  			call: 'vflux_distribution',
   848  			params: 2
   849  		}),
   850  		new web3._extend.Method({
   851  			name: 'timeout',
   852  			call: 'vflux_timeout',
   853  			params: 2
   854  		}),
   855  		new web3._extend.Method({
   856  			name: 'value',
   857  			call: 'vflux_value',
   858  			params: 2
   859  		}),
   860  	],
   861  	properties:
   862  	[
   863  		new web3._extend.Property({
   864  			name: 'requestStats',
   865  			getter: 'vflux_requestStats'
   866  		}),
   867  	]
   868  });
   869  `