wevm / anvil.js Goto Github PK
View Code? Open in Web Editor NEWTypeScript wrapper for Foundry Anvil
License: MIT License
TypeScript wrapper for Foundry Anvil
License: MIT License
await anvil.start();
const simulatorBlockNumber = await anvil.getBlockNumber();
console.log(simulatorBlockNumber)
await anvil.stop();
gives:
anvil.getBlockNumber is not a function.
How should I interact?
There is a cjs build but because execa
is included and is a js library of type: module cjs doesn't work
After looking over get-port it seems that a mutex is needed or else there's a chance the same port can be assigned to the different process.
Playwright imports CJS by default in global setup, but it will complain about get-port needing to be dyanmically imported. I made a patch in our repository: https://github.com/sushiswap/sushiswap/blob/master/patches/%40viem__anvil%400.0.6.patch
Keeping track of various ideas for improvements ...
anvil
is not in PATHIcing on the cake:
For anvil itself:
await anvil.stop();
does not returns but the service is stopped
We are currently tracking whether anvil fails to start, but after that, we don't really monitor the underlying anvil process anymore to capture any crashes or exits.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.