Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Just the Ethereum encoding and decoding methods from the ethers-io-wallet.
Just method and event encoding and decoding from the ethers-wallet
.
Note, this package is experimental, and is not ready for production use.
const abi = require('ethjs-abi');
const SimpleStoreABI = [{"constant":false,"inputs":[{"name":"_value","type":"uint256"}],"name":"set","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"get","outputs":[{"name":"storeValue","type":"uint256"}],"payable":false,"type":"function"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_newValue","type":"uint256"},{"indexed":false,"name":"_sender","type":"address"}],"name":"SetComplete","type":"event"}];
const setInputBytecode = abi.encodeMethod(SimpleStoreABI[0], [24000]);
// returns 0x60fe47b10000000000000000000000000000000000000000000000000000000000005dc0
const setOutputBytecode = abi.decodeMethod(SimpleStoreABI[0], "0x0000000000000000000000000000000000000000000000000000000000000001");
// returns Result { '0': true }
const getInputBytecode = abi.encodeMethod(SimpleStoreABI[1], []);
// returns 0x6d4ce63c
const getMethodOutputBytecode = abi.decodeMethod(SimpleStoreABI[1], "0x000000000000000000000000000000000000000000000000000000000000b26e");
// returns Result { '0': <BN: b26e>, storeValue: <BN: b26e> }
const SetCompleteInputBytecode = abi.encodeEvent(SimpleStoreABI[2], [24000, "0xca35b7d915458ef540ade6068dfe2f44e8fa733c"]);
// returns 0x10e8e9bc0000000000000000000000000000000000000000000000000000000000005dc0000000000000000000000000ca35b7d915458ef540ade6068dfe2f44e8fa733c
const SetCompleteOutputBytecode = abi.decodeEvent(SimpleStoreABI[2], "0x0000000000000000000000000000000000000000000000000000000000000d7d000000000000000000000000ca35b7d915458ef540ade6068dfe2f44e8fa733c", ["0xc36800ebd6079fdafc3a7100d0d1172815751804a6d1b7eb365b85f6c9c80e61"]);
/* returns Result {
'0': <BN: d7d>,
'1': '0xca35b7d915458ef540ade6068dfe2f44e8fa733c',
_newValue: <BN: d7d>,
_sender: '0xca35b7d915458ef540ade6068dfe2f44e8fa733c' }
*/
const methodSig = abi.encodeSignature(SimpleStoreABI[2]);
/* returns 0x10e8e9bc */
for contract SimpleStore:
pragma solidity ^0.4.4;
contract SimpleStore {
uint store;
function set(uint256 _value) returns (bool) {
store = _value;
SetComplete(store, msg.sender);
return true;
}
function get() returns (uint256 storeValue) {
return store;
}
event SetComplete(uint256 _newValue, address _sender);
}
Just the encoding and decoding of contract data.
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.
You'll find more detailed information on using ethjs-abi
and tailoring it to your needs in our guides:
ethjs-abi
and writing your own code and coverage.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:
ethjs-abi
better, and pull requests to show us how your idea works.We communicate via issues and pull requests.
This project is licensed under the MIT license, Copyright (c) 2016 Nick Dodson. For more information see LICENSE.md.
The MIT License
Copyright (c) 2016 Nick Dodson. nickdodson.com
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Richard Moore me@ricmoo.com
FAQs
Just the Ethereum encoding and decoding methods from the ethers-io-wallet.
The npm package ethjs-abi receives a total of 22,132 weekly downloads. As such, ethjs-abi popularity was classified as popular.
We found that ethjs-abi demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.