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