![Introducing Enhanced Alert Actions and Triage Functionality](https://cdn.sanity.io/images/cgdhsj6q/production/fe71306d515f85de6139b46745ea7180362324f0-2530x946.png?w=800&fit=max&auto=format)
Product
Introducing Enhanced Alert Actions and Triage Functionality
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
ethereumjs-account
Advanced tools
Readme
Implements schema and functions relating to accounts stored ethereum's state Trie
NOTE: this is different from ethereumjs-accounts which should be used if you want to key management and web3 sugar.
Scrollback or #ethereumjs on freenode
npm install ethereumjs-account
This module work with browserify
new Account([data])
Creates an new account object
data
- an account can be initiailized with either a buffer
containing the RLP serialized account.
Or an array
of buffers relating to each of the tx Properties, listed in order below. For example.var raw = [
'02', //nonce
'0384', //balance
'56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421', //stateRoot
'c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470' //codeHash
];
var tx = new Account(raw);
Or lastly an Object
containing the Properties of the transaction
var raw = {
nonce: '',
balance: '03e7',
stateRoot: '56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421',
codeHash: 'c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470'
};
var tx = new Account(raw);
For Object
and Arrays
each of the elements can either be a Buffer
, hex String
, Number
, or an object with a toBuffer
method such as Bignum
.
Account
Propertiesnonce
- The account's nonce.balance
- The account's balance in wiestateRoot
- the stateRoot for the storage of the contractcodeHash
- the hash of the code of the contractAccount
MethodsAccount.isEmpty()
Returns a Boolean
determining if the account is empty
account.isContract()
Returns a Boolean
deteremining if the account is a contract
account.isPrecompiled
Returns a Boolean
deteremining of the account is a preCompiled contract
account.serialize()
Returns the RLP serialization of the account as a Buffer
acount.toJSON([object])
Returns the account as JSON
object
- a Boolean
that defaults to false. If object
is true then this will return an object else it will return an array
.account.getCode(trie, cb)
Fetches the code from the trie
trie
- the trie to storing the accountscb
- the callbackaccount.setCode(trie, code, cb)
Stores the code in the trie
trie
- the triecode
- a Buffer
cb
- the callbackaccount.getStorage(trie, key, cb)
Fetches key
from the account's storage
account.setStorage(trie, key, val, cb)
Stores a val
at the key
in the contract's storage
FAQs
Encoding, decoding and validation of Ethereum's Account schema
The npm package ethereumjs-account receives a total of 87,150 weekly downloads. As such, ethereumjs-account popularity was classified as popular.
We found that ethereumjs-account demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers 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.
Product
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
Security News
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
Security News
OpenSSF is warning open source maintainers to stay vigilant against reputation farming on GitHub, where users artificially inflate their status by manipulating interactions on closed issues and PRs.