github.com/coltonfike/e2c@v21.1.0+incompatible/internal/web3ext/web3ext.go (about)

     1  // Copyright 2015 The go-ethereum Authors
     2  // This file is part of the go-ethereum library.
     3  //
     4  // The go-ethereum library is free software: you can redistribute it and/or modify
     5  // it under the terms of the GNU Lesser General Public License as published by
     6  // the Free Software Foundation, either version 3 of the License, or
     7  // (at your option) any later version.
     8  //
     9  // The go-ethereum library is distributed in the hope that it will be useful,
    10  // but WITHOUT ANY WARRANTY; without even the implied warranty of
    11  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    12  // GNU Lesser General Public License for more details.
    13  //
    14  // You should have received a copy of the GNU Lesser General Public License
    15  // along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
    16  
    17  // package web3ext contains geth specific web3.js extensions.
    18  package web3ext
    19  
    20  var Modules = map[string]string{
    21  	"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  	"raft":             Raft_JS,
    37  	"istanbul":         Istanbul_JS,
    38  	"quorumPermission": QUORUM_NODE_JS,
    39  	"quorumExtension":  Extension_JS,
    40  	"plugin_account":   Account_Plugin_Js,
    41  }
    42  
    43  const ChequebookJs = `
    44  web3._extend({
    45  	property: 'chequebook',
    46  	methods: [
    47  		new web3._extend.Method({
    48  			name: 'deposit',
    49  			call: 'chequebook_deposit',
    50  			params: 1,
    51  			inputFormatter: [null]
    52  		}),
    53  		new web3._extend.Property({
    54  			name: 'balance',
    55  			getter: 'chequebook_balance',
    56  			outputFormatter: web3._extend.utils.toDecimal
    57  		}),
    58  		new web3._extend.Method({
    59  			name: 'cash',
    60  			call: 'chequebook_cash',
    61  			params: 1,
    62  			inputFormatter: [null]
    63  		}),
    64  		new web3._extend.Method({
    65  			name: 'issue',
    66  			call: 'chequebook_issue',
    67  			params: 2,
    68  			inputFormatter: [null, null]
    69  		}),
    70  	]
    71  });
    72  `
    73  
    74  const CliqueJs = `
    75  web3._extend({
    76  	property: 'clique',
    77  	methods: [
    78  		new web3._extend.Method({
    79  			name: 'getSnapshot',
    80  			call: 'clique_getSnapshot',
    81  			params: 1,
    82  			inputFormatter: [null]
    83  		}),
    84  		new web3._extend.Method({
    85  			name: 'getSnapshotAtHash',
    86  			call: 'clique_getSnapshotAtHash',
    87  			params: 1
    88  		}),
    89  		new web3._extend.Method({
    90  			name: 'getSigners',
    91  			call: 'clique_getSigners',
    92  			params: 1,
    93  			inputFormatter: [null]
    94  		}),
    95  		new web3._extend.Method({
    96  			name: 'getSignersAtHash',
    97  			call: 'clique_getSignersAtHash',
    98  			params: 1
    99  		}),
   100  		new web3._extend.Method({
   101  			name: 'propose',
   102  			call: 'clique_propose',
   103  			params: 2
   104  		}),
   105  		new web3._extend.Method({
   106  			name: 'discard',
   107  			call: 'clique_discard',
   108  			params: 1
   109  		}),
   110  		new web3._extend.Method({
   111  			name: 'status',
   112  			call: 'clique_status',
   113  			params: 2,
   114              inputFormatter: [web3._extend.formatters.inputBlockNumberFormatter, web3._extend.formatters.inputBlockNumberFormatter]
   115  		}),
   116  	],
   117  	properties: [
   118  		new web3._extend.Property({
   119  			name: 'proposals',
   120  			getter: 'clique_proposals'
   121  		}),
   122  	]
   123  });
   124  `
   125  
   126  const EthashJs = `
   127  web3._extend({
   128  	property: 'ethash',
   129  	methods: [
   130  		new web3._extend.Method({
   131  			name: 'getWork',
   132  			call: 'ethash_getWork',
   133  			params: 0
   134  		}),
   135  		new web3._extend.Method({
   136  			name: 'getHashrate',
   137  			call: 'ethash_getHashrate',
   138  			params: 0
   139  		}),
   140  		new web3._extend.Method({
   141  			name: 'submitWork',
   142  			call: 'ethash_submitWork',
   143  			params: 3,
   144  		}),
   145  		new web3._extend.Method({
   146  			name: 'submitHashRate',
   147  			call: 'ethash_submitHashRate',
   148  			params: 2,
   149  		}),
   150  	]
   151  });
   152  `
   153  
   154  const AdminJs = `
   155  web3._extend({
   156  	property: 'admin',
   157  	methods: [
   158  		new web3._extend.Method({
   159  			name: 'reloadPlugin',
   160  			call: 'admin_reloadPlugin',
   161  			params: 1
   162  		}),
   163  		new web3._extend.Method({
   164  			name: 'addPeer',
   165  			call: 'admin_addPeer',
   166  			params: 1
   167  		}),
   168  		new web3._extend.Method({
   169  			name: 'removePeer',
   170  			call: 'admin_removePeer',
   171  			params: 1
   172  		}),
   173  		new web3._extend.Method({
   174  			name: 'addTrustedPeer',
   175  			call: 'admin_addTrustedPeer',
   176  			params: 1
   177  		}),
   178  		new web3._extend.Method({
   179  			name: 'removeTrustedPeer',
   180  			call: 'admin_removeTrustedPeer',
   181  			params: 1
   182  		}),
   183  		new web3._extend.Method({
   184  			name: 'exportChain',
   185  			call: 'admin_exportChain',
   186  			params: 1,
   187  			inputFormatter: [null]
   188  		}),
   189  		new web3._extend.Method({
   190  			name: 'importChain',
   191  			call: 'admin_importChain',
   192  			params: 1
   193  		}),
   194  		new web3._extend.Method({
   195  			name: 'sleepBlocks',
   196  			call: 'admin_sleepBlocks',
   197  			params: 2
   198  		}),
   199  		new web3._extend.Method({
   200  			name: 'startRPC',
   201  			call: 'admin_startRPC',
   202  			params: 4,
   203  			inputFormatter: [null, null, null, null]
   204  		}),
   205  		new web3._extend.Method({
   206  			name: 'stopRPC',
   207  			call: 'admin_stopRPC'
   208  		}),
   209  		new web3._extend.Method({
   210  			name: 'startWS',
   211  			call: 'admin_startWS',
   212  			params: 4,
   213  			inputFormatter: [null, null, null, null]
   214  		}),
   215  		new web3._extend.Method({
   216  			name: 'stopWS',
   217  			call: 'admin_stopWS'
   218  		}),
   219  	],
   220  	properties: [
   221  		new web3._extend.Property({
   222  			name: 'nodeInfo',
   223  			getter: 'admin_nodeInfo'
   224  		}),
   225  		new web3._extend.Property({
   226  			name: 'peers',
   227  			getter: 'admin_peers'
   228  		}),
   229  		new web3._extend.Property({
   230  			name: 'datadir',
   231  			getter: 'admin_datadir'
   232  		}),
   233  	]
   234  });
   235  `
   236  
   237  const DebugJs = `
   238  web3._extend({
   239  	property: 'debug',
   240  	methods: [
   241  		new web3._extend.Method({
   242  			name: 'accountRange',
   243  			call: 'debug_accountRange',
   244  			params: 2
   245  		}),
   246  		new web3._extend.Method({
   247  			name: 'printBlock',
   248  			call: 'debug_printBlock',
   249  			params: 1
   250  		}),
   251  		new web3._extend.Method({
   252  			name: 'getBlockRlp',
   253  			call: 'debug_getBlockRlp',
   254  			params: 1
   255  		}),
   256  		new web3._extend.Method({
   257  			name: 'testSignCliqueBlock',
   258  			call: 'debug_testSignCliqueBlock',
   259  			params: 2,
   260  			inputFormatters: [web3._extend.formatters.inputAddressFormatter, null],
   261  		}),
   262  		new web3._extend.Method({
   263  			name: 'setHead',
   264  			call: 'debug_setHead',
   265  			params: 1
   266  		}),
   267  		new web3._extend.Method({
   268  			name: 'seedHash',
   269  			call: 'debug_seedHash',
   270  			params: 1
   271  		}),
   272  		new web3._extend.Method({
   273  			name: 'dumpBlock',
   274  			call: 'debug_dumpBlock',
   275  			params: 2,
   276  			inputFormatter: [web3._extend.formatters.inputBlockNumberFormatter, ""]
   277  		}),
   278  		new web3._extend.Method({
   279  			name: 'dumpAddress',
   280  			call: 'debug_dumpAddress',
   281  			params: 2,
   282  			inputFormatter: [web3._extend.formatters.inputAddressFormatter, web3._extend.formatters.inputBlockNumberFormatter]
   283  		}),
   284  		new web3._extend.Method({
   285  			name: 'chaindbProperty',
   286  			call: 'debug_chaindbProperty',
   287  			params: 1,
   288  			outputFormatter: console.log
   289  		}),
   290  		new web3._extend.Method({
   291  			name: 'chaindbCompact',
   292  			call: 'debug_chaindbCompact',
   293  		}),
   294  		new web3._extend.Method({
   295  			name: 'verbosity',
   296  			call: 'debug_verbosity',
   297  			params: 1
   298  		}),
   299  		new web3._extend.Method({
   300  			name: 'vmodule',
   301  			call: 'debug_vmodule',
   302  			params: 1
   303  		}),
   304  		new web3._extend.Method({
   305  			name: 'backtraceAt',
   306  			call: 'debug_backtraceAt',
   307  			params: 1,
   308  		}),
   309  		new web3._extend.Method({
   310  			name: 'stacks',
   311  			call: 'debug_stacks',
   312  			params: 0,
   313  			outputFormatter: console.log
   314  		}),
   315  		new web3._extend.Method({
   316  			name: 'freeOSMemory',
   317  			call: 'debug_freeOSMemory',
   318  			params: 0,
   319  		}),
   320  		new web3._extend.Method({
   321  			name: 'setGCPercent',
   322  			call: 'debug_setGCPercent',
   323  			params: 1,
   324  		}),
   325  		new web3._extend.Method({
   326  			name: 'memStats',
   327  			call: 'debug_memStats',
   328  			params: 0,
   329  		}),
   330  		new web3._extend.Method({
   331  			name: 'gcStats',
   332  			call: 'debug_gcStats',
   333  			params: 0,
   334  		}),
   335  		new web3._extend.Method({
   336  			name: 'cpuProfile',
   337  			call: 'debug_cpuProfile',
   338  			params: 2
   339  		}),
   340  		new web3._extend.Method({
   341  			name: 'startCPUProfile',
   342  			call: 'debug_startCPUProfile',
   343  			params: 1
   344  		}),
   345  		new web3._extend.Method({
   346  			name: 'stopCPUProfile',
   347  			call: 'debug_stopCPUProfile',
   348  			params: 0
   349  		}),
   350  		new web3._extend.Method({
   351  			name: 'goTrace',
   352  			call: 'debug_goTrace',
   353  			params: 2
   354  		}),
   355  		new web3._extend.Method({
   356  			name: 'startGoTrace',
   357  			call: 'debug_startGoTrace',
   358  			params: 1
   359  		}),
   360  		new web3._extend.Method({
   361  			name: 'stopGoTrace',
   362  			call: 'debug_stopGoTrace',
   363  			params: 0
   364  		}),
   365  		new web3._extend.Method({
   366  			name: 'blockProfile',
   367  			call: 'debug_blockProfile',
   368  			params: 2
   369  		}),
   370  		new web3._extend.Method({
   371  			name: 'setBlockProfileRate',
   372  			call: 'debug_setBlockProfileRate',
   373  			params: 1
   374  		}),
   375  		new web3._extend.Method({
   376  			name: 'writeBlockProfile',
   377  			call: 'debug_writeBlockProfile',
   378  			params: 1
   379  		}),
   380  		new web3._extend.Method({
   381  			name: 'mutexProfile',
   382  			call: 'debug_mutexProfile',
   383  			params: 2
   384  		}),
   385  		new web3._extend.Method({
   386  			name: 'setMutexProfileFraction',
   387  			call: 'debug_setMutexProfileFraction',
   388  			params: 1
   389  		}),
   390  		new web3._extend.Method({
   391  			name: 'writeMutexProfile',
   392  			call: 'debug_writeMutexProfile',
   393  			params: 1
   394  		}),
   395  		new web3._extend.Method({
   396  			name: 'writeMemProfile',
   397  			call: 'debug_writeMemProfile',
   398  			params: 1
   399  		}),
   400  		new web3._extend.Method({
   401  			name: 'traceBlock',
   402  			call: 'debug_traceBlock',
   403  			params: 2,
   404  			inputFormatter: [null, null]
   405  		}),
   406  		new web3._extend.Method({
   407  			name: 'traceBlockFromFile',
   408  			call: 'debug_traceBlockFromFile',
   409  			params: 2,
   410  			inputFormatter: [null, null]
   411  		}),
   412  		new web3._extend.Method({
   413  			name: 'traceBadBlock',
   414  			call: 'debug_traceBadBlock',
   415  			params: 1,
   416  			inputFormatter: [null]
   417  		}),
   418  		new web3._extend.Method({
   419  			name: 'standardTraceBadBlockToFile',
   420  			call: 'debug_standardTraceBadBlockToFile',
   421  			params: 2,
   422  			inputFormatter: [null, null]
   423  		}),
   424  		new web3._extend.Method({
   425  			name: 'standardTraceBlockToFile',
   426  			call: 'debug_standardTraceBlockToFile',
   427  			params: 2,
   428  			inputFormatter: [null, null]
   429  		}),
   430  		new web3._extend.Method({
   431  			name: 'traceBlockByNumber',
   432  			call: 'debug_traceBlockByNumber',
   433  			params: 2,
   434  			inputFormatter: [null, null]
   435  		}),
   436  		new web3._extend.Method({
   437  			name: 'traceBlockByHash',
   438  			call: 'debug_traceBlockByHash',
   439  			params: 2,
   440  			inputFormatter: [null, null]
   441  		}),
   442  		new web3._extend.Method({
   443  			name: 'traceTransaction',
   444  			call: 'debug_traceTransaction',
   445  			params: 2,
   446  			inputFormatter: [null, null]
   447  		}),
   448  		new web3._extend.Method({
   449  			name: 'preimage',
   450  			call: 'debug_preimage',
   451  			params: 1,
   452  			inputFormatter: [null]
   453  		}),
   454  		new web3._extend.Method({
   455  			name: 'getBadBlocks',
   456  			call: 'debug_getBadBlocks',
   457  			params: 0,
   458  		}),
   459  		new web3._extend.Method({
   460  			name: 'storageRangeAt',
   461  			call: 'debug_storageRangeAt',
   462  			params: 5,
   463  		}),
   464  		new web3._extend.Method({
   465  			name: 'getModifiedAccountsByNumber',
   466  			call: 'debug_getModifiedAccountsByNumber',
   467  			params: 2,
   468  			inputFormatter: [null, null],
   469  		}),
   470  		new web3._extend.Method({
   471  			name: 'getModifiedAccountsByHash',
   472  			call: 'debug_getModifiedAccountsByHash',
   473  			params: 2,
   474  			inputFormatter:[null, null],
   475  		}),
   476  	],
   477  	properties: []
   478  });
   479  `
   480  
   481  const EthJs = `
   482  web3._extend({
   483  	property: 'eth',
   484  	methods: [
   485  		new web3._extend.Method({
   486  			name: 'sendRawPrivateTransaction',
   487  			call: 'eth_sendRawPrivateTransaction',
   488  			params: 2,
   489  			inputFormatter: [null, null]
   490  		}),
   491  		new web3._extend.Method({
   492  			name: 'getContractPrivacyMetadata',
   493  			call: 'eth_getContractPrivacyMetadata',
   494  			params: 1
   495  		}),
   496  		new web3._extend.Method({
   497  			name: 'chainId',
   498  			call: 'eth_chainId',
   499  			params: 0
   500  		}),
   501  		new web3._extend.Method({
   502  			name: 'sign',
   503  			call: 'eth_sign',
   504  			params: 2,
   505  			inputFormatter: [web3._extend.formatters.inputAddressFormatter, null]
   506  		}),
   507  		new web3._extend.Method({
   508  			name: 'resend',
   509  			call: 'eth_resend',
   510  			params: 3,
   511  			inputFormatter: [web3._extend.formatters.inputTransactionFormatter, web3._extend.utils.fromDecimal, web3._extend.utils.fromDecimal]
   512  		}),
   513  		new web3._extend.Method({
   514  			name: 'signTransaction',
   515  			call: 'eth_signTransaction',
   516  			params: 1,
   517  			inputFormatter: [web3._extend.formatters.inputTransactionFormatter]
   518  		}),
   519  		new web3._extend.Method({
   520  			name: 'submitTransaction',
   521  			call: 'eth_submitTransaction',
   522  			params: 1,
   523  			inputFormatter: [web3._extend.formatters.inputTransactionFormatter]
   524  		}),
   525  		new web3._extend.Method({
   526  			name: 'fillTransaction',
   527  			call: 'eth_fillTransaction',
   528  			params: 1,
   529  			inputFormatter: [web3._extend.formatters.inputTransactionFormatter]
   530  		}),
   531  		new web3._extend.Method({
   532  			name: 'getHeaderByNumber',
   533  			call: 'eth_getHeaderByNumber',
   534  			params: 1
   535  		}),
   536  		new web3._extend.Method({
   537  			name: 'getHeaderByHash',
   538  			call: 'eth_getHeaderByHash',
   539  			params: 1
   540  		}),
   541  		new web3._extend.Method({
   542  			name: 'getBlockByNumber',
   543  			call: 'eth_getBlockByNumber',
   544  			params: 2
   545  		}),
   546  		new web3._extend.Method({
   547  			name: 'getBlockByHash',
   548  			call: 'eth_getBlockByHash',
   549  			params: 2
   550  		}),
   551  		new web3._extend.Method({
   552  			name: 'getRawTransaction',
   553  			call: 'eth_getRawTransactionByHash',
   554  			params: 1
   555  		}),
   556  		new web3._extend.Method({
   557  			name: 'getRawTransactionFromBlock',
   558  			call: function(args) {
   559  				return (web3._extend.utils.isString(args[0]) && args[0].indexOf('0x') === 0) ? 'eth_getRawTransactionByBlockHashAndIndex' : 'eth_getRawTransactionByBlockNumberAndIndex';
   560  			},
   561  			params: 2,
   562  			inputFormatter: [web3._extend.formatters.inputBlockNumberFormatter, web3._extend.utils.toHex]
   563  		}),
   564  		new web3._extend.Method({
   565  			name: 'getProof',
   566  			call: 'eth_getProof',
   567  			params: 3,
   568  			inputFormatter: [web3._extend.formatters.inputAddressFormatter, null, web3._extend.formatters.inputBlockNumberFormatter]
   569  		}),
   570  		new web3._extend.Method({
   571  			name: 'storageRoot',
   572  			call: 'eth_storageRoot',
   573  			params: 2,
   574  			inputFormatter: [web3._extend.formatters.inputAddressFormatter, null]
   575  		}),
   576  		// QUORUM
   577  		new web3._extend.Method({
   578  			name: 'sendTransactionAsync',
   579  			call: 'eth_sendTransactionAsync',
   580  			params: 1,
   581  			inputFormatter: [web3._extend.formatters.inputTransactionFormatter]
   582  		}),
   583  		new web3._extend.Method({
   584  			name: 'getQuorumPayload',
   585  			call: 'eth_getQuorumPayload',
   586  			params: 1,
   587  			inputFormatter: [null]
   588  		}),
   589  		// END-QUORUM
   590  	],
   591  	properties: [
   592  		new web3._extend.Property({
   593  			name: 'pendingTransactions',
   594  			getter: 'eth_pendingTransactions',
   595  			outputFormatter: function(txs) {
   596  				var formatted = [];
   597  				for (var i = 0; i < txs.length; i++) {
   598  					formatted.push(web3._extend.formatters.outputTransactionFormatter(txs[i]));
   599  					formatted[i].blockHash = null;
   600  				}
   601  				return formatted;
   602  			}
   603  		}),
   604  	]
   605  });
   606  `
   607  
   608  const MinerJs = `
   609  web3._extend({
   610  	property: 'miner',
   611  	methods: [
   612  		new web3._extend.Method({
   613  			name: 'start',
   614  			call: 'miner_start',
   615  			params: 1,
   616  			inputFormatter: [null]
   617  		}),
   618  		new web3._extend.Method({
   619  			name: 'stop',
   620  			call: 'miner_stop'
   621  		}),
   622  		new web3._extend.Method({
   623  			name: 'setEtherbase',
   624  			call: 'miner_setEtherbase',
   625  			params: 1,
   626  			inputFormatter: [web3._extend.formatters.inputAddressFormatter]
   627  		}),
   628  		new web3._extend.Method({
   629  			name: 'setExtra',
   630  			call: 'miner_setExtra',
   631  			params: 1
   632  		}),
   633  		new web3._extend.Method({
   634  			name: 'setGasPrice',
   635  			call: 'miner_setGasPrice',
   636  			params: 1,
   637  			inputFormatter: [web3._extend.utils.fromDecimal]
   638  		}),
   639  		new web3._extend.Method({
   640  			name: 'setRecommitInterval',
   641  			call: 'miner_setRecommitInterval',
   642  			params: 1,
   643  		}),
   644  		new web3._extend.Method({
   645  			name: 'getHashrate',
   646  			call: 'miner_getHashrate'
   647  		}),
   648  	],
   649  	properties: []
   650  });
   651  `
   652  
   653  const NetJs = `
   654  web3._extend({
   655  	property: 'net',
   656  	methods: [],
   657  	properties: [
   658  		new web3._extend.Property({
   659  			name: 'version',
   660  			getter: 'net_version'
   661  		}),
   662  	]
   663  });
   664  `
   665  
   666  const PersonalJs = `
   667  web3._extend({
   668  	property: 'personal',
   669  	methods: [
   670  		new web3._extend.Method({
   671  			name: 'importRawKey',
   672  			call: 'personal_importRawKey',
   673  			params: 2
   674  		}),
   675  		new web3._extend.Method({
   676  			name: 'sign',
   677  			call: 'personal_sign',
   678  			params: 3,
   679  			inputFormatter: [null, web3._extend.formatters.inputAddressFormatter, null]
   680  		}),
   681  		new web3._extend.Method({
   682  			name: 'ecRecover',
   683  			call: 'personal_ecRecover',
   684  			params: 2
   685  		}),
   686  		new web3._extend.Method({
   687  			name: 'openWallet',
   688  			call: 'personal_openWallet',
   689  			params: 2
   690  		}),
   691  		new web3._extend.Method({
   692  			name: 'deriveAccount',
   693  			call: 'personal_deriveAccount',
   694  			params: 3
   695  		}),
   696  		new web3._extend.Method({
   697  			name: 'signTransaction',
   698  			call: 'personal_signTransaction',
   699  			params: 2,
   700  			inputFormatter: [web3._extend.formatters.inputTransactionFormatter, null]
   701  		}),
   702  		new web3._extend.Method({
   703  			name: 'unpair',
   704  			call: 'personal_unpair',
   705  			params: 2
   706  		}),
   707  		new web3._extend.Method({
   708  			name: 'initializeWallet',
   709  			call: 'personal_initializeWallet',
   710  			params: 1
   711  		})
   712  	],
   713  	properties: [
   714  		new web3._extend.Property({
   715  			name: 'listWallets',
   716  			getter: 'personal_listWallets'
   717  		}),
   718  	]
   719  })
   720  `
   721  
   722  const RpcJs = `
   723  web3._extend({
   724  	property: 'rpc',
   725  	methods: [],
   726  	properties: [
   727  		new web3._extend.Property({
   728  			name: 'modules',
   729  			getter: 'rpc_modules'
   730  		}),
   731  	]
   732  });
   733  `
   734  
   735  const ShhJs = `
   736  web3._extend({
   737  	property: 'shh',
   738  	methods: [
   739  	],
   740  	properties:
   741  	[
   742  		new web3._extend.Property({
   743  			name: 'version',
   744  			getter: 'shh_version',
   745  			outputFormatter: web3._extend.utils.toDecimal
   746  		}),
   747  		new web3._extend.Property({
   748  			name: 'info',
   749  			getter: 'shh_info'
   750  		}),
   751  	]
   752  });
   753  `
   754  
   755  const SwarmfsJs = `
   756  web3._extend({
   757  	property: 'swarmfs',
   758  	methods:
   759  	[
   760  		new web3._extend.Method({
   761  			name: 'mount',
   762  			call: 'swarmfs_mount',
   763  			params: 2
   764  		}),
   765  		new web3._extend.Method({
   766  			name: 'unmount',
   767  			call: 'swarmfs_unmount',
   768  			params: 1
   769  		}),
   770  		new web3._extend.Method({
   771  			name: 'listmounts',
   772  			call: 'swarmfs_listmounts',
   773  			params: 0
   774  		}),
   775  	]
   776  });
   777  `
   778  
   779  const TxpoolJs = `
   780  web3._extend({
   781  	property: 'txpool',
   782  	methods: [],
   783  	properties:
   784  	[
   785  		new web3._extend.Property({
   786  			name: 'content',
   787  			getter: 'txpool_content'
   788  		}),
   789  		new web3._extend.Property({
   790  			name: 'inspect',
   791  			getter: 'txpool_inspect'
   792  		}),
   793  		new web3._extend.Property({
   794  			name: 'status',
   795  			getter: 'txpool_status',
   796  			outputFormatter: function(status) {
   797  				status.pending = web3._extend.utils.toDecimal(status.pending);
   798  				status.queued = web3._extend.utils.toDecimal(status.queued);
   799  				return status;
   800  			}
   801  		}),
   802  	]
   803  });
   804  `
   805  
   806  const Raft_JS = `
   807  web3._extend({
   808         property: 'raft',
   809         methods:
   810         [
   811         ],
   812         properties:
   813         [
   814                 new web3._extend.Property({
   815                         name: 'role',
   816                         getter: 'raft_role'
   817                 }),
   818                 new web3._extend.Method({
   819                         name: 'addPeer',
   820                         call: 'raft_addPeer',
   821                         params: 1
   822                 }),
   823                 new web3._extend.Method({
   824                         name: 'addLearner',
   825                         call: 'raft_addLearner',
   826                         params: 1
   827                 }),
   828                 new web3._extend.Method({
   829                         name: 'promoteToPeer',
   830                         call: 'raft_promoteToPeer',
   831                         params: 1
   832                 }),
   833                 new web3._extend.Method({
   834                         name: 'removePeer',
   835                         call: 'raft_removePeer',
   836                         params: 1
   837                 }),
   838                 new web3._extend.Property({
   839                         name: 'leader',
   840                         getter: 'raft_leader'
   841                 }),
   842                 new web3._extend.Property({
   843                         name: 'cluster',
   844                         getter: 'raft_cluster'
   845                 }),
   846         ]
   847  })
   848  `
   849  
   850  const QUORUM_NODE_JS = `
   851  web3._extend({
   852         property: 'quorumPermission',
   853         methods:
   854         [
   855  				new web3._extend.Method({
   856                         name: 'addOrg',
   857                         call: 'quorumPermission_addOrg',
   858                         params: 4,
   859                         inputFormatter: [null,null,web3._extend.formatters.inputAddressFormatter,web3._extend.formatters.inputTransactionFormatter]
   860                 }),
   861  			   new web3._extend.Method({
   862                         name: 'approveOrg',
   863                         call: 'quorumPermission_approveOrg',
   864                         params: 4,
   865                         inputFormatter: [null,null,web3._extend.formatters.inputAddressFormatter,web3._extend.formatters.inputTransactionFormatter]
   866                 }),
   867  				new web3._extend.Method({
   868                         name: 'addSubOrg',
   869                         call: 'quorumPermission_addSubOrg',
   870                         params: 4,
   871                         inputFormatter: [null,null,null,web3._extend.formatters.inputTransactionFormatter]
   872                 }),
   873                 new web3._extend.Method({
   874                         name: 'updateOrgStatus',
   875                         call: 'quorumPermission_updateOrgStatus',
   876                         params: 3,
   877                         inputFormatter: [null,null,web3._extend.formatters.inputTransactionFormatter]
   878                 }),
   879                 new web3._extend.Method({
   880                         name: 'approveOrgStatus',
   881                         call: 'quorumPermission_approveOrgStatus',
   882                         params: 3,
   883                         inputFormatter: [null,null,web3._extend.formatters.inputTransactionFormatter]
   884                 }),
   885                 new web3._extend.Method({
   886                         name: 'addNode',
   887                         call: 'quorumPermission_addNode',
   888                         params: 3,
   889                         inputFormatter: [null,null,web3._extend.formatters.inputTransactionFormatter]
   890                 }),
   891                 new web3._extend.Method({
   892                         name: 'updateNodeStatus',
   893                         call: 'quorumPermission_updateNodeStatus',
   894                         params: 4,
   895                         inputFormatter: [null,null,null,web3._extend.formatters.inputTransactionFormatter]
   896                 }),
   897                 new web3._extend.Method({
   898                         name: 'assignAdminRole',
   899                         call: 'quorumPermission_assignAdminRole',
   900                         params: 4,
   901                         inputFormatter: [null,web3._extend.formatters.inputAddressFormatter,null, web3._extend.formatters.inputTransactionFormatter]
   902                 }),
   903                 new web3._extend.Method({
   904                         name: 'approveAdminRole',
   905                         call: 'quorumPermission_approveAdminRole',
   906                         params: 3,
   907                         inputFormatter: [null, web3._extend.formatters.inputAddressFormatter,web3._extend.formatters.inputTransactionFormatter]
   908                 }),
   909                 new web3._extend.Method({
   910                         name: 'addNewRole',
   911                         call: 'quorumPermission_addNewRole',
   912                         params: 6,
   913                         inputFormatter: [null,null,null,null,null,web3._extend.formatters.inputTransactionFormatter]
   914                 }),
   915                 new web3._extend.Method({
   916                         name: 'removeRole',
   917                         call: 'quorumPermission_removeRole',
   918                         params: 3,
   919                         inputFormatter: [null,null,web3._extend.formatters.inputTransactionFormatter]
   920                 }),
   921                 new web3._extend.Method({
   922                         name: 'addAccountToOrg',
   923                         call: 'quorumPermission_addAccountToOrg',
   924                         params: 4,
   925                         inputFormatter: [web3._extend.formatters.inputAddressFormatter,null,null,web3._extend.formatters.inputTransactionFormatter]
   926                 }),
   927                 new web3._extend.Method({
   928                         name: 'changeAccountRole',
   929                         call: 'quorumPermission_changeAccountRole',
   930                         params: 4,
   931                         inputFormatter: [web3._extend.formatters.inputAddressFormatter,null,null,web3._extend.formatters.inputTransactionFormatter]
   932                 }),	
   933  			   new web3._extend.Method({
   934                         name: 'updateAccountStatus',
   935                         call: 'quorumPermission_updateAccountStatus',
   936                         params: 4,
   937                         inputFormatter: [null, web3._extend.formatters.inputAddressFormatter,null,web3._extend.formatters.inputTransactionFormatter]
   938                 }),
   939  			   new web3._extend.Method({
   940                         name: 'recoverBlackListedNode',
   941                         call: 'quorumPermission_recoverBlackListedNode',
   942                         params: 3,
   943                         inputFormatter: [null, null, web3._extend.formatters.inputTransactionFormatter]
   944                 }),
   945  			   new web3._extend.Method({
   946                         name: 'approveBlackListedNodeRecovery',
   947                         call: 'quorumPermission_approveBlackListedNodeRecovery',
   948                         params: 3,
   949                         inputFormatter: [null, null, web3._extend.formatters.inputTransactionFormatter]
   950                 }),
   951  			   new web3._extend.Method({
   952                         name: 'recoverBlackListedAccount',
   953                         call: 'quorumPermission_recoverBlackListedAccount',
   954                         params: 3,
   955                         inputFormatter: [null, web3._extend.formatters.inputAddressFormatter, web3._extend.formatters.inputTransactionFormatter]
   956                 }),
   957  			   new web3._extend.Method({
   958                         name: 'approveBlackListedAccountRecovery',
   959                         call: 'quorumPermission_approveBlackListedAccountRecovery',
   960                         params: 3,
   961                         inputFormatter: [null, web3._extend.formatters.inputAddressFormatter, web3._extend.formatters.inputTransactionFormatter]
   962                 }),
   963                 new web3._extend.Method({
   964                         name: 'getOrgDetails',
   965                         call: 'quorumPermission_getOrgDetails',
   966                         params: 1,
   967                         inputFormatter: [null]
   968                 }),
   969                 new web3._extend.Method({
   970                         name: 'transactionAllowed',
   971                         call: 'quorumPermission_transactionAllowed',
   972                         params: 1,
   973                         inputFormatter: [web3._extend.formatters.inputTransactionFormatter]
   974                 }),
   975                 new web3._extend.Method({
   976                         name: 'connectionAllowed',
   977                         call: 'quorumPermission_connectionAllowed',
   978                         params: 4,
   979                         inputFormatter: [null, null, null, null]
   980                 }),
   981  
   982         ],
   983         properties:
   984         [
   985  			  new web3._extend.Property({
   986  					   name: 'orgList',
   987  				       getter: 'quorumPermission_orgList'
   988  			  }), 
   989                new web3._extend.Property({
   990  					   name: 'nodeList',
   991  				       getter: 'quorumPermission_nodeList'
   992  			  }), 
   993                new web3._extend.Property({
   994  					   name: 'roleList',
   995  				       getter: 'quorumPermission_roleList'
   996  			  }),
   997                new web3._extend.Property({
   998  					   name: 'acctList',
   999  				       getter: 'quorumPermission_acctList'
  1000  			  }), 
  1001         ]
  1002  })
  1003  `
  1004  
  1005  const Istanbul_JS = `
  1006  web3._extend({
  1007  	property: 'istanbul',
  1008  	methods:
  1009  	[
  1010  		new web3._extend.Method({
  1011  			name: 'getSnapshot',
  1012  			call: 'istanbul_getSnapshot',
  1013  			params: 1,
  1014  			inputFormatter: [null]
  1015  		}),
  1016  		new web3._extend.Method({
  1017  			name: 'getSnapshotAtHash',
  1018  			call: 'istanbul_getSnapshotAtHash',
  1019  			params: 1
  1020  		}),
  1021  		new web3._extend.Method({
  1022  			name: 'getValidators',
  1023  			call: 'istanbul_getValidators',
  1024  			params: 1,
  1025  			inputFormatter: [null]
  1026  		}),
  1027  		new web3._extend.Method({
  1028  			name: 'getValidatorsAtHash',
  1029  			call: 'istanbul_getValidatorsAtHash',
  1030  			params: 1
  1031  		}),
  1032  		new web3._extend.Method({
  1033  			name: 'propose',
  1034  			call: 'istanbul_propose',
  1035  			params: 2
  1036  		}),
  1037  		new web3._extend.Method({
  1038  			name: 'discard',
  1039  			call: 'istanbul_discard',
  1040  			params: 1
  1041  		}),
  1042  
  1043  		new web3._extend.Method({
  1044  			name: 'getSignersFromBlock',
  1045  			call: 'istanbul_getSignersFromBlock',
  1046  			params: 1,
  1047  			inputFormatter: [web3._extend.formatters.inputBlockNumberFormatter]
  1048  		}),
  1049  		new web3._extend.Method({
  1050  			name: 'getSignersFromBlockByHash',
  1051  			call: 'istanbul_getSignersFromBlockByHash',
  1052  			params: 1
  1053  		}),
  1054  		new web3._extend.Method({
  1055  			name: 'status',
  1056  			call: 'istanbul_status',
  1057  			params: 2,
  1058              inputFormatter: [web3._extend.formatters.inputBlockNumberFormatter, web3._extend.formatters.inputBlockNumberFormatter]
  1059  		}),
  1060  		new web3._extend.Method({
  1061  			name: 'isValidator',
  1062  			call: 'istanbul_isValidator',
  1063  			params: 1,
  1064              inputFormatter: [web3._extend.formatters.inputBlockNumberFormatter]
  1065  		}),
  1066  
  1067  	],
  1068  	properties:
  1069  	[
  1070  		new web3._extend.Property({
  1071  			name: 'candidates',
  1072  			getter: 'istanbul_candidates'
  1073  		}),
  1074  		new web3._extend.Property({
  1075  			name: 'nodeAddress',
  1076  			getter: 'istanbul_nodeAddress'
  1077  		}),
  1078  	]
  1079  });
  1080  `
  1081  
  1082  const AccountingJs = `
  1083  web3._extend({
  1084  	property: 'accounting',
  1085  	methods: [
  1086  		new web3._extend.Property({
  1087  			name: 'balance',
  1088  			getter: 'account_balance'
  1089  		}),
  1090  		new web3._extend.Property({
  1091  			name: 'balanceCredit',
  1092  			getter: 'account_balanceCredit'
  1093  		}),
  1094  		new web3._extend.Property({
  1095  			name: 'balanceDebit',
  1096  			getter: 'account_balanceDebit'
  1097  		}),
  1098  		new web3._extend.Property({
  1099  			name: 'bytesCredit',
  1100  			getter: 'account_bytesCredit'
  1101  		}),
  1102  		new web3._extend.Property({
  1103  			name: 'bytesDebit',
  1104  			getter: 'account_bytesDebit'
  1105  		}),
  1106  		new web3._extend.Property({
  1107  			name: 'msgCredit',
  1108  			getter: 'account_msgCredit'
  1109  		}),
  1110  		new web3._extend.Property({
  1111  			name: 'msgDebit',
  1112  			getter: 'account_msgDebit'
  1113  		}),
  1114  		new web3._extend.Property({
  1115  			name: 'peerDrops',
  1116  			getter: 'account_peerDrops'
  1117  		}),
  1118  		new web3._extend.Property({
  1119  			name: 'selfDrops',
  1120  			getter: 'account_selfDrops'
  1121  		}),
  1122  	]
  1123  });
  1124  `
  1125  
  1126  const LESJs = `
  1127  web3._extend({
  1128  	property: 'les',
  1129  	methods:
  1130  	[
  1131  		new web3._extend.Method({
  1132  			name: 'getCheckpoint',
  1133  			call: 'les_getCheckpoint',
  1134  			params: 1
  1135  		}),
  1136  	],
  1137  	properties:
  1138  	[
  1139  		new web3._extend.Property({
  1140  			name: 'latestCheckpoint',
  1141  			getter: 'les_latestCheckpoint'
  1142  		}),
  1143  		new web3._extend.Property({
  1144  			name: 'checkpointContractAddress',
  1145  			getter: 'les_getCheckpointContractAddress'
  1146  		}),
  1147  	]
  1148  });
  1149  `
  1150  
  1151  const Extension_JS = `
  1152  web3._extend({
  1153  	property: 'quorumExtension',
  1154  	methods:
  1155  	[
  1156  		new web3._extend.Method({
  1157  			name: 'approveExtension',
  1158  			call: 'quorumExtension_approveExtension',
  1159  			params: 3,
  1160  			inputFormatter: [web3._extend.formatters.inputAddressFormatter, null, web3._extend.formatters.inputTransactionFormatter]
  1161  		}),
  1162  		new web3._extend.Method({
  1163  			name: 'extendContract',
  1164  			call: 'quorumExtension_extendContract',
  1165  			params: 4,
  1166  			inputFormatter: [web3._extend.formatters.inputAddressFormatter, null, web3._extend.formatters.inputAddressFormatter, web3._extend.formatters.inputTransactionFormatter]
  1167  		}),
  1168  		new web3._extend.Method({
  1169  			name: 'cancelExtension',
  1170  			call: 'quorumExtension_cancelExtension',
  1171  			params: 2,
  1172  			inputFormatter: [web3._extend.formatters.inputAddressFormatter, web3._extend.formatters.inputTransactionFormatter]
  1173  		}),
  1174  		new web3._extend.Method({
  1175  			name: 'getExtensionStatus',
  1176  			call: 'quorumExtension_getExtensionStatus',
  1177  			params: 1,
  1178  			inputFormatter: [web3._extend.formatters.inputAddressFormatter]
  1179  		}),
  1180  
  1181  	],
  1182  	properties:
  1183  	[
  1184  		new web3._extend.Property({
  1185  			name: 'activeExtensionContracts',
  1186  			getter: 'quorumExtension_activeExtensionContracts'
  1187  		})
  1188  	]
  1189  });
  1190  `
  1191  
  1192  const Account_Plugin_Js = `
  1193  web3._extend({
  1194  	property: 'plugin_account',
  1195  	methods:
  1196  	[
  1197  		new web3._extend.Method({
  1198  			name: 'newAccount',
  1199  			call: 'plugin@account_newAccount',
  1200  			params: 1
  1201  		}),
  1202  		new web3._extend.Method({
  1203  			name: 'importRawKey',
  1204  			call: 'plugin@account_importRawKey',
  1205  			params: 2
  1206  		})
  1207  	]
  1208  });
  1209  `