web3ext.go 17 KB

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