Development

Development

2464 bookmarks
Newest
LLM prompt | MetaMask developer documentation
LLM prompt | MetaMask developer documentation
LLM Prompt
You are a helpful assistant with expertise in MetaMask SDK integration. You help developers implement MetaMask wallet connections and blockchain interactions in their applications. Core capabilities of the SDK: - Connect to MetaMask wallet (extension or mobile) - Read and write data to smart contracts - Handle blockchain transactions - Manage network connections - Work with Web3 standards (EIP-1193, EIP-6963) Technologies: - Primary stack (recommended): - Wagmi (React hooks for Ethereum) - TypeScript - React/Next.js - Viem (Ethereum interactions) - Alternative approach: - Vanilla JavaScript - MetaMask provider API - EIP-1193 provider interface Common patterns: 1. Wallet connection Using Wagmi (Recommended): ```js import { useConnect } from "wagmi" function Connect() { const { connect, connectors } = useConnect() return ( <button onClick={() => connect({ connector: connectors[0] })}> Connect Wallet </button> ) } ``` Using Vanilla JS: ```js const provider = window.ethereum; const accounts = await provider.request({ method: "eth_requestAccounts" }); ``` 2. Read contract data Using Wagmi: ```js const { data } = useReadContract({ address: contractAddress, abi: contractABI, functionName: "balanceOf", args: [address], }) ``` Using Vanilla JS: ```js const result = await provider.request({ method: "eth_call", params: [{ to: contractAddress, data: encodedFunctionData, }], }); ``` 3. Write to contracts Using Wagmi: ```js const { writeContract } = useWriteContract(); await writeContract({ address: contractAddress, abi: contractABI, functionName: "mint", args: [tokenId], }) ``` Using Vanilla JS: ```js await provider.request({ method: "eth_sendTransaction", params: [{ to: contractAddress, data: encodedFunctionData, }], }); ``` Best practices: - Always handle errors gracefully - Show clear loading states - Track transaction status - Validate inputs and addresses - Use appropriate gas settings - Consider mobile wallet interactions Assistant response guidelines: When answering questions: - Prefer Wagmi examples unless vanilla JS is specifically requested - Include error handling in examples - Consider both web and mobile wallet scenarios - Provide TypeScript types where relevant - Include brief explanations with code examples - Consider security implications Example usage: I (the user) can ask questions like: - "How do I connect to MetaMask?" - "How do I read a token balance?" - "How do I send a transaction?" - "How do I handle network changes?" - "How do I implement wallet disconnection?" - "How do I add error handling for contract calls?" I can also ask about specific implementation details, best practices, or troubleshooting. Edit this page
·docs.metamask.io·
LLM prompt | MetaMask developer documentation
Extensions / Get started | Chrome for Developers
Extensions / Get started | Chrome for Developers
All the basics to get started with Chrome extensions
What are extensions? Chrome extensions enhance the browsing experience by customizing the user interface, observing browser events, and modifying the web. Visit the Chrome Web Store for more examples of what extensions can do.
How are they built? You can build extensions using the same web technologies that are used to create web applications: HTML, CSS, and JavaScript.
What can they do? In addition to Web APIs, extensions also have access to Chrome Extension APIs to accomplish different tasks. For a more detailed overview, take a look at the Develop guide.
The extension's manifest is the only required file that must have a specific file name: manifest.json. It also has to be located in the extension's root directory. The manifest records important metadata, defines resources, declares permissions, and identifies which files to run in the background and on the page.
https://developer.chrome.com/docs/extensions/get-started
A service worker runs in the background and handles browser events, like removing a bookmark, or closing a tab. They don't have access to the DOM, but you can combine it with an offscreen document for this use case.
Content scripts run JavaScript in the context of a web page.
·developer.chrome.com·
Extensions / Get started | Chrome for Developers
Web API | Pushcut
Web API | Pushcut
Trigger iOS shortcuts from anywhere! Automation superpowers through smart notifications. Trigger the right action based on location, time, HomeKit, or any online event. Connect to HomeKit, IFTTT, Zapier, Flow, Make, or anything connected to the internet.
·pushcut.io·
Web API | Pushcut
EP152: 30 Free APIs for Developers | daily.dev
EP152: 30 Free APIs for Developers | daily.dev
This post features a comprehensive list of 30 free APIs for developers, covering various categories such as open data, weather, news, AI & NLP, and sports. It also highlights key insights from a Datadog report on cloud security, discusses tips for designing fault-tolerant systems, and provides a roadmap for learning generative AI. Additionally, it delves into the evolution of HTTP protocols and the structure of URLs.
·app.daily.dev·
EP152: 30 Free APIs for Developers | daily.dev
(20+) Beyond the Chatbot: Agentic AI with Gemma | daily.dev
(20+) Beyond the Chatbot: Agentic AI with Gemma | daily.dev
Gemma is a family of lightweight generative AI models designed for Agentic AI, which contrasts with reactive AI by being proactive and autonomous in decision-making. The post guides readers on constructing a Gemma 2 based Agentic AI system using techniques like Function Calling, ReAct, and Few-shot prompting. The potential applications of Agentic AI, especially in gaming, are highlighted, demonstrating its capability to generate dynamic and interactive content.
·app.daily.dev·
(20+) Beyond the Chatbot: Agentic AI with Gemma | daily.dev
(4) My 2024 Good Links List | daily.dev
(4) My 2024 Good Links List | daily.dev
A comprehensive list of useful links categorized by developer tools, design and UX resources, analytics, AI, workflow, e-commerce, inspiration, web3, and other miscellaneous topics. The list includes platforms like Supabase, Tailwind UI, Vercel AI SDK, Mixpanel, Monday.com, Thirdweb, and more, offering a wide range of solutions for various development and design needs.
·app.daily.dev·
(4) My 2024 Good Links List | daily.dev