Product
Socket Now Supports uv.lock Files
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
The goal is for this to support most common web3 functionality in ReasonML as well as some less common functionality that I need.
I am currently learning ReasonML and using this as an exercise at implementing something I understand fairly well (web3) using ReasonMl.
This means the API is likely going to change a lot as I learn more about idiomatic ReasonML and fix stupid beginners mistakes.
There is currently support for the following providers that both live in the Providers
namespace:
Providers.web3(web3provider)
which wraps an existing web3 provider eg. MetaMaskProviders.http(url)
which is configured with a url to a http based provider like infuraOnce you have a provider you pass it as a parameter to all the functions in the Eth
namespace.
let provider = Providers.http("https://mainnet.infura.io/bs-eth");
netVersion(provider)
|> Repromise.wait(result => switch (result) {
| Ok(netId) => Js.log("we are on the " ++ string_of_int(netId) ++ " chain")
| Error(msg) => Js.log(msg)
});
All functions in the Eth
module return typed Belt.Result
in a Repromise. So instead of looking out for rejected calls, do a pattern match.
See the List of Methods implemented for more details.
The RPC methods currently implemented are:
eth_accounts
as accounts()
eth_blockNumber
as blockNumber()
eth_call
as call()
eth_coinbase
as coinbase()
eth_estimateGas
as estimateGas()
eth_gasPrice
as gasPrice()
eth_getBalance
as balanceOf()
eth_getBlockByNumber
as blockByNumber
eth_getBlockByHash
as blockByHash
eth_getBlockTransactionCountByHash
eth_getBlockTransactionCountByNumber
eth_getCode
eth_getCompilers
eth_getFilterChanges
eth_getFilterLogs
eth_getLogs
eth_getStorageAt
eth_getTransactionByHash
as transactionByHash()
eth_getTransactionByBlockHashAndIndex
eth_getTransactionByBlockNumberAndIndex
eth_getTransactionCount
as transactionCount()
eth_getTransactionReceipt
as `transactionReceipt()eth_hashrate
eth_mining
eth_newBlockFilter
eth_newFilter
(includes log/event filters)eth_protocolVersion
eth_sendTransaction
as sendTransaction()
eth_sendRawTransaction
as sendRawTransaction()
eth_subscribe
(only for websocket connections. "syncing" subscriptions are not yet supported)eth_unsubscribe
(only for websocket connections. "syncing" subscriptions are not yet supported)eth_syncing
eth_uninstallFilter
net_listening
net_peerCount
net_version
as netVersion()
Non-Standard ganache-cli methods:
evm_snapshot
evm_revert
evm_increaseTime
evm_mine
as mineBlock()
FAQs
Web3 like library for ReasonML/Bucklescript
The npm package bs-eth receives a total of 1 weekly downloads. As such, bs-eth popularity was classified as not popular.
We found that bs-eth 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.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.
Security News
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.