Finally finished organizing the Web3 related code~
This should be the longest coding session since leaving Web2, spanning several consecutive days.
The goal is to free hands and attention, allowing the program to automatically execute some repetitive tasks, while achieving modularity and configurability.
📝 Basically divided into four parts:
1️⃣ On-chain contract interaction framework (including EVM, Aptos, Sui): The framework supports multi-chain extension, multi-module extension, and multiple modules can be configured to form new processes for task execution.
2️⃣ Desktop automation: A few years ago, I used Autohotkey combined with browser development mode to achieve automatic clicks on the desktop and precise operations on the browser. Now, switching to Mac has made AHK unsuitable, but luckily Mac comes with AppleScript, which has a similar basic logic to AHK and is safer.
3️⃣ Heavy browser automation: The core is based on Playwright, modifying and refactoring a codebase from a few years ago, it is quite convenient to record actions and generate scripts. Although browser automation is very streamlined, I still encapsulated operations for wallet plugins.
4️⃣ Light browser automation: Using Tampermonkey along with browser console scripts. If it weren't for the fact that console scripts cannot obtain certain permissions (like accessing the clipboard), Tampermonkey would hardly be used at all.
In practical use, 1️⃣ and 2️⃣ are the most comfortable to use, quick to modify, and execute quickly.
Especially 1️⃣, when combined with network requests, can simulate the entire front end of a dApp, running the entire backend silently.