Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
@appliedblockchain/helpers
Advanced tools
No dependency, single file helpers. Skewed towards ethereum.
npm i @appliedblockchain/helpers
privateKey
BufferReturns Buffer ethereum address of provided privateKey
.
Returns ethereum address of provided public key.
publicKey
BufferReturns Buffer
url
stringblockNumberOrTag
("earliest"
| "latest"
| "pending"
| number) (optional, default 'latest'
)timeout
number (optional, default defaultTiemout
)Returns Promise<string?> block hash as hex0x string or null from provided ethereum jsonrpc endpoint url
in specified timeout
; null
if timeout has been reached.
Parses string and returns true
for "true"
, "on"
, "yes"
and "1"
strings, false
otherwise.
value
stringReturns boolean
Returns Buffer
representation of provided hex (ie. "ff"
) or hex0x (ie. "0xff"
) string.
value
string
Throws any TypeError On invalid input.
Default comparision function.
x
anyy
anyReturns (-1
| 0
| 1
)
Similar to Promise.all
but yields after each promise settlement.
Exceptions are captured and results are yielded as [ err, result, i ]
tuple.
Returns AsyncGenerator<[Error?, T?, number], any, any>
Returns boolean value of command line argument.
name
stringconst flagOfBoolean = require('@appliedblockchain/helpers/flag-of-boolean')
console.log(flagOfBoolean('--bar'))
// node foo.js
// false
// node foo.js --bar
// true
Returns Promise<number> Height of the chain from provided ethereum jsonrpc endpoint url
or NaN
if timeout has been reached or any other problem occured.
value
numberReturns string 0x-prefixed hex string representation of a safe, non-negative integer number.
Checks if value
looks like YYYY-MM-DD
date string.
value
anyReturns boolean
Returns true
if promise has not settled yet, false
otherwise.
value
Promise<any>Returns boolean
Returns true
if value is safe integer greater than or equal to zero, false
otherwise.
value
anyReturns boolean
value
numberReturns boolean true
if value is safe integer greater than zero, false
otherwise.
Captures extra stack trace, usage await foo().catch(makeRetrace())
.
Identity function.
Returns number random unsigned integer that fits 32 bits.
Executes simple shell command.
cmd
string$1
any (optional, default {}
)
$1.trim
(optional, default true
)Computes xs - ys difference in linear time between two, unique, ascending arrays of values. Comparision function can be flipped for descending arrays. Leaks values of arrays in thrown error.
Returns Array<T>
Computes intersection in linear time between two, unique, ascending arrays of values. Comparision function can be flipped for descending arrays. Leaks values of arrays in thrown error.
Returns Array<T>
Expire cached nonces after 1 minute.
Spread n
calls to f
function ms
milliseconds apart.
MIT License
Copyright 2019 Applied Blockchain
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.
FAQs
No dependency, single file helpers.
We found that @appliedblockchain/helpers demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 17 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.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.