├── .editorconfig ├── .gitattributes ├── .github ├── CONTRIBUTING.md ├── ISSUE_TEMPLATE.md └── PULL_REQUEST_TEMPLATE.md ├── .gitignore ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── LICENSE ├── README.md ├── dist ├── ethjs-schema.json └── ethjs-schema.min.json ├── package.json └── src └── schema.json /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | end_of_line = lf 5 | insert_final_newline = false 6 | indent_style = space 7 | indent_size = 2 8 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # From https://github.com/Danimoth/gitattributes/blob/master/Web.gitattributes 2 | 3 | # Handle line endings automatically for files detected as text 4 | # and leave all files detected as binary untouched. 5 | * text=auto 6 | 7 | # 8 | # The above will handle all files NOT found below 9 | # 10 | 11 | # 12 | ## These files are text and should be normalized (Convert crlf => lf) 13 | # 14 | 15 | # source code 16 | *.php text 17 | *.css text 18 | *.sass text 19 | *.scss text 20 | *.less text 21 | *.styl text 22 | *.js text eol=lf 23 | *.coffee text 24 | *.json text 25 | *.htm text 26 | *.html text 27 | *.xml text 28 | *.svg text 29 | *.txt text 30 | *.ini text 31 | *.inc text 32 | *.pl text 33 | *.rb text 34 | *.py text 35 | *.scm text 36 | *.sql text 37 | *.sh text 38 | *.bat text 39 | 40 | # templates 41 | *.ejs text 42 | *.hbt text 43 | *.jade text 44 | *.haml text 45 | *.hbs text 46 | *.dot text 47 | *.tmpl text 48 | *.phtml text 49 | 50 | # server config 51 | .htaccess text 52 | 53 | # git config 54 | .gitattributes text 55 | .gitignore text 56 | .gitconfig text 57 | 58 | # code analysis config 59 | .jshintrc text 60 | .jscsrc text 61 | .jshintignore text 62 | .csslintrc text 63 | 64 | # misc config 65 | *.yaml text 66 | *.yml text 67 | .editorconfig text 68 | 69 | # build config 70 | *.npmignore text 71 | *.bowerrc text 72 | 73 | # Heroku 74 | Procfile text 75 | .slugignore text 76 | 77 | # Documentation 78 | *.md text 79 | LICENSE text 80 | AUTHORS text 81 | 82 | 83 | # 84 | ## These files are binary and should be left untouched 85 | # 86 | 87 | # (binary is a macro for -text -diff) 88 | *.png binary 89 | *.jpg binary 90 | *.jpeg binary 91 | *.gif binary 92 | *.ico binary 93 | *.mov binary 94 | *.mp4 binary 95 | *.mp3 binary 96 | *.flv binary 97 | *.fla binary 98 | *.swf binary 99 | *.gz binary 100 | *.zip binary 101 | *.7z binary 102 | *.ttf binary 103 | *.eot binary 104 | *.woff binary 105 | *.pyc binary 106 | *.pdf binary 107 | -------------------------------------------------------------------------------- /.github/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to ethjs-schema 2 | 3 | Love ethjs-schema and want to help? Thanks so much, there's something to do for everybody! 4 | 5 | Please take a moment to review this document in order to make the contribution process easy and effective for everyone involved. 6 | 7 | Following these guidelines helps to communicate that you respect the time of the developers managing and developing this open source project. In return, they should reciprocate that respect in addressing your issue or assessing patches and features. 8 | 9 | ## Using the issue tracker 10 | 11 | The [issue tracker](https://github.com/ethjs/ethjs-schema/issues) is 12 | the preferred channel for [bug reports](#bugs), [features requests](#features) 13 | and [submitting pull requests](#pull-requests). 14 | 15 | 16 | ## Bug reports 17 | 18 | A bug is a _demonstrable problem_ that is caused by the code in the repository. 19 | Good bug reports are extremely helpful - thank you! 20 | 21 | Guidelines for bug reports: 22 | 23 | 1. **Use the GitHub issue search** — check if the issue has already been reported. 24 | 25 | 2. **Check if the issue has been fixed** — try to reproduce it using the latest `master` or development branch in the repository. 26 | 27 | 3. **Isolate the problem** — 28 | 29 | A good bug report shouldn't leave others needing to chase you up for more information. Please try to be as detailed as possible in your report. What is your environment? What steps will reproduce the issue? What browser(s) and OS 30 | experience the problem? What would you expect to be the outcome? All these details will help people to fix any potential bugs. 31 | 32 | Example: 33 | 34 | > Short and descriptive example bug report title 35 | > 36 | > A summary of the issue and the browser/OS environment in which it occurs. If 37 | > suitable, include the steps required to reproduce the bug. 38 | > 39 | > 1. This is the first step 40 | > 2. This is the second step 41 | > 3. Further steps, etc. 42 | > 43 | > `` - a link to the reduced test case 44 | > 45 | > Any other information you want to share that is relevant to the issue being 46 | > reported. This might include the lines of code that you have identified as 47 | > causing the bug, and potential solutions (and your opinions on their 48 | > merits). 49 | 50 | 51 | 52 | ## Feature requests 53 | 54 | Feature requests are welcome. But take a moment to find out whether your idea fits with the scope and aims of the project. It's up to *you* to make a strong case to convince the project's developers of the merits of this feature. Please provide as much detail and context as possible. 55 | 56 | 57 | 58 | ## Pull requests 59 | 60 | Good pull requests - patches, improvements, new features - are a fantastic 61 | help. They should remain focused in scope and avoid containing unrelated 62 | commits. 63 | 64 | **Please ask first** before embarking on any significant pull request (e.g. 65 | implementing features, refactoring code, porting to a different language), 66 | otherwise you risk spending a lot of time working on something that the 67 | project's developers might not want to merge into the project. 68 | 69 | Please adhere to the coding conventions used throughout a project (indentation, 70 | accurate comments, etc.) and any other requirements (such as test coverage). 71 | 72 | Adhering to the following process is the best way to get your work 73 | included in the project: 74 | 75 | 1. [Fork](https://help.github.com/articles/fork-a-repo/) the project, clone your fork, and configure the remotes: 76 | 77 | ```bash 78 | # Clone your fork of the repo into the current directory 79 | git clone https://github.com//ethjs-schema.git 80 | # Navigate to the newly cloned directory 81 | cd ethjs-schema 82 | # Assign the original repo to a remote called "upstream" 83 | git remote add upstream https://github.com/ethjs/ethjs-schema.git 84 | ``` 85 | 86 | 2. If you cloned a while ago, get the latest changes from upstream: 87 | 88 | ```bash 89 | git checkout master 90 | git pull upstream master 91 | ``` 92 | 93 | 3. Create a new topic branch (off the main project development branch) to contain your feature, change, or fix: 94 | 95 | ```bash 96 | git checkout -b 97 | ``` 98 | 99 | 4. Commit your changes in logical chunks. Please adhere to these [git commit message guidelines](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html) or your code is unlikely be merged into the main project. Use Git's [interactive rebase](https://help.github.com/articles/about-git-rebase/) feature to tidy up your commits before making them public. 100 | 101 | 5. Locally merge (or rebase) the upstream development branch into your topic branch: 102 | 103 | ```bash 104 | git pull [--rebase] upstream master 105 | ``` 106 | 107 | 6. Push your topic branch up to your fork: 108 | 109 | ```bash 110 | git push origin 111 | ``` 112 | 113 | 7. [Open a Pull Request](https://help.github.com/articles/using-pull-requests/) 114 | with a clear title and description. 115 | 116 | **DESIGN NOTE**: ethjs-schema follows the UNIX programming philosophy. Please consider this before contributing, keep your commits/modules concise and to the point. 117 | 118 | Read more here: 119 | http://www.catb.org/esr/writings/taoup/html/ch01s06.html 120 | 121 | **IMPORTANT**: By submitting a patch, you agree to allow the project 122 | owners to license your work under the terms of the [MIT License](LICENSE.txt). 123 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | # ethjs-schema 2 | 3 | Before opening a new issue, please take a moment to review our [**community guidelines**](https://github.com/ethjs/ethjs-schema/blob/master/.github/CONTRIBUTING.md) to make the contribution process easy and effective for everyone involved. 4 | 5 | **Before opening a new issue, you may find an answer in already closed issues**: 6 | https://github.com/ethjs/ethjs-schema/issues?q=is%3Aissue+is%3Aclosed 7 | 8 | ## Issue Type 9 | 10 | - [ ] Bug (https://github.com/ethjs/ethjs-schema/blob/master/.github/CONTRIBUTING.md#bug-reports) 11 | - [ ] Feature (https://github.com/ethjs/ethjs-schema/blob/master/.github/CONTRIBUTING.md#feature-requests) 12 | 13 | ## Description 14 | 15 | (Add images if possible) 16 | 17 | ## Steps to reproduce 18 | 19 | (Add link to a demo on https://jsfiddle.net or similar if possible) 20 | 21 | # Versions 22 | 23 | - Node/NPM: 24 | - Browser: 25 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ## ethjs-schema 2 | 3 | Thank you for contributing! Please take a moment to review our [**contributing guidelines**](https://github.com/ethjs/ethjs-schema/blob/master/.github/CONTRIBUTING.md) 4 | to make the process easy and effective for everyone involved. 5 | 6 | **Please open an issue** before embarking on any significant pull request, especially those that 7 | add a new library or change existing tests, otherwise you risk spending a lot of time working 8 | on something that might not end up being merged into the project. 9 | 10 | Before opening a pull request, please ensure: 11 | 12 | - [ ] You have followed our [**contributing guidelines**](https://github.com/ethjs/ethjs-schema/blob/master/.github/CONTRIBUTING.md) 13 | - [ ] Pull request has tests (we are going for 100% coverage!) 14 | - [ ] Code is well-commented, linted and follows project conventions 15 | - [ ] Documentation is updated (if necessary) 16 | - [ ] Internal code generators and templates are updated (if necessary) 17 | - [ ] Description explains the issue/use-case resolved and auto-closes related issues 18 | 19 | Be kind to code reviewers, please try to keep pull requests as small and focused as possible :) 20 | 21 | **IMPORTANT**: By submitting a patch, you agree to allow the project 22 | owners to license your work under the terms of the [MIT License](https://github.com/ethjs/ethjs-schema/blob/master/LICENSE.md). 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Don't check auto-generated stuff into git 2 | node_modules 3 | coverage 4 | lib 5 | 6 | # Cruft 7 | .DS_Store 8 | npm-debug.log 9 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # 0.2.1 -- frontal padding 2 | 3 | 1. Added frontal padding for eth filter ID's. 4 | 5 | # 0.1.4 -- receiptsRoot fix 6 | 7 | 1. Fixed Block `receiptsRoot` property (was `receiptRoot`) 8 | 9 | # 0.1.3 -- data tag fix 10 | 11 | 1. Data tag fix 12 | 13 | # 0.1.2 -- value compression 14 | 15 | 1. Breaking changes 16 | 2. Value compression 17 | 3. File size is only 4.4kb now 18 | 19 | # 0.1.1 -- config fixes 20 | 21 | 1. webpack config updates 22 | 2. build config updates 23 | 24 | # 0.1.0 -- docs, json files 25 | 26 | 1. docs 27 | 2. basic repo 28 | 3. exports 29 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Code of Conduct 2 | 3 | As contributors and maintainers of this project, and in the interest of 4 | fostering an open and welcoming community, we pledge to respect all people who 5 | contribute through reporting issues, posting feature requests, updating 6 | documentation, submitting pull requests or patches, and other activities. 7 | 8 | We are committed to making participation in this project a harassment-free 9 | experience for everyone, regardless of level of experience, gender, gender 10 | identity and expression, sexual orientation, disability, personal appearance, 11 | body size, race, ethnicity, age, religion, or nationality. 12 | 13 | Examples of unacceptable behavior by participants include: 14 | 15 | * The use of sexualized language or imagery 16 | * Personal attacks 17 | * Trolling or insulting/derogatory comments 18 | * Public or private harassment 19 | * Publishing other's private information, such as physical or electronic 20 | addresses, without explicit permission 21 | * Other unethical or unprofessional conduct 22 | 23 | Project maintainers have the right and responsibility to remove, edit, or 24 | reject comments, commits, code, wiki edits, issues, and other contributions 25 | that are not aligned to this Code of Conduct, or to ban temporarily or 26 | permanently any contributor for other behaviors that they deem inappropriate, 27 | threatening, offensive, or harmful. 28 | 29 | By adopting this Code of Conduct, project maintainers commit themselves to 30 | fairly and consistently applying these principles to every aspect of managing 31 | this project. Project maintainers who do not follow or enforce the Code of 32 | Conduct may be permanently removed from the project team. 33 | 34 | This Code of Conduct applies both within project spaces and in public spaces 35 | when an individual is representing the project or its community. 36 | 37 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 38 | reported by contacting the project maintainer at nick.dodson@consensys.net. All 39 | complaints will be reviewed and investigated and will result in a response that 40 | is deemed necessary and appropriate to the circumstances. Maintainers are 41 | obligated to maintain confidentiality with regard to the reporter of an 42 | incident. 43 | 44 | 45 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], 46 | version 1.3.0, available at 47 | [http://contributor-covenant.org/version/1/3/0/][version] 48 | 49 | [homepage]: http://contributor-covenant.org 50 | [version]: http://contributor-covenant.org/version/1/3/0/ 51 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2016 Nick Dodson. nickdodson.com 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## ethjs-schema 2 | 3 |
4 | 5 | 6 | Dependency Status 8 | 9 | 10 | 11 | 12 | devDependency Status 13 | 14 | 15 | 16 | 17 | NPM version 19 | 20 | 21 | 22 | 23 | js-airbnb-style 24 | 25 |
26 | 27 |
28 | 29 | The complete Ethereum RPC specification as a JSON object export. 30 | 31 | ## Install 32 | 33 | ``` 34 | npm install --save ethjs-schema 35 | ``` 36 | 37 | ## Usage 38 | 39 | ```js 40 | const schema = require('ethjs-schema'); 41 | 42 | console.log(schema.tags); 43 | 44 | // result ['latest', 'earliest', ...] 45 | ``` 46 | 47 | ## About 48 | 49 | This is a pure JSON export of the Ethereum RPC specification. This can be, and is being used to generate the `ethjs-query` object. This object specification is not standardized, it is the leanest data structure implementation I could come up with for the Ethereum RPC spec. 50 | 51 | The entire spec is contained in the [schema.json](src/schema.json) file. 52 | 53 | ## Specification Details 54 | 55 | ### Method Specification: 56 | 57 | ``` 58 | methods: { 59 | , 60 | } 61 | ``` 62 | 63 | example: 64 | 65 | ``` 66 | { 67 | methods: { 68 | "eth_getBalance": [["D20", "Q|T"], "Q", 1, 2], 69 | ... 70 | }, 71 | ... 72 | } 73 | ``` 74 | 75 | ### Primitives: 76 | 77 | - "D" : bytes data 78 | - "D20" : bytes data, length 20 79 | - "D32" : bytes data, length 32 80 | - "B" : boolean true or false 81 | - "S" : string data 82 | - "Array|DATA" : either an array of DATA or a single bytes DATA 83 | - "Q" : a number quantity 84 | - "QP" : a number quantity (with frontal padding) 85 | - "Q|T" : a number quantity or a tag (e.g. 'latest', 'earliest' ...) 86 | 87 | Note, post version 0.1.1 value primitives have been compressed. 88 | 89 | ### Tags: 90 | 91 | ``` 92 | { 93 | "tags": ["latest", "earliest", "pending"], 94 | } 95 | ``` 96 | 97 | ### Complex Data Structures (.objects): 98 | 99 | The `__required` property is added to specify which properties of the object must be fulfilled in order to be a valid object structure (ready for payload transmission). 100 | 101 | - "EthSyncing" 102 | - "SendTransaction" 103 | - "EstimateTransaction" 104 | - "CallTransaction" 105 | - "Block" 106 | - "Transaction" 107 | - "Receipt" 108 | - "Filter" 109 | - "FilterChange" 110 | - "SHHPost" 111 | - 'SHHFilter' 112 | - "SHHFilterChange" 113 | - "SHHMessage" 114 | 115 | example: 116 | 117 | ``` 118 | { 119 | "objects": { 120 | "SendTransaction": { 121 | "__required": ["from", "data"], 122 | "from": "D20", 123 | "to": "D20", 124 | "gas": "Q", 125 | "gasPrice": "Q", 126 | "value": "Q", 127 | "data": "D", 128 | "nonce": "Q" 129 | }, 130 | ... 131 | } 132 | ... 133 | } 134 | ``` 135 | 136 | ## Contributing 137 | 138 | Please help better the ecosystem by submitting issues and pull requests to default. We need all the help we can get to build the absolute best linting standards and utilities. We follow the AirBNB linting standard and the unix philosophy. 139 | 140 | ## Guides 141 | 142 | Please see the Ethereum RPC specification hosted on their github: 143 | 144 | https://github.com/ethereum/wiki/wiki/JSON-RPC 145 | 146 | ## Help out 147 | 148 | There is always a lot of work to do, and will have many rules to maintain. So please help out in any way that you can: 149 | 150 | - Create, enhance, and debug ethjs rules (see our guide to ["Working on rules"](./github/CONTRIBUTING.md)). 151 | - Improve documentation. 152 | - Chime in on any open issue or pull request. 153 | - Open new issues about your ideas for making `ethjs-schema` better, and pull requests to show us how your idea works. 154 | - Add new tests to *absolutely anything*. 155 | - Spread the word. 156 | 157 | Please consult our [Code of Conduct](CODE_OF_CONDUCT.md) docs before helping out. 158 | 159 | We communicate via [issues](https://github.com/ethjs/ethjs-schema/issues) and [pull requests](https://github.com/ethjs/ethjs-schema/pulls). 160 | 161 | ## Important documents 162 | 163 | - [Changelog](CHANGELOG.md) 164 | - [Code of Conduct](CODE_OF_CONDUCT.md) 165 | - [License](https://raw.githubusercontent.com/ethjs/ethjs-schema/master/LICENSE) 166 | 167 | ## Licence 168 | 169 | This project is licensed under the MIT license, Copyright (c) 2016 Nick Dodson. For more information see LICENSE.md. 170 | 171 | ``` 172 | The MIT License 173 | 174 | Copyright (c) 2016 Nick Dodson. nickdodson.com 175 | 176 | Permission is hereby granted, free of charge, to any person obtaining a copy 177 | of this software and associated documentation files (the "Software"), to deal 178 | in the Software without restriction, including without limitation the rights 179 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 180 | copies of the Software, and to permit persons to whom the Software is 181 | furnished to do so, subject to the following conditions: 182 | 183 | The above copyright notice and this permission notice shall be included in 184 | all copies or substantial portions of the Software. 185 | 186 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 187 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 188 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 189 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 190 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 191 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 192 | THE SOFTWARE. 193 | ``` 194 | -------------------------------------------------------------------------------- /dist/ethjs-schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "methods": { 3 | "web3_clientVersion": [[], "S"], 4 | "web3_sha3": [["S"], "D", 1], 5 | "net_version": [[], "S"], 6 | "net_peerCount": [[], "Q"], 7 | "net_listening": [[], "B"], 8 | "eth_protocolVersion": [[], "S"], 9 | "eth_syncing": [[], "Boolean|EthSyncing"], 10 | "eth_coinbase": [[], "D20"], 11 | "eth_mining": [[], "B"], 12 | "eth_hashrate": [[], "Q"], 13 | "eth_gasPrice": [[], "Q"], 14 | "eth_accounts": [[], ["D20"]], 15 | "eth_blockNumber": [[], "Q"], 16 | "eth_getBalance": [["D20", "Q|T"], "Q", 1, 2], 17 | "eth_getStorageAt": [["D20", "Q", "Q|T"], "D", 2, 2], 18 | "eth_getTransactionCount": [["D20", "Q|T"], "Q", 1, 2], 19 | "eth_getBlockTransactionCountByHash": [["D32"], "Q", 1], 20 | "eth_getBlockTransactionCountByNumber": [["Q|T"], "Q", 1], 21 | "eth_getUncleCountByBlockHash": [["D32"], "Q", 1], 22 | "eth_getUncleCountByBlockNumber": [["Q"], "Q", 1], 23 | "eth_getCode": [["D20", "Q|T"], "D", 1, 2], 24 | "eth_sign": [["D20", "D32"], "D", 2], 25 | "eth_sendTransaction": [["SendTransaction"], "D", 1], 26 | "eth_sendRawTransaction": [["D"], "D32", 1], 27 | "eth_call": [["CallTransaction", "Q|T"], "D", 1, 2], 28 | "eth_estimateGas": [["EstimateTransaction", "Q|T"], "Q", 1], 29 | "eth_getBlockByHash": [["D32", "B"], "Block", 2], 30 | "eth_getBlockByNumber": [["Q|T", "B"], "Block", 2], 31 | "eth_getTransactionByHash": [["D32"], "Transaction", 1], 32 | "eth_getTransactionByBlockHashAndIndex": [["D32", "Q"], "Transaction", 2], 33 | "eth_getTransactionByBlockNumberAndIndex": [["Q|T", "Q"], "Transaction", 2], 34 | "eth_getTransactionReceipt": [["D32"], "Receipt", 1], 35 | "eth_getUncleByBlockHashAndIndex": [["D32", "Q"], "Block", 1], 36 | "eth_getUncleByBlockNumberAndIndex": [["Q|T", "Q"], "Block", 2], 37 | "eth_getCompilers": [[], ["S"]], 38 | "eth_compileLLL": [["S"], "D", 1], 39 | "eth_compileSolidity": [["S"], "D", 1], 40 | "eth_compileSerpent": [["S"], "D", 1], 41 | "eth_newFilter": [["Filter"], "Q", 1], 42 | "eth_newBlockFilter": [[], "Q"], 43 | "eth_newPendingTransactionFilter": [[], "Q"], 44 | "eth_uninstallFilter": [["Q"], "B", 1], 45 | "eth_getFilterChanges": [["Q"], ["FilterChange"], 1], 46 | "eth_getFilterLogs": [["Q"], ["FilterChange"], 1], 47 | "eth_getLogs": [["Filter"], ["FilterChange"], 1], 48 | "eth_getWork": [[], ["D"]], 49 | "eth_submitWork": [["D", "D32", "D32"], "B", 3], 50 | "eth_submitHashrate": [["D", "D"], "B", 2], 51 | "db_putString": [["S", "S", "S"], "B", 2], 52 | "db_getString": [["S", "S"], "S", 2], 53 | "db_putHex": [["S", "S", "D"], "B", 2], 54 | "db_getHex": [["S", "S"], "D", 2], 55 | "shh_post": [["SHHPost"], "B", 1], 56 | "shh_version": [[], "S"], 57 | "shh_newIdentity": [[], "D"], 58 | "shh_hasIdentity": [["D"], "B"], 59 | "shh_newGroup": [[], "D"], 60 | "shh_addToGroup": [["D"], "B", 1], 61 | "shh_newFilter": [["SHHFilter"], "Q", 1], 62 | "shh_uninstallFilter": [["Q"], "B", 1], 63 | "shh_getFilterChanges": [["Q"], ["SHHFilterChange"], 1], 64 | "shh_getMessages": [["Q"], ["SHHFilterChange"], 1] 65 | }, 66 | "tags": ["latest", "earliest", "pending"], 67 | "objects": { 68 | "EthSyncing": { 69 | "__required": [], 70 | "startingBlock": "Q", 71 | "currentBlock": "Q", 72 | "highestBlock": "Q" 73 | }, 74 | "SendTransaction": { 75 | "__required": ["from", "data"], 76 | "from": "D20", 77 | "to": "D20", 78 | "gas": "Q", 79 | "gasPrice": "Q", 80 | "value": "Q", 81 | "data": "D", 82 | "nonce": "Q" 83 | }, 84 | "EstimateTransaction": { 85 | "__required": [], 86 | "from": "D20", 87 | "to": "D20", 88 | "gas": "Q", 89 | "gasPrice": "Q", 90 | "value": "Q", 91 | "data": "D", 92 | "nonce": "Q" 93 | }, 94 | "CallTransaction": { 95 | "__required": ["to"], 96 | "from": "D20", 97 | "to": "D20", 98 | "gas": "Q", 99 | "gasPrice": "Q", 100 | "value": "Q", 101 | "data": "D", 102 | "nonce": "Q" 103 | }, 104 | "Block": { 105 | "__required": [], 106 | "number": "Q", 107 | "hash": "D32", 108 | "parentHash": "D32", 109 | "nonce": "D", 110 | "sha3Uncles": "D", 111 | "logsBloom": "D", 112 | "transactionsRoot": "D", 113 | "stateRoot": "D", 114 | "receiptsRoot": "D", 115 | "miner": "D", 116 | "difficulty": "Q", 117 | "totalDifficulty": "Q", 118 | "extraData": "D", 119 | "size": "Q", 120 | "gasLimit": "Q", 121 | "gasUsed": "Q", 122 | "timestamp": "Q", 123 | "transactions": ["DATA|Transaction"], 124 | "uncles": ["D"] 125 | }, 126 | "Transaction": { 127 | "__required": [], 128 | "hash": "D32", 129 | "nonce": "Q", 130 | "blockHash": "D32", 131 | "blockNumber": "Q", 132 | "transactionIndex": "Q", 133 | "from": "D20", 134 | "to": "D20", 135 | "value": "Q", 136 | "gasPrice": "Q", 137 | "gas": "Q", 138 | "input": "D" 139 | }, 140 | "Receipt": { 141 | "__required": [], 142 | "transactionHash": "D32", 143 | "transactionIndex": "Q", 144 | "blockHash": "D32", 145 | "blockNumber": "Q", 146 | "cumulativeGasUsed": "Q", 147 | "gasUsed": "Q", 148 | "contractAddress": "D20", 149 | "logs": ["FilterChange"] 150 | }, 151 | "Filter": { 152 | "__required": [], 153 | "fromBlock": "Q|T", 154 | "toBlock": "Q|T", 155 | "address": "Array|Data", 156 | "topics": ["D"] 157 | }, 158 | "FilterChange": { 159 | "__required": [], 160 | "removed": "B", 161 | "logIndex": "Q", 162 | "transactionIndex": "Q", 163 | "transactionHash": "D32", 164 | "blockHash": "D32", 165 | "blockNumber": "Q", 166 | "address": "D20", 167 | "data": "Array|DATA", 168 | "topics": ["D"] 169 | }, 170 | "SHHPost": { 171 | "__required": ["topics", "payload", "priority", "ttl"], 172 | "from": "D", 173 | "to": "D", 174 | "topics": ["D"], 175 | "payload": "D", 176 | "priority": "Q", 177 | "ttl": "Q" 178 | }, 179 | "SHHFilter": { 180 | "__required": ["topics"], 181 | "to": "D", 182 | "topics": ["D"] 183 | }, 184 | "SHHFilterChange": { 185 | "__required": [], 186 | "hash": "D", 187 | "from": "D", 188 | "to": "D", 189 | "expiry": "Q", 190 | "ttl": "Q", 191 | "sent": "Q", 192 | "topics": ["D"], 193 | "payload": "D", 194 | "workProved": "Q" 195 | }, 196 | "SHHMessage": { 197 | "__required": [], 198 | "hash": "D", 199 | "from": "D", 200 | "to": "D", 201 | "expiry": "Q", 202 | "ttl": "Q", 203 | "sent": "Q", 204 | "topics": ["D"], 205 | "payload": "D", 206 | "workProved": "Q" 207 | } 208 | } 209 | } 210 | -------------------------------------------------------------------------------- /dist/ethjs-schema.min.json: -------------------------------------------------------------------------------- 1 | {"methods":{"web3_clientVersion":[[],"S"],"web3_sha3":[["S"],"D",1],"net_version":[[],"S"],"net_peerCount":[[],"Q"],"net_listening":[[],"B"],"eth_protocolVersion":[[],"S"],"eth_syncing":[[],"Boolean|EthSyncing"],"eth_coinbase":[[],"D20"],"eth_mining":[[],"B"],"eth_hashrate":[[],"Q"],"eth_gasPrice":[[],"Q"],"eth_accounts":[[],["D20"]],"eth_blockNumber":[[],"Q"],"eth_getBalance":[["D20","Q|T"],"Q",1,2],"eth_getStorageAt":[["D20","Q","Q|T"],"D",2,2],"eth_getTransactionCount":[["D20","Q|T"],"Q",1,2],"eth_getBlockTransactionCountByHash":[["D32"],"Q",1],"eth_getBlockTransactionCountByNumber":[["Q|T"],"Q",1],"eth_getUncleCountByBlockHash":[["D32"],"Q",1],"eth_getUncleCountByBlockNumber":[["Q"],"Q",1],"eth_getCode":[["D20","Q|T"],"D",1,2],"eth_sign":[["D20","D32"],"D",2],"eth_sendTransaction":[["SendTransaction"],"D",1],"eth_sendRawTransaction":[["D"],"D32",1],"eth_call":[["CallTransaction","Q|T"],"D",1,2],"eth_estimateGas":[["EstimateTransaction","Q|T"],"Q",1],"eth_getBlockByHash":[["D32","B"],"Block",2],"eth_getBlockByNumber":[["Q|T","B"],"Block",2],"eth_getTransactionByHash":[["D32"],"Transaction",1],"eth_getTransactionByBlockHashAndIndex":[["D32","Q"],"Transaction",2],"eth_getTransactionByBlockNumberAndIndex":[["Q|T","Q"],"Transaction",2],"eth_getTransactionReceipt":[["D32"],"Receipt",1],"eth_getUncleByBlockHashAndIndex":[["D32","Q"],"Block",1],"eth_getUncleByBlockNumberAndIndex":[["Q|T","Q"],"Block",2],"eth_getCompilers":[[],["S"]],"eth_compileLLL":[["S"],"D",1],"eth_compileSolidity":[["S"],"D",1],"eth_compileSerpent":[["S"],"D",1],"eth_newFilter":[["Filter"],"Q",1],"eth_newBlockFilter":[[],"Q"],"eth_newPendingTransactionFilter":[[],"Q"],"eth_uninstallFilter":[["Q"],"B",1],"eth_getFilterChanges":[["Q"],["FilterChange"],1],"eth_getFilterLogs":[["Q"],["FilterChange"],1],"eth_getLogs":[["Filter"],["FilterChange"],1],"eth_getWork":[[],["D"]],"eth_submitWork":[["D","D32","D32"],"B",3],"eth_submitHashrate":[["D","D"],"B",2],"db_putString":[["S","S","S"],"B",2],"db_getString":[["S","S"],"S",2],"db_putHex":[["S","S","D"],"B",2],"db_getHex":[["S","S"],"D",2],"shh_post":[["SHHPost"],"B",1],"shh_version":[[],"S"],"shh_newIdentity":[[],"D"],"shh_hasIdentity":[["D"],"B"],"shh_newGroup":[[],"D"],"shh_addToGroup":[["D"],"B",1],"shh_newFilter":[["SHHFilter"],"Q",1],"shh_uninstallFilter":[["Q"],"B",1],"shh_getFilterChanges":[["Q"],["SHHFilterChange"],1],"shh_getMessages":[["Q"],["SHHFilterChange"],1]},"tags":["latest","earliest","pending"],"objects":{"EthSyncing":{"__required":[],"startingBlock":"Q","currentBlock":"Q","highestBlock":"Q"},"SendTransaction":{"__required":["from","data"],"from":"D20","to":"D20","gas":"Q","gasPrice":"Q","value":"Q","data":"D","nonce":"Q"},"EstimateTransaction":{"__required":[],"from":"D20","to":"D20","gas":"Q","gasPrice":"Q","value":"Q","data":"D","nonce":"Q"},"CallTransaction":{"__required":["to"],"from":"D20","to":"D20","gas":"Q","gasPrice":"Q","value":"Q","data":"D","nonce":"Q"},"Block":{"__required":[],"number":"Q","hash":"D32","parentHash":"D32","nonce":"D","sha3Uncles":"D","logsBloom":"D","transactionsRoot":"D","stateRoot":"D","receiptsRoot":"D","miner":"D","difficulty":"Q","totalDifficulty":"Q","extraData":"D","size":"Q","gasLimit":"Q","gasUsed":"Q","timestamp":"Q","transactions":["DATA|Transaction"],"uncles":["D"]},"Transaction":{"__required":[],"hash":"D32","nonce":"Q","blockHash":"D32","blockNumber":"Q","transactionIndex":"Q","from":"D20","to":"D20","value":"Q","gasPrice":"Q","gas":"Q","input":"D"},"Receipt":{"__required":[],"transactionHash":"D32","transactionIndex":"Q","blockHash":"D32","blockNumber":"Q","cumulativeGasUsed":"Q","gasUsed":"Q","contractAddress":"D20","logs":["FilterChange"]},"Filter":{"__required":[],"fromBlock":"Q|T","toBlock":"Q|T","address":"Array|Data","topics":["D"]},"FilterChange":{"__required":[],"removed":"B","logIndex":"Q","transactionIndex":"Q","transactionHash":"D32","blockHash":"D32","blockNumber":"Q","address":"D20","data":"Array|DATA","topics":["D"]},"SHHPost":{"__required":["topics","payload","priority","ttl"],"from":"D","to":"D","topics":["D"],"payload":"D","priority":"Q","ttl":"Q"},"SHHFilter":{"__required":["topics"],"to":"D","topics":["D"]},"SHHFilterChange":{"__required":[],"hash":"D","from":"D","to":"D","expiry":"Q","ttl":"Q","sent":"Q","topics":["D"],"payload":"D","workProved":"Q"},"SHHMessage":{"__required":[],"hash":"D","from":"D","to":"D","expiry":"Q","ttl":"Q","sent":"Q","topics":["D"],"payload":"D","workProved":"Q"}}} 2 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ethjs-schema", 3 | "version": "0.2.1", 4 | "description": "A complete Ethereum RPC specification as a JSON object export.", 5 | "main": "src/schema.json", 6 | "files": [ 7 | "dist", 8 | "src" 9 | ], 10 | "scripts": { 11 | }, 12 | "repository": { 13 | "type": "git", 14 | "url": "git+ssh://git@github.com/ethjs/ethjs-schema.git" 15 | }, 16 | "keywords": [ 17 | "ethereum", 18 | "json", 19 | "rpc", 20 | "specification", 21 | "complete" 22 | ], 23 | "authors": [ 24 | "Nick Dodson " 25 | ], 26 | "license": "MIT", 27 | "bugs": { 28 | "url": "https://github.com/ethjs/ethjs-schema/issues" 29 | }, 30 | "homepage": "https://github.com/ethjs/ethjs-schema#readme" 31 | } 32 | -------------------------------------------------------------------------------- /src/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "methods": { 3 | "web3_clientVersion": [[], "S"], 4 | "web3_sha3": [["S"], "D", 1], 5 | "net_version": [[], "S"], 6 | "net_peerCount": [[], "Q"], 7 | "net_listening": [[], "B"], 8 | "personal_sign": [["D", "D20", "S"], "D", 2], 9 | "personal_ecRecover": [["D", "D"], "D20", 2], 10 | "eth_protocolVersion": [[], "S"], 11 | "eth_syncing": [[], "B|EthSyncing"], 12 | "eth_coinbase": [[], "D20"], 13 | "eth_mining": [[], "B"], 14 | "eth_hashrate": [[], "Q"], 15 | "eth_gasPrice": [[], "Q"], 16 | "eth_accounts": [[], ["D20"]], 17 | "eth_blockNumber": [[], "Q"], 18 | "eth_getBalance": [["D20", "Q|T"], "Q", 1, 2], 19 | "eth_getStorageAt": [["D20", "Q", "Q|T"], "D", 2, 2], 20 | "eth_getTransactionCount": [["D20", "Q|T"], "Q", 1, 2], 21 | "eth_getBlockTransactionCountByHash": [["D32"], "Q", 1], 22 | "eth_getBlockTransactionCountByNumber": [["Q|T"], "Q", 1], 23 | "eth_getUncleCountByBlockHash": [["D32"], "Q", 1], 24 | "eth_getUncleCountByBlockNumber": [["Q"], "Q", 1], 25 | "eth_getCode": [["D20", "Q|T"], "D", 1, 2], 26 | "eth_sign": [["D20", "D"], "D", 2], 27 | "eth_signTypedData": [["Array|DATA", "D20"], "D", 1], 28 | "eth_sendTransaction": [["SendTransaction"], "D", 1], 29 | "eth_sendRawTransaction": [["D"], "D32", 1], 30 | "eth_call": [["CallTransaction", "Q|T"], "D", 1, 2], 31 | "eth_estimateGas": [["EstimateTransaction", "Q|T"], "Q", 1], 32 | "eth_getBlockByHash": [["D32", "B"], "Block", 2], 33 | "eth_getBlockByNumber": [["Q|T", "B"], "Block", 2], 34 | "eth_getTransactionByHash": [["D32"], "Transaction", 1], 35 | "eth_getTransactionByBlockHashAndIndex": [["D32", "Q"], "Transaction", 2], 36 | "eth_getTransactionByBlockNumberAndIndex": [["Q|T", "Q"], "Transaction", 2], 37 | "eth_getTransactionReceipt": [["D32"], "Receipt", 1], 38 | "eth_getUncleByBlockHashAndIndex": [["D32", "Q"], "Block", 1], 39 | "eth_getUncleByBlockNumberAndIndex": [["Q|T", "Q"], "Block", 2], 40 | "eth_getCompilers": [[], ["S"]], 41 | "eth_compileLLL": [["S"], "D", 1], 42 | "eth_compileSolidity": [["S"], "D", 1], 43 | "eth_compileSerpent": [["S"], "D", 1], 44 | "eth_newFilter": [["Filter"], "Q", 1], 45 | "eth_newBlockFilter": [[], "Q"], 46 | "eth_newPendingTransactionFilter": [[], "Q"], 47 | "eth_uninstallFilter": [["QP"], "B", 1], 48 | "eth_getFilterChanges": [["QP"], ["FilterChange"], 1], 49 | "eth_getFilterLogs": [["QP"], ["FilterChange"], 1], 50 | "eth_getLogs": [["Filter"], ["FilterChange"], 1], 51 | "eth_getWork": [[], ["D"]], 52 | "eth_submitWork": [["D", "D32", "D32"], "B", 3], 53 | "eth_submitHashrate": [["D", "D"], "B", 2], 54 | "db_putString": [["S", "S", "S"], "B", 2], 55 | "db_getString": [["S", "S"], "S", 2], 56 | "db_putHex": [["S", "S", "D"], "B", 2], 57 | "db_getHex": [["S", "S"], "D", 2], 58 | "shh_post": [["SHHPost"], "B", 1], 59 | "shh_version": [[], "S"], 60 | "shh_newIdentity": [[], "D"], 61 | "shh_hasIdentity": [["D"], "B"], 62 | "shh_newGroup": [[], "D"], 63 | "shh_addToGroup": [["D"], "B", 1], 64 | "shh_newFilter": [["SHHFilter"], "Q", 1], 65 | "shh_uninstallFilter": [["Q"], "B", 1], 66 | "shh_getFilterChanges": [["Q"], ["SHHFilterChange"], 1], 67 | "shh_getMessages": [["Q"], ["SHHFilterChange"], 1] 68 | }, 69 | "tags": ["latest", "earliest", "pending"], 70 | "objects": { 71 | "EthSyncing": { 72 | "__required": [], 73 | "startingBlock": "Q", 74 | "currentBlock": "Q", 75 | "highestBlock": "Q" 76 | }, 77 | "SendTransaction": { 78 | "__required": ["from", "data"], 79 | "from": "D20", 80 | "to": "D20", 81 | "gas": "Q", 82 | "gasPrice": "Q", 83 | "value": "Q", 84 | "data": "D", 85 | "nonce": "Q" 86 | }, 87 | "EstimateTransaction": { 88 | "__required": [], 89 | "from": "D20", 90 | "to": "D20", 91 | "gas": "Q", 92 | "gasPrice": "Q", 93 | "value": "Q", 94 | "data": "D", 95 | "nonce": "Q" 96 | }, 97 | "CallTransaction": { 98 | "__required": ["to"], 99 | "from": "D20", 100 | "to": "D20", 101 | "gas": "Q", 102 | "gasPrice": "Q", 103 | "value": "Q", 104 | "data": "D", 105 | "nonce": "Q" 106 | }, 107 | "Block": { 108 | "__required": [], 109 | "number": "Q", 110 | "hash": "D32", 111 | "parentHash": "D32", 112 | "nonce": "D", 113 | "sha3Uncles": "D", 114 | "logsBloom": "D", 115 | "transactionsRoot": "D", 116 | "stateRoot": "D", 117 | "receiptsRoot": "D", 118 | "miner": "D", 119 | "difficulty": "Q", 120 | "totalDifficulty": "Q", 121 | "extraData": "D", 122 | "size": "Q", 123 | "gasLimit": "Q", 124 | "gasUsed": "Q", 125 | "timestamp": "Q", 126 | "transactions": ["DATA|Transaction"], 127 | "uncles": ["D"] 128 | }, 129 | "Transaction": { 130 | "__required": [], 131 | "hash": "D32", 132 | "nonce": "Q", 133 | "blockHash": "D32", 134 | "blockNumber": "Q", 135 | "transactionIndex": "Q", 136 | "from": "D20", 137 | "to": "D20", 138 | "value": "Q", 139 | "gasPrice": "Q", 140 | "gas": "Q", 141 | "input": "D" 142 | }, 143 | "Receipt": { 144 | "__required": [], 145 | "transactionHash": "D32", 146 | "transactionIndex": "Q", 147 | "blockHash": "D32", 148 | "blockNumber": "Q", 149 | "cumulativeGasUsed": "Q", 150 | "gasUsed": "Q", 151 | "contractAddress": "D20", 152 | "logs": ["FilterChange"] 153 | }, 154 | "Filter": { 155 | "__required": [], 156 | "fromBlock": "Q|T", 157 | "toBlock": "Q|T", 158 | "address": "D20", 159 | "topics": ["D"] 160 | }, 161 | "FilterChange": { 162 | "__required": [], 163 | "removed": "B", 164 | "logIndex": "Q", 165 | "transactionIndex": "Q", 166 | "transactionHash": "D32", 167 | "blockHash": "D32", 168 | "blockNumber": "Q", 169 | "address": "D20", 170 | "data": "Array|DATA", 171 | "topics": ["D"] 172 | }, 173 | "SHHPost": { 174 | "__required": ["topics", "payload", "priority", "ttl"], 175 | "from": "D", 176 | "to": "D", 177 | "topics": ["D"], 178 | "payload": "D", 179 | "priority": "Q", 180 | "ttl": "Q" 181 | }, 182 | "SHHFilter": { 183 | "__required": ["topics"], 184 | "to": "D", 185 | "topics": ["D"] 186 | }, 187 | "SHHFilterChange": { 188 | "__required": [], 189 | "hash": "D", 190 | "from": "D", 191 | "to": "D", 192 | "expiry": "Q", 193 | "ttl": "Q", 194 | "sent": "Q", 195 | "topics": ["D"], 196 | "payload": "D", 197 | "workProved": "Q" 198 | }, 199 | "SHHMessage": { 200 | "__required": [], 201 | "hash": "D", 202 | "from": "D", 203 | "to": "D", 204 | "expiry": "Q", 205 | "ttl": "Q", 206 | "sent": "Q", 207 | "topics": ["D"], 208 | "payload": "D", 209 | "workProved": "Q" 210 | } 211 | } 212 | } 213 | --------------------------------------------------------------------------------