-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Web3.fs is a functional library for interacting with Ethereum mainnet and its testnets. It allows for both scripting use via fsi
/.fsx or in compiled program code. It can also be used to create contract bindings for easy, composable re-use.
Web3.fs may or may not be compatible with other EVM chains, depending on whether or not they run with type 2 (EIP-1559) transactions. No particular effort has been made at this time to support 'legacy' transactions.
Web3.fs does not currently support WebSockets for RPCs, and so there are several interactions that are currently impossible, such as setting and monitoring filters. Otherwise, all relevant standard RPC methods are supported. Niche/custom methods (mostly MetaMask-only calls) aren't supported.
Web3.fs does not have an 'accounts' module. In other words, it does not create or manage private keys. This is an opinionated decision in order to avoid unsafe behavior that is a common source of leaked secrets. Instead, Web3.fs expects to connect to an RPC endpoint that handles secrets, like Frame. However, another library could be built on top of Web3.fs that included this functionality.
Multiple simultaneous connections to multiple RPCs or the same RPC are supported, with different addresses. In this way, various deployment or interaction scenarios are supported.
Both contract deployment and interacting with a specific deployed contracts are supported. All actions are asynchronous underneath the API, but are presented via a synchronous interface. Thus, there's no need for async
CEs nor numerous Async.RunSynchronously
keywords. Async wrappers for some of the primary functions (contractCall
, sendValue
etc) are under consideration but will need testing for unintended side effects.
Web3.fs includes support for nearly all ABI inputs types currently supported for the 'v2' encoder included in Solidity, including tupled types. It doesn't support the function
argument type (because of a technical concern), nor does it support multi-dimensional arrays. A survey of 4byte directory shows that such arguments are exceedingly rare.