Aptos's transaction.simulate.simple is really frustrating! Sometimes it throws errors for no reason, and other times it goes through smoothly. It made me doubt whether there was an issue with the contract or if it was a problem with the node or wallet. In theory, simulating before executing a transaction is for safety, but once the simulation fails, the whole process gets stuck and can't move forward. But if I skip the simulation, I won't feel at ease; what if there really is a big problem that I didn't catch in time? That would be a disaster. 😮‍💨
Finally finished organizing the Web3-related code~ This should be the longest coding session since leaving Web2, continuing for several days. The goal is to free up hands and attention, allowing the program to automatically execute some repetitive tasks, while achieving modularity and configurability. 📝 It is basically divided into four parts: 1️⃣ On-chain contract interaction framework (including EVM, Aptos, Sui): The framework supports multi-chain expansion, multi-module expansion, and multiple modules can be configured to form new workflows for task execution. 2️⃣ Desktop-level automation: A few years ago, I used Autohotkey combined with the browser's development mode to achieve automatic clicking on the desktop and precise operations on the browser. Now that I've switched to Mac, AHK is no longer applicable, but fortunately, Mac comes with AppleScript, which has a similar basic logic to AHK and is also safer. 3️⃣ Heavy browser automation: The core uses Playwright, and I modified and refactored an old codebase from a few years ago. It is quite convenient to record operations and generate scripts. Although browser automation is very streamlined, I still encapsulated the operations for wallet plugins. 4️⃣ Light browser automation: Using Tampermonkey in conjunction with browser console scripts, if it weren't for the console scripts being unable to obtain certain permissions (like accessing the clipboard), Tampermonkey would hardly be useful. In practical use, 1️⃣ and 2️⃣ are the most comfortable to use, quick to modify, and fast to execute. Especially 1️⃣, when combined with network requests, it can simulate the entire front end of a dApp, running silently in the background.
Show original
10.28K
6
The content on this page is provided by third parties. Unless otherwise stated, OKX is not the author of the cited article(s) and does not claim any copyright in the materials. The content is provided for informational purposes only and does not represent the views of OKX. It is not intended to be an endorsement of any kind and should not be considered investment advice or a solicitation to buy or sell digital assets. To the extent generative AI is utilized to provide summaries or other information, such AI generated content may be inaccurate or inconsistent. Please read the linked article for more details and information. OKX is not responsible for content hosted on third party sites. Digital asset holdings, including stablecoins and NFTs, involve a high degree of risk and can fluctuate greatly. You should carefully consider whether trading or holding digital assets is suitable for you in light of your financial condition.