github.com/neatlab/neatio@v1.7.3-0.20220425043230-d903e92fcc75/internal/web3ext/web3ext.go (about)

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