# Table of Contents - [Alchemy Documentation - Build anything onchain](#alchemy-documentation-build-anything-onchain) - [Node API Overview | Alchemy Docs](#node-api-overview-alchemy-docs) - [Alchemy Rollups Overview | Alchemy Docs](#alchemy-rollups-overview-alchemy-docs) - [Choose Your Starting Point | Alchemy Docs](#choose-your-starting-point-alchemy-docs) - [Data APIs Overview | Alchemy Docs](#data-apis-overview-alchemy-docs) - [Unknown](#unknown) - [Changelog | Alchemy Docs](#changelog-alchemy-docs) - [Alchemy Quickstart Guide | Alchemy Docs](#alchemy-quickstart-guide-alchemy-docs) - [Subscription API Overview | Alchemy Docs](#subscription-api-overview-alchemy-docs) - [Webhooks Quickstart | Alchemy Docs](#webhooks-quickstart-alchemy-docs) - [Smart Wallets | Alchemy Docs](#smart-wallets-alchemy-docs) - [October 16, 2025 | Changelog | Alchemy Docs](#october-16-2025-changelog-alchemy-docs) - [October 23, 2025 | Changelog | Alchemy Docs](#october-23-2025-changelog-alchemy-docs) - [November 6, 2025 | Changelog | Alchemy Docs](#november-6-2025-changelog-alchemy-docs) - [November 20, 2025 | Changelog | Alchemy Docs](#november-20-2025-changelog-alchemy-docs) - [October 30, 2025 | Changelog | Alchemy Docs](#october-30-2025-changelog-alchemy-docs) - [August 14, 2025 | Changelog | Alchemy Docs](#august-14-2025-changelog-alchemy-docs) - [July 31, 2025 | Changelog | Alchemy Docs](#july-31-2025-changelog-alchemy-docs) - [December 25, 2025 | Changelog | Alchemy Docs](#december-25-2025-changelog-alchemy-docs) - [November 27, 2025 | Changelog | Alchemy Docs](#november-27-2025-changelog-alchemy-docs) - [Initialization | Alchemy Docs](#initialization-alchemy-docs) - [October 9, 2025 | Changelog | Alchemy Docs](#october-9-2025-changelog-alchemy-docs) - [November 13, 2025 | Changelog | Alchemy Docs](#november-13-2025-changelog-alchemy-docs) - [July 17, 2025 | Changelog | Alchemy Docs](#july-17-2025-changelog-alchemy-docs) - [July 24, 2025 | Changelog | Alchemy Docs](#july-24-2025-changelog-alchemy-docs) - [August 7, 2025 | Changelog | Alchemy Docs](#august-7-2025-changelog-alchemy-docs) - [October 2, 2025 | Changelog | Alchemy Docs](#october-2-2025-changelog-alchemy-docs) - [December 4, 2025 | Changelog | Alchemy Docs](#december-4-2025-changelog-alchemy-docs) - [December 11, 2025 | Changelog | Alchemy Docs](#december-11-2025-changelog-alchemy-docs) - [September 11, 2025 | Changelog | Alchemy Docs](#september-11-2025-changelog-alchemy-docs) - [August 28, 2025 | Changelog | Alchemy Docs](#august-28-2025-changelog-alchemy-docs) - [September 18, 2025 | Changelog | Alchemy Docs](#september-18-2025-changelog-alchemy-docs) - [December 18, 2025 | Changelog | Alchemy Docs](#december-18-2025-changelog-alchemy-docs) - [January 22, 2026 | Changelog | Alchemy Docs](#january-22-2026-changelog-alchemy-docs) - [January 15, 2026 | Changelog | Alchemy Docs](#january-15-2026-changelog-alchemy-docs) - [January 29, 2026 | Changelog | Alchemy Docs](#january-29-2026-changelog-alchemy-docs) - [January 8, 2026 | Changelog | Alchemy Docs](#january-8-2026-changelog-alchemy-docs) - [August 21, 2025 | Changelog | Alchemy Docs](#august-21-2025-changelog-alchemy-docs) - [September 4, 2025 | Changelog | Alchemy Docs](#september-4-2025-changelog-alchemy-docs) - [February 5, 2026 | Changelog | Alchemy Docs](#february-5-2026-changelog-alchemy-docs) - [September 25, 2025 | Changelog | Alchemy Docs](#september-25-2025-changelog-alchemy-docs) - [How EIP-7702 Works | Alchemy Docs](#how-eip-7702-works-alchemy-docs) - [App Integration | Alchemy Docs](#app-integration-alchemy-docs) - [Alchemy MCP Server | Alchemy Docs](#alchemy-mcp-server-alchemy-docs) - [Alchemy Subgraphs Deprecation Notice | Alchemy Docs](#alchemy-subgraphs-deprecation-notice-alchemy-docs) - [Alchemy Sandbox | Alchemy Docs](#alchemy-sandbox-alchemy-docs) - [Request Logs | Alchemy Docs](#request-logs-alchemy-docs) - [Set Up Alchemy with any Library via AI | Alchemy Docs](#set-up-alchemy-with-any-library-via-ai-alchemy-docs) - [What is a 51% attack? | Alchemy Docs](#what-is-a-51-attack-alchemy-docs) - [Add Alchemy RPC To Any Project using Cursor | Alchemy Docs](#add-alchemy-rpc-to-any-project-using-cursor-alchemy-docs) - [Best Practices for Key Security and Management | Alchemy Docs](#best-practices-for-key-security-and-management-alchemy-docs) - [Best Practices for Deploying a Smart Contract on EVM Mainnets | Alchemy Docs](#best-practices-for-deploying-a-smart-contract-on-evm-mainnets-alchemy-docs) - [Asset Changes - Explained | Alchemy Docs](#asset-changes-explained-alchemy-docs) - [Building a MetaMask Snap from scratch | Alchemy Docs](#building-a-metamask-snap-from-scratch-alchemy-docs) - [What is the Bitcoin genesis block? | Alchemy Docs](#what-is-the-bitcoin-genesis-block-alchemy-docs) - [Blockchain Basics | Alchemy Docs](#blockchain-basics-alchemy-docs) - [Best Practices When Using Alchemy | Alchemy Docs](#best-practices-when-using-alchemy-alchemy-docs) - [Blockchain 101 | Alchemy Docs](#blockchain-101-alchemy-docs) - [MEV Protection | Alchemy Docs](#mev-protection-alchemy-docs) - [Compute Units | Alchemy Docs](#compute-units-alchemy-docs) - [Compute Unit Costs | Alchemy Docs](#compute-unit-costs-alchemy-docs) - [Dashboard Roles | Alchemy Docs](#dashboard-roles-alchemy-docs) - [Dashboard Tools Quickstart | Alchemy Docs](#dashboard-tools-quickstart-alchemy-docs) - [Dashboard Alerts | Alchemy Docs](#dashboard-alerts-alchemy-docs) - [Dashboard SSO | Alchemy Docs](#dashboard-sso-alchemy-docs) - [Unknown](#unknown) - [Supported Chains | Alchemy Docs](#supported-chains-alchemy-docs) - [Feature Support By Chain | Alchemy Docs](#feature-support-by-chain-alchemy-docs) - [Understanding the Transaction Object on Ethereum | Alchemy Docs](#understanding-the-transaction-object-on-ethereum-alchemy-docs) - [alchemy_simulateAssetChanges | Alchemy Docs](#alchemy-simulateassetchanges-alchemy-docs) - [Choosing a Web3 Network | Alchemy Docs](#choosing-a-web3-network-alchemy-docs) - [Custom Webhooks GraphQL Examples | Alchemy Docs](#custom-webhooks-graphql-examples-alchemy-docs) - [How to Handle Checksum Addresses | Alchemy Docs](#how-to-handle-checksum-addresses-alchemy-docs) - [Gas Limits | Alchemy Docs](#gas-limits-alchemy-docs) - [How to Implement Retries | Alchemy Docs](#how-to-implement-retries-alchemy-docs) - [Add and remove webhook addresses | Alchemy Docs](#add-and-remove-webhook-addresses-alchemy-docs) - [Debugging CORS problems for End-Users | Alchemy Docs](#debugging-cors-problems-for-end-users-alchemy-docs) - [trace_get | Alchemy Docs](#trace-get-alchemy-docs) - [Best Practices for Using WebSockets in Web3 | Alchemy Docs](#best-practices-for-using-websockets-in-web3-alchemy-docs) - [Best Practices | Alchemy Docs](#best-practices-alchemy-docs) - [Understanding Transactions | Alchemy Docs](#understanding-transactions-alchemy-docs) - [alchemy_simulateAssetChangesBundle | Alchemy Docs](#alchemy-simulateassetchangesbundle-alchemy-docs) - [trace_call | Alchemy Docs](#trace-call-alchemy-docs) - [alchemy_simulateExecution | Alchemy Docs](#alchemy-simulateexecution-alchemy-docs) - [How to set usage limits for your account | Alchemy Docs](#how-to-set-usage-limits-for-your-account-alchemy-docs) - [trace_block | Alchemy Docs](#trace-block-alchemy-docs) - [Error Reference | Alchemy Docs](#error-reference-alchemy-docs) - [trace_call vs debug_traceCall | Alchemy Docs](#trace-call-vs-debug-tracecall-alchemy-docs) - [Custom Webhook Filters | Alchemy Docs](#custom-webhook-filters-alchemy-docs) - [On-chain Events | Alchemy Docs](#on-chain-events-alchemy-docs) - [How to Get a Contract's First Transfer Event | Alchemy Docs](#how-to-get-a-contract-s-first-transfer-event-alchemy-docs) - [How to Check the Status of a Transaction using its Hash | Alchemy Docs](#how-to-check-the-status-of-a-transaction-using-its-hash-alchemy-docs) - [Sending Transactions | Alchemy Docs](#sending-transactions-alchemy-docs) - [Ethereum Transactions - Pending, Mined, Dropped & Replaced | Alchemy Docs](#ethereum-transactions-pending-mined-dropped-replaced-alchemy-docs) - [How to Query Transaction Details on Ethereum | Alchemy Docs](#how-to-query-transaction-details-on-ethereum-alchemy-docs) - [Subscription API Endpoints | Alchemy Docs](#subscription-api-endpoints-alchemy-docs) - [Transaction Simulation | Alchemy Docs](#transaction-simulation-alchemy-docs) - [How to Add Allowlists to Your Apps for Enhanced Security | Alchemy Docs](#how-to-add-allowlists-to-your-apps-for-enhanced-security-alchemy-docs) - [How to Get the Number of Transactions in a Block | Alchemy Docs](#how-to-get-the-number-of-transactions-in-a-block-alchemy-docs) - [Debug API Quickstart | Alchemy Docs](#debug-api-quickstart-alchemy-docs) - [How to Enable Compression to Speed Up JSON-RPC Blockchain Requests | Alchemy Docs](#how-to-enable-compression-to-speed-up-json-rpc-blockchain-requests-alchemy-docs) - [API Reference Overview | Alchemy Docs](#api-reference-overview-alchemy-docs) - [What are EVM Traces? | Alchemy Docs](#what-are-evm-traces-alchemy-docs) - [How to Get Transaction History for an Address on Ethereum | Alchemy Docs](#how-to-get-transaction-history-for-an-address-on-ethereum-alchemy-docs) - [How to Get a Contract's Last Transfer Event | Alchemy Docs](#how-to-get-a-contract-s-last-transfer-event-alchemy-docs) - [How to Get All the Contracts Deployed by a Wallet | Alchemy Docs](#how-to-get-all-the-contracts-deployed-by-a-wallet-alchemy-docs) - [How to Get Contract Deployment Transactions in a Block | Alchemy Docs](#how-to-get-contract-deployment-transactions-in-a-block-alchemy-docs) - [Batch Requests | Alchemy Docs](#batch-requests-alchemy-docs) - [Trace API vs. Debug API | Alchemy Docs](#trace-api-vs-debug-api-alchemy-docs) - [Yellowstone gRPC Quickstart | Alchemy Docs](#yellowstone-grpc-quickstart-alchemy-docs) - [Subscribe to Slots | Alchemy Docs](#subscribe-to-slots-alchemy-docs) - [newPendingTransactions | Alchemy Docs](#newpendingtransactions-alchemy-docs) - [Subscribe to Accounts | Alchemy Docs](#subscribe-to-accounts-alchemy-docs) - [Subscribe Request | Alchemy Docs](#subscribe-request-alchemy-docs) - [Subscribe to Transactions | Alchemy Docs](#subscribe-to-transactions-alchemy-docs) - [Subscribe to Blocks | Alchemy Docs](#subscribe-to-blocks-alchemy-docs) - [newHeads | Alchemy Docs](#newheads-alchemy-docs) - [monadNewHeads | Alchemy Docs](#monadnewheads-alchemy-docs) - [What is trace_filter? | Alchemy Docs](#what-is-trace-filter-alchemy-docs) - [What is trace_transaction? | Alchemy Docs](#what-is-trace-transaction-alchemy-docs) - [trace_replayTransaction | Alchemy Docs](#trace-replaytransaction-alchemy-docs) - [trace_rawTransaction | Alchemy Docs](#trace-rawtransaction-alchemy-docs) - [trace_filter | Alchemy Docs](#trace-filter-alchemy-docs) - [trace_replayBlockTransactions | Alchemy Docs](#trace-replayblocktransactions-alchemy-docs) - [trace_transaction | Alchemy Docs](#trace-transaction-alchemy-docs) - [logs | Alchemy Docs](#logs-alchemy-docs) - [debug_traceBlockByNumber | Alchemy Docs](#debug-traceblockbynumber-alchemy-docs) - [What is trace_block? | Alchemy Docs](#what-is-trace-block-alchemy-docs) - [monadLogs | Alchemy Docs](#monadlogs-alchemy-docs) - [alchemy_minedTransactions | Alchemy Docs](#alchemy-minedtransactions-alchemy-docs) - [debug_getRawBlock | Alchemy Docs](#debug-getrawblock-alchemy-docs) - [debug_traceBlockByHash | Alchemy Docs](#debug-traceblockbyhash-alchemy-docs) - [debug_traceCall | Alchemy Docs](#debug-tracecall-alchemy-docs) - [alchemy_pendingTransactions | Alchemy Docs](#alchemy-pendingtransactions-alchemy-docs) - [debug_traceTransaction | Alchemy Docs](#debug-tracetransaction-alchemy-docs) - [How to Create Access Keys | Alchemy Docs](#how-to-create-access-keys-alchemy-docs) - [Integrating Simulation with 1 line of code | Alchemy Docs](#integrating-simulation-with-1-line-of-code-alchemy-docs) - [How to simulate a transaction on Ethereum | Alchemy Docs](#how-to-simulate-a-transaction-on-ethereum-alchemy-docs) - [How To Use JWTs For API Requests | Alchemy Docs](#how-to-use-jwts-for-api-requests-alchemy-docs) - [How To Make HTTP Header-Based API Requests | Alchemy Docs](#how-to-make-http-header-based-api-requests-alchemy-docs) - [How to Send Transactions on Ethereum | Alchemy Docs](#how-to-send-transactions-on-ethereum-alchemy-docs) - [How to Get On-chain Events on Ethereum | Alchemy Docs](#how-to-get-on-chain-events-on-ethereum-alchemy-docs) - [Understanding Logs: Deep Dive into eth_getLogs | Alchemy Docs](#understanding-logs-deep-dive-into-eth-getlogs-alchemy-docs) - [Code Examples | Alchemy Docs](#code-examples-alchemy-docs) - [How to Get the Latest Block on Ethereum | Alchemy Docs](#how-to-get-the-latest-block-on-ethereum-alchemy-docs) - [eth_subscribe | Alchemy Docs](#eth-subscribe-alchemy-docs) - [eth_subscribe | Alchemy Docs](#eth-subscribe-alchemy-docs) - [debug_getRawHeader | Alchemy Docs](#debug-getrawheader-alchemy-docs) - [debug_getRawReceipts | Alchemy Docs](#debug-getrawreceipts-alchemy-docs) - [What are Uncle Blocks? | Alchemy Docs](#what-are-uncle-blocks-alchemy-docs) - [How to Subscribe to Pending Transactions via WebSocket Endpoints | Alchemy Docs](#how-to-subscribe-to-pending-transactions-via-websocket-endpoints-alchemy-docs) - [What is Archive Data on Ethereum? | Alchemy Docs](#what-is-archive-data-on-ethereum-alchemy-docs) - [How to Calculate Ethereum Miner Rewards | Alchemy Docs](#how-to-calculate-ethereum-miner-rewards-alchemy-docs) - [Internal Playbook: Upgrading Ethereum Nodes | Alchemy Docs](#internal-playbook-upgrading-ethereum-nodes-alchemy-docs) - [How to Subscribe to Mined Transactions via WebSocket Endpoints | Alchemy Docs](#how-to-subscribe-to-mined-transactions-via-websocket-endpoints-alchemy-docs) - [Worldchain | Alchemy Docs](#worldchain-alchemy-docs) - [Aptos | Alchemy Docs](#aptos-alchemy-docs) - [Shape | Alchemy Docs](#shape-alchemy-docs) - [Avalanche | Alchemy Docs](#avalanche-alchemy-docs) - [Ink | Alchemy Docs](#ink-alchemy-docs) - [Soneium | Alchemy Docs](#soneium-alchemy-docs) - [Unichain | Alchemy Docs](#unichain-alchemy-docs) --- # Alchemy Documentation - Build anything onchain Build anything onchain ---------------------- [Node\ \ Build and scale your app on the most powerful web3 development platform.](https://www.alchemy.com/docs/node) [Data\ \ Access complete blockchain data through one unified API that grows with you.](https://www.alchemy.com/docs/data) [Wallets\ \ Onboard users with secure, easy-to-use, wallets. No seed phrase or gas required.](https://www.alchemy.com/docs/wallets) [Rollups\ \ Launch a custom rollup with native developer tools and scale to millions.](https://www.alchemy.com/docs/rollups) Query the blockchain instantly ------------------------------ RequestEthereumeth\_getBlockByNumber RUN curl -X POST https://eth-mainnet.g.alchemy.com/v2/{apiKey} \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": [ "0x68b3", false ], "id": 1}' Quickstart Guides for 500+ endpoints on 80+ networks [Get started](https://www.alchemy.com/docs/alchemy-quickstart-guide)   Build anything onchain ---------------------- Blockchain basics Get started by learning how to connect your app to Ethereum using Alchemy’s JSON-RPC API. [Get started](https://www.alchemy.com/docs/reference/ethereum-api-quickstart) Onboard people seamlessly Create a Next.js app with embedded smart wallets, social login, and gas-less transactions in minutes. [Start tutorial](https://www.alchemy.com/docs/wallets/react/installation) Real-time notifications via webhooks Receive fast and reliable HTTP POST requests for onchain events across 80+ chains. No polling required. [View quickstart](https://www.alchemy.com/docs/reference/notify-api-quickstart) Authentication made easy Add authentication and embedded smart wallets to your existing React project. [Start tutorial](https://www.alchemy.com/docs/wallets/react/quickstart/existing-project) Onchain events subscriptions Learn to subscribe to pending transactions, log events, new blocks and more using WebSockets across chains. [View quickstart](https://www.alchemy.com/docs/reference/subscription-api) Upgrade to EIP-7702 Enable existing EOAs to benefit from batching actions, sponsoring transactions, and more. [Learn more](https://www.alchemy.com/docs/wallets/react/using-7702) --- # Node API Overview | Alchemy Docs Copy page Node API Overview ================= Low-level, chain-agnostic access to blockchains The **Node API** is our implementation of the standard JSON-RPC interface (as defined by Ethereum) and compatible equivalents for non-EVM chains (e.g., Solana, Bitcoin). Use it when you want direct, low-level reads and writes against a blockchain. > Looking for higher-level building blocks? For indexed, enriched queries use the **[Data APIs](https://www.alchemy.com/docs/reference/data-overview) > **. For account-abstraction and smart-wallet flows use the **[Wallet APIs](https://www.alchemy.com/docs/wallets) > **. TL;DR ----- * We support multiple chains. Most use the **same EVM JSON-RPC methods**; a few have **chain-specific methods**. * You can browse each chain's RPC, quirks, and connection details in **[Chains](https://www.alchemy.com/docs/reference/chain-apis-overview) **. * We also offer **additional products** that sit alongside core RPC: **WebSockets**, **Yellowstone gRPC**, and **Trace/Debug** with **varying chain support**. * * * Chain APIs ========== Chain APIs are the per-chain RPC surfaces exposed through the Node API. * **EVM chains:** Share the standard `eth_*` interface (e.g., `eth_call`, `eth_getLogs`, `eth_sendRawTransaction`). * **Non-EVM chains:** Provide compatible JSON-RPC or equivalent endpoints, plus **special methods** where the protocol differs. 👉 Head to **[Chains](https://www.alchemy.com/docs/reference/chain-apis-overview) ** for: * Full method lists and examples per chain * Endpoint URLs and connection details * Notes on chain-specific behavior and limits * * * Additional Products =================== Use these alongside the Node API for streaming, performance, and deeper inspection. Chain coverage varies: check each page for supported networks. [WebSockets\ \ Subscribe to pending transactions, log events, new blocks, and more.](https://www.alchemy.com/docs/reference/subscription-api) [Trace API\ \ Get insights into transaction processing and onchain activity.](https://www.alchemy.com/docs/reference/transfers-api-quickstart) [Debug API\ \ Non-standard RPC methods for inspecting and debugging transactions.](https://www.alchemy.com/docs/reference/debug-api-quickstart) [Yellowstone gRPC\ \ High-performance real-time Solana data streaming interface.](https://www.alchemy.com/docs/reference/yellowstone-grpc-overview) * * * When to use the Node API ======================== Use the Node API when you need the **raw, low-level interface** to: * Send and simulate transactions * Read onchain state (balances, storage, view calls) * Filter/poll logs and events * Build tools close to node-level logic > For enriched, historical, or cross-entity queries, prefer **[Data APIs](https://www.alchemy.com/docs/reference/data-overview) > **. For smart account flows, prefer **[Wallet APIs](https://www.alchemy.com/docs/wallets) > **. Was this page helpful? YesNo --- # Alchemy Rollups Overview | Alchemy Docs Copy page Alchemy Rollups Overview ======================== Introduction to Alchemy Rollups: deploy a rollup in minutes, no code required, using our all-in-one infrastructure. Intro ===== Alchemy Rollups helps you run a dedicated rollup with full control over transaction speed, cost, and functionality. Alchemy Rollups supports both Optimistic Rollups and Zero-Knowledge (ZK) Rollups. Before diving in, it's important to understand what rollups are and the two primary types available: What is a Rollup? ================= A rollup is a blockchain solution that processes transactions off the main chain while using a Layer-1 blockchain for security. Instead of processing each transaction on the main chain, rollups batch transactions together and post a summary or proof to the Layer-1 network. This approach reduces fees and increases throughput while maintaining the security of the main chain. Optimistic vs. ZK Rollups ------------------------- **Optimistic Rollups:** * Assume transactions are valid by default. * Use a challenge period to allow for fraud proofs in case of invalid transactions. * Typically have a delay for finality due to the challenge period. * Provide strong security guarantees through economic incentives. **Zero-Knowledge (ZK) Rollups:** * Generate a cryptographic proof for each batch of transactions. * Allow for near-instant finality since there’s no challenge period. * Offer even greater scalability by reducing the amount of data posted to Layer-1. * Can be more complex to implement due to the proof generation process. **Launching a rollup helps you make more money by unlocking new revenue streams, enabling novel use cases, and providing a better user experience.** Why a Rollup? ============= ### 🚄 Faster, More Reliable Transactions * **Speed & Predictability:** With a dedicated chain, transactions are processed quickly and reliably. Unlike crowded public networks that can lead to slow confirmations, rising fees, and unpredictable processing times, your own rollup ensures a smoother experience. ### 🆕 Unlock Novel Use Cases * **Tailored Functionality:** When you control your chain, you can customize its behavior to suit your specific needs. This flexibility enables innovative integrations—like linking on-chain identities with external verification systems—to power entirely new applications. ### 💸 Make Money * **Revenue Streams:** Operators earn revenue from transaction fees and potential MEV opportunities. Additionally, by using a native gas token on your chain, you can create intrinsic value and boost your token’s utility. ### ✂️ Save Money * **Cost Efficiency:** Running your own dedicated blockspace can dramatically lower gas fees. Instead of competing with high fees on popular L1s or shared L2s, you can optimize costs for both you and your users. Why Alchemy Rollups? -------------------- **TLDR:** Alchemy is your best partner for scaling to millions, reducing technical and financial risk through integrated developer tools and built-in distribution. ### For Everyone * **Integrated Developer Tools:** Ship products faster with instant RPCs, APIs, and wallets. Save months of engineering time and bypass lengthy business development cycles. * **Reliability:** Enjoy a platform with 99.99% uptime, protecting you from revenue loss and reducing engineering overhead. ### For Ecosystem Chains * **Instant Access to Developers:** Gain immediate reach to a vast network of developers, from independent projects to major protocols, ensuring your chain is noticed from Day 1. ### For Enterprises * **White-Glove Customization & Support:** Benefit from deep technical onboarding, customized solutions (such as alternative data availability layers or unique precompiles), and 24/7 support from our experienced engineering team. With Alchemy Rollups, you gain a partner who not only provides the technology to launch your own chain but also helps you unlock new opportunities—whether through cost savings, new revenue models, or innovative use cases. Supported Frameworks ==================== [![Arbitrum Chain logo](https://alchemyapi-res.cloudinary.com/image/upload/v1764179954/docs/api-reference/alchemy-rollups/api_icon3.svg)\ \ Arbitrum Chain\ \ View Arbitrum Stack rollup framework.](https://www.alchemy.com/docs/reference/supported-stacks) [![OP Stack logo](https://alchemyapi-res.cloudinary.com/image/upload/v1764179956/docs/api-reference/alchemy-rollups/api_icon4.svg)\ \ OP Stack\ \ View OP Stack rollup framework.](https://www.alchemy.com/docs/reference/supported-stacks) [![zkSync logo](https://alchemyapi-res.cloudinary.com/image/upload/v1752688923/docs/zk-sync_tllxmx.svg)\ \ ZKSync Stack\ \ View ZKSync Stack rollup framework.](https://www.alchemy.com/docs/reference/supported-stacks) Looking for an enterprise-grade chain? ====================================== Get in touch with us directly: Reach out through the [Rollups Contact Page](https://www.alchemy.com/contact-sales-rollups) , email Isaac at [\[email protected\]](https://www.alchemy.com/cdn-cgi/l/email-protection#0c657f6d6d6f4c6d606f64696175226f6361) , or message him on Telegram: @pileofscraps Was this page helpful? YesNo --- # Choose Your Starting Point | Alchemy Docs Copy page Choose Your Starting Point ========================== Overview of our product offerings [Node API\ \ Low-level JSON-RPC for reading & writing blockchain data.](https://www.alchemy.com/docs/reference/node-api-overview) [Data APIs\ \ Structured, indexed data for balances, NFTs, prices, and more.](https://www.alchemy.com/docs/reference/data-overview) [Wallet APIs\ \ Account abstraction infrastructure for smart wallets.](https://www.alchemy.com/docs/wallets) [Rollups\ \ Launch dedicated rollups with full control over your L2.](https://www.alchemy.com/docs/reference/rollups-quickstart) Don't have an API key? Build faster with production-ready APIs, smart wallets and rollup infrastructure across 70+ chains. Create your free Alchemy API key and [get started today](https://dashboard.alchemy.com/signup) . * * * 1\. Node API ------------ The [Node API](https://www.alchemy.com/docs/reference/node-api-overview) gives you low-level access to standard JSON-RPC methods for interacting with blockchains. Use it for sending transactions, querying blocks and logs, and accessing state. It supports multiple chains; see the [Chain APIs Overview](https://www.alchemy.com/docs/reference/chain-apis-overview) page for the full list. [Chain APIs\ \ Read & write interface for all blockchains supported by us.](https://www.alchemy.com/docs/chains) [WebSockets\ \ Subscribe to pending transactions, log events, new blocks, and more.](https://www.alchemy.com/docs/reference/subscription-api) [Trace API\ \ Get insights into transaction processing and onchain activity.](https://www.alchemy.com/docs/reference/trace-api-quickstart) [Debug API\ \ Non-standard RPC methods for inspecting and debugging transactions.](https://www.alchemy.com/docs/reference/debug-api-quickstart) [Yellowstone gRPC\ \ High-performance real-time Solana data streaming interface.](https://www.alchemy.com/docs/reference/yellowstone-grpc-overview) * * * 2\. Data APIs ------------- The [Data APIs](https://www.alchemy.com/docs/reference/data-overview) provide structured, indexed data that would be difficult to get via RPC alone. Use it for NFT metadata, token balances, transaction histories, enriched transfers, and analytics. Optimized for high-volume reads, dashboards, and data-heavy applications. [Portfolio API\ \ Build a complete portfolio view of a user's wallet across tokens and NFTs.](https://www.alchemy.com/docs/reference/portfolio-apis) [Transfers API\ \ Get historical transactions for any address in a single request.](https://www.alchemy.com/docs/reference/transfers-api-quickstart) [Prices API\ \ Access real-time and historical token prices.](https://www.alchemy.com/docs/reference/prices-api-quickstart) [NFT API\ \ Find, verify, and display NFTs across major blockchains.](https://www.alchemy.com/docs/reference/nft-api-quickstart) [Webhooks\ \ Subscribe to on-chain events like transfers, transactions, and balance changes.](https://www.alchemy.com/docs/reference/notify-api-quickstart) [Simulation API\ \ Simulate transactions and see their effects before you send them.](https://www.alchemy.com/docs/reference/simulation) * * * 3\. Wallet APIs / Account Abstraction Infrastructure ---------------------------------------------------- Our [Smart Wallets](https://www.alchemy.com/docs/wallets) product gives you everything you need to build zero-friction user flows, from sign-up to checkout, using smart contract accounts. Use these APIs to handle user operations, sponsor gas, and implement smart accounts with account abstraction. [Bundler\ \ Bundler API Quickstart for handling user operations.](https://www.alchemy.com/docs/reference/bundler-api-quickstart) [Gas Manager\ \ Gas Manager API Quickstart for sponsoring gas fees.](https://www.alchemy.com/docs/reference/how-to-sponsor-gas-on-evm) [Account Kit\ \ Account Kit Quickstart for implementing smart accounts.](https://accountkit.alchemy.com/react/quickstart) * * * 4\. Rollups ----------- Our [Rollups](https://www.alchemy.com/docs/reference/rollups-quickstart) product helps you run a dedicated rollup with full control over transaction speed, cost, and functionality. Launching a rollup can unlock new revenue streams, enable novel use cases, and provide a better user experience. [![Arbitrum Chain logo](https://alchemyapi-res.cloudinary.com/image/upload/v1764179954/docs/api-reference/alchemy-rollups/api_icon3.svg)\ \ Arbitrum Chain\ \ View the Arbitrum Stack rollup framework.](https://www.alchemy.com/docs/reference/supported-stacks) [![OP Stack logo](https://alchemyapi-res.cloudinary.com/image/upload/v1764179956/docs/api-reference/alchemy-rollups/api_icon4.svg)\ \ OP Stack\ \ View the OP Stack rollup framework.](https://www.alchemy.com/docs/reference/supported-stacks) [![zkSync logo](https://alchemyapi-res.cloudinary.com/image/upload/v1752688923/docs/zk-sync_tllxmx.svg)\ \ ZKSync Stack\ \ View the ZKSync Stack rollup framework.](https://www.alchemy.com/docs/reference/supported-stacks) Was this page helpful? YesNo --- # Data APIs Overview | Alchemy Docs Copy page Data APIs Overview ================== Use Alchemy Data to build and scale your business The Data APIs give you fast, reliable access to blockchain data without running your own indexing infrastructure. Whether you're building wallets, NFT platforms, analytics dashboards, or DeFi apps, the Data APIs save you time and engineering costs by offering pre-transformed, production-ready data. Components of the Data APIs --------------------------- [Portfolio API\ \ Build a complete portfolio view of a user’s wallet, across tokens and NFTs.](https://www.alchemy.com/docs/reference/portfolio-apis) [Token API\ \ Easily request information about specific tokens like metadata or wallet balances.](https://www.alchemy.com/docs/reference/token-api-quickstart) [Transfers API\ \ Fetch historical transactions for any address in one request.](https://www.alchemy.com/docs/reference/transfers-api-quickstart) [Prices API\ \ Access real-time and historical prices for tokens.](https://www.alchemy.com/docs/reference/prices-api-quickstart) [NFT API\ \ Instantly find, verify, and display any NFT, across all major blockchains.](https://www.alchemy.com/docs/reference/nft-api-quickstart) [Webhooks\ \ Subscribe to on-chain events like transfers, transactions, and balance changes.](https://www.alchemy.com/docs/reference/notify-api-quickstart) [Simulation API\ \ Simulate a transaction and see its potential effects before you send it.](https://www.alchemy.com/docs/reference/simulation) [Utility API\ \ Enhanced APIs to get blocks by timestamp and transaction receipts.](https://www.alchemy.com/docs/reference/utility-api-overview) * * * When Should I Use the Data APIs? -------------------------------- Use the Data APIs if: * You need pre-indexed blockchain data without running your own nodes or infrastructure. * You want to read user portfolios, token balances, transfer history, or NFT data. * You're sending transactions and **not** using Alchemy's Smart Wallets. * If you are using our wallets, check out the Wallet APIs, which supports: * `sendUserOp` * `estimateUserOpGas` * and more account abstraction features * You want to simulate or estimate transaction outcomes before sending them. * You need to track wallet or contract activity with push notifications via Webhooks. * * * Data APIs Use Cases ------------------- ### 1\. Developer Tooling & Debugging Perfect for advanced dev environments, simulation dashboards, and infra teams. * Use endpoints like: * `debug_traceTransaction` * `debug_getRawTrace` ### 2\. Help Users _Write_ Transactions Ideal for apps that generate transactions on behalf of users. **Common use cases:** * ERC-20 swaps * NFT purchases and listings * Wallets that send tokens or interact with contracts * Portfolio apps that need to simulate or batch transactions ### 3\. Help Users _Read_ Transactions **Common use cases:** * Wallets and portfolio trackers * Token/NFT ownership queries * Historical transfers and analytics dashboards * Price feeds and on-chain trends * Pre-indexed data to power all your frontend and backend logic * Use endpoints like: * `getNftsForOwner` - Retrieves all NFTs currently owned by a specified address. * `alchemy_getTokenBalances` - Returns ERC-20 token balances for a given address. * `alchemy_getAssetTransfers` - Fetches historical transactions for any address across Ethereum and supported L2s including Polygon, Arbitrum, and Optimism. * * * Summary ------- The Data APIs are specifically meant to do the heavy lifting so that you can focus on your product needs. We are not just the data provider, but also the infra layer behind the biggest names in web3. Alchemy is set apart by: * **Battle-tested scale**: powering millions of wallets, swaps, and NFT marketplaces — from Fortune 500s to weekend and hackathon builders. * **Multi-chain support**: Ethereum, Base, Polygon, Arbitrum, Optimism, and dozens of other chains supported out of the box. * * * Quick Reference --------------- ### Token, NFT, and Prices APIs [Token API\ \ **Ideal for:** Multi-chain token experiences, balance indexing\ \ **How it works:** Simply call an API to return multi-chain and complete token data](https://www.alchemy.com/docs/reference/token-api-quickstart) [NFT API\ \ **Ideal for:** NFT drops, token gating, analytics, wallets, marketplaces\ \ **How it works:** Simply call an API to return multi-chain and complete NFT data](https://www.alchemy.com/docs/reference/nft-api-quickstart) [Prices API\ \ **Ideal for:** Multi-chain token experiences, trading apps, wallets\ \ **How it works:** Simply call an API to return multi-chain and complete token prices data](https://www.alchemy.com/docs/reference/prices-api-quickstart) ### Webhooks [Webhooks\ \ **Ideal for:** Push notifications, wallets, consumer facing apps\ \ **How it works:** Define your Webhook and start receiving relevant events](https://www.alchemy.com/docs/reference/notify-api-quickstart) [Custom Webhooks\ \ **Ideal for:** Infinite customization, specific data needs, multi-chain apps\ \ **How it works:** Customize your event to your exact needs and immediately receive them](https://www.alchemy.com/docs/reference/custom-webhooks-quickstart) Was this page helpful? YesNo --- # Unknown \--- title: The Alchemy Developer Hub description: Learn how to use Node APIs, Data APIs, Webhooks, Smart Wallets and Rollups to create powerful onchain experiences. --- ## Docs - \[Choose Your Starting Point\](https://alchemy.com/docs/get-started.mdx): Overview of our product offerings - \[Alchemy Quickstart Guide\](https://alchemy.com/docs/alchemy-quickstart-guide.mdx): Quickstart guide to Alchemy! Learn how to create an Alchemy key, make your first request, setup up Alchemy as your client, and get to building! - \[Create an Alchemy API Key\](https://alchemy.com/docs/create-an-api-key.mdx): Learn how to create an Alchemy API Key. - \[Make Your First Alchemy Request\](https://alchemy.com/docs/make-your-first-request.mdx): Learn how to send a blockchain request using Alchemy. - \[Set up Alchemy with Viem\](https://alchemy.com/docs/set-up-alchemy-with-viem.mdx): Learn how to send a blockchain request via a script using Alchemy. - \[Set Up Alchemy with any Library via AI\](https://alchemy.com/docs/alchemy-via-libraries.mdx): Use AI tools to kickoff your Alchemy journey - \[Pricing Plans\](https://alchemy.com/docs/reference/pricing-plans.mdx): A guide to understand Alchemy's pricing plans. - \[Compute Units\](https://alchemy.com/docs/reference/compute-units.mdx): The explanation for what Compute Units are and how we use them. - \[Compute Unit Costs\](https://alchemy.com/docs/reference/compute-unit-costs.mdx): A breakdown of Alchemy's compute unit costs per method, chain, and product. - \[Pay As You Go Pricing FAQ\](https://alchemy.com/docs/reference/pay-as-you-go-pricing-faq.mdx): Pay As You Go Pricing FAQ Our goal is to accelerate development onchain by providing the most developer-friendly web3 infrastructure pricing. We firmly believe that costs shouldn't be a barrier to building innovative apps onchain. We've worked hard to optimize our infrastructure to reduce our costs,... - \[Feature Support By Chain\](https://alchemy.com/docs/reference/feature-support-by-chain.mdx): Alchemy's current feature availability for each of its supported chains - \[Throughput\](https://alchemy.com/docs/reference/throughput.mdx): Understand how throughput works on Alchemy and how to handle 429 errors. - \[Batch Requests\](https://alchemy.com/docs/reference/batch-requests.mdx): Best practices for making batch json-rpc requests on Ethereum, Polygon, Optimism, and Arbitrum. - \[Gas Limits\](https://alchemy.com/docs/reference/gas-limits-for-eth\_call-and-eth\_estimategas.mdx): A breakdown of the gas cap limits for eth\_call and eth\_estimateGas on Ethereum, Polygon, Arbitrum, and Optimism. - \[Error Reference\](https://alchemy.com/docs/reference/error-reference.mdx): Learn about the standard JSON-RPC error codes and Alchemy's custom error codes. - \[AI-powered IDEs\](https://alchemy.com/docs/tutorials/build-with-ai/ai-powered-id-es.mdx) - \[Add Alchemy RPC To Any Project using Cursor\](https://alchemy.com/docs/add-alchemy-rpc-to-any-project.mdx): Learn how to add a server-safe Alchemy JSON RPC endpoint to any project using Cursor - \[Web3 Dashboard with Cursor\](https://alchemy.com/docs/web3-dashboard-prompt.mdx): Learn how to build a Web3 dashboard using Cursor's AI capabilities - \[Alchemy Data APIs Explained using Cursor\](https://alchemy.com/docs/data-apis-with-cursor.mdx): Learn how to use Alchemy's Data APIs step-by-step in Cursor, from low-level primitives to high-level abstractions. - \[Alchemy MCP Server\](https://alchemy.com/docs/alchemy-mcp-server.mdx): Get started with the Alchemy Model Context Protocol (MCP) server. - \[Dashboard Tools Quickstart\](https://alchemy.com/docs/dashboard-tools-quickstart.mdx): Guide to show the tools available on the Alchemy Dashboard - \[Alchemy Sandbox\](https://alchemy.com/docs/alchemy-sandbox.mdx): Guide on setting up a request on the Alchemy Sandbox to simulate your app behavior and data requests - \[Dashboard Alerts\](https://alchemy.com/docs/dashboard-alerts.mdx): Guide on setting up and managing dashboard alerts to monitor your app behavior and usage - \[Request Logs\](https://alchemy.com/docs/alchemy-request-logs.mdx): Guide on interacting with request logs on Alchemy's dashboard - \[Dashboard Roles\](https://alchemy.com/docs/dashboard-roles.mdx): Guide to explain the roles available on the Alchemy Dashboard - \[Dashboard SSO\](https://alchemy.com/docs/dashboard-sso.mdx): Guide to explain the Single Sign-On (SSO) available on the Alchemy Dashboard - \[Understanding Transactions\](https://alchemy.com/docs/understanding-transactions.mdx): Articles about transactions - \[Ethereum Transactions - Pending, Mined, Dropped & Replaced\](https://alchemy.com/docs/ethereum-transactions-pending-mined-dropped-replaced.mdx): Explanation for different transaction states on Ethereum and other blockchains and how to handle each state to ensure your transaction gets mined in time. - \[How to Query Transaction Details on Ethereum\](https://alchemy.com/docs/how-to-get-transaction-details.mdx): Learn how to get general information about a transaction using the eth\_getTransactionReceipt method. - \[Understanding the Transaction Object on Ethereum\](https://alchemy.com/docs/understanding-the-transaction-object-on-ethereum.mdx): This guide details each element in the response of the Transaction object returned by eth\_getTransactionByHash - \[What are Internal Transactions?\](https://alchemy.com/docs/what-are-internal-transactions.mdx): This is an in-depth guide about Internal Transactions on Ethereum and how to retrieve them using the Alchemy Transfers API. - \[How to Handle Checksum Addresses\](https://alchemy.com/docs/how-to-handle-checksum-addresses.mdx): Learn what checksum addresses in Ethereum are, why they exist, and how to handle them using the ethers library. - \[Sending Transactions\](https://alchemy.com/docs/sending-transactions.mdx): Tutorials for sending transactions on the blockchain - \[How to Send Transactions on Ethereum\](https://alchemy.com/docs/how-to-send-transactions-on-ethereum.mdx): This is a beginner's guide for sending Ethereum transactions in web3. - \[How to Check the Status of a Transaction using its Hash\](https://alchemy.com/docs/how-to-check-the-status-of-a-transaction-using-its-hash.mdx): Learn how to check the status of a transaction using the transaction hash - \[Transaction History\](https://alchemy.com/docs/transaction-history.mdx): Tutorials for working with transaction history - \[How to Get the Number of Transactions in a Block\](https://alchemy.com/docs/how-to-get-the-number-of-transactions-in-a-block.mdx): This is a simple script to teach you how to communicate with the blockchain and read the number of transactions in a block. - \[How to Get Transaction History for an Address on Ethereum\](https://alchemy.com/docs/how-to-get-transaction-history-for-an-address-on-ethereum.mdx): Learn how to get the full transaction history for a smart contract or a user address including external, internal, token, ERC-20, ERC-721 and ERC-1155 token transfers in a single request. - \[How to Get a Contract's First Transfer Event\](https://alchemy.com/docs/how-to-get-a-contracts-first-transfer-event.mdx): Learn how to use Alchemy's SDK to query the transfer history of one or multiple smart contracts in a single request. - \[How to Get a Contract's Last Transfer Event\](https://alchemy.com/docs/how-to-get-a-contracts-last-transfer-event.mdx): Learn how to use Alchemy's SDK to query the transfer history of one or multiple smart contracts in a single request. - \[Integrating Historical Transaction Data into your dApp\](https://alchemy.com/docs/integrating-historical-transaction-data-into-your-dapp.mdx): Tutorial for integrating transaction history (using the Alchemy Transfers API) into a dApp frontend. - \[How to Get Contract Deployment Transactions in a Block\](https://alchemy.com/docs/how-to-get-contract-deployment-transactions-in-a-block.mdx): Learn how to get all the contract creation transactions from a block - \[How to Get All the Contracts Deployed by a Wallet\](https://alchemy.com/docs/how-to-get-all-the-contracts-deployed-by-a-wallet.mdx): Learn how to get all the contract addresses deployed by a given wallet address - \[On-chain Events\](https://alchemy.com/docs/on-chain-events.mdx): List of articles related to on-chain events - \[How to Get On-chain Events on Ethereum\](https://alchemy.com/docs/how-to-get-on-chain-events.mdx): Learn how to use the eth\_getLogs method to query blockchain events - \[Understanding Logs: Deep Dive into eth\_getLogs\](https://alchemy.com/docs/deep-dive-into-eth\_getlogs.mdx): This is a beginner-friendly guide into the commonly used eth\_getLogs JSON-RPC call and understanding logs on Ethereum. It discusses some key topics and goes into the complexities and usage of eth\_getLogs through an example. - \[Transaction Simulation\](https://alchemy.com/docs/transaction-simulation.mdx): Discover Alchemy's powerful Transaction Simulation APIs that provide in-depth insights into the impact of transactions on various networks before execution. - \[Integrating Simulation with 1 line of code\](https://alchemy.com/docs/integrating-simulation-with-1-line-of-code.mdx): Learn how to effortlessly integrate Alchemy's Simulation APIs in your code base using just one line of code. - \[Building a MetaMask Snap from scratch\](https://alchemy.com/docs/building-a-metamask-snap-from-scratch.mdx): Explore the process of building a MetaMask Snap from scratch that showcases the power of Alchemy's Transaction Simulation APIs. - \[Asset Changes - Explained\](https://alchemy.com/docs/asset-changes-explained.mdx): Dive into the Asset Changes API with this detailed example of simulating a transaction to swap 1 USDC for UNI using Uniswap V2. - \[How to simulate a transaction on Ethereum\](https://alchemy.com/docs/how-to-simulate-a-transaction-on-ethereum.mdx): Learn how to simulate your transactions on the Ethereum network using Alchemy's Simulation APIs - \[WebSocket Subscriptions\](https://alchemy.com/docs/websocket-subscriptions.mdx): Tutorials for working with WebSocket Subscriptions - \[How to Subscribe to Mined Transactions via WebSocket Endpoints\](https://alchemy.com/docs/how-to-subscribe-to-pending-transactions-via-websocket-endpoints.mdx): Learn how to subscribe to mined transactions via WebSockets, and view the full transactions objects or hashes mined on the network based on specified filters and block tags. - \[How to Subscribe to Pending Transactions via WebSocket Endpoints\](https://alchemy.com/docs/how-to-subscribe-to-transactions-via-websocket-endpoints.mdx): Learn how to subscribe to pending transactions via WebSockets, and filters the transactions based on specified from and/or to addresses. - \[How to Create Access Keys\](https://alchemy.com/docs/how-to-create-access-keys.mdx): Learn how to create access keys and use them to make requests to Alchemy APIs - \[How To Make HTTP Header-Based API Requests\](https://alchemy.com/docs/how-to-use-api-keys-in-http-headers.mdx): Learn how to use your Alchemy API keys in HTTP headers for enhanced security when calling blockchain APIs - \[How To Use JWTs For API Requests\](https://alchemy.com/docs/how-to-use-jwts-for-api-requests.mdx): Learn how to use JWTs ( JSON Web Tokens ) for making secure API requests with Alchemy. - \[Best Practices for Key Security and Management\](https://alchemy.com/docs/best-practices-for-key-security-and-management.mdx): Learn about the best practices for security and management of your keys. - \[How to Add Allowlists to Your Apps for Enhanced Security\](https://alchemy.com/docs/how-to-add-allowlists-to-your-apps-for-enhanced-security.mdx): Learn how to limit addresses, domains and IPs that can interact with your app for added security - \[Developer Best Practices\](https://alchemy.com/docs/developer-best-practices.mdx): List of articles related to developer best practices - \[Best Practices When Using Alchemy\](https://alchemy.com/docs/best-practices-when-using-alchemy.mdx) - \[Best Practices for Deploying a Smart Contract on EVM Mainnets\](https://alchemy.com/docs/best-practices-for-deploying-a-smart-contract-on-evm-mainnets-1.mdx): Best practices to follow when deploying your contracts to the mainnet. - \[Choosing a Web3 Network\](https://alchemy.com/docs/choosing-a-web3-network.mdx): A detailed guide to choosing which network to deploy on for Ethereum, Layer 2s and Solana. Compares Layer 1 chains vs Layer 2 chains as well as Mainnet vs Testnet environments. - \[How to Enable Compression to Speed Up JSON-RPC Blockchain Requests\](https://alchemy.com/docs/how-to-enable-compression-to-speed-up-json-rpc-blockchain-requests.mdx): Adding an 'Accept-Encoding: gzip' header to JSON-RPC requests results in roughly a 75% speedup for requests over 100kb. Use this single code change to speed up JSON-RPC requests! - \[Debugging CORS problems for End-Users\](https://alchemy.com/docs/debugging-cors-problems-for-end-users.mdx): If your users are experiencing CORS issues here's how to debug them - \[How to Implement Retries\](https://alchemy.com/docs/how-to-implement-retries.mdx): Learn how to implement retries in your code to handle errors and improve application reliability. - \[How to set usage limits for your account\](https://alchemy.com/docs/how-to-set-usage-limits-and-alerts-for-your-account.mdx): Learn to manage your Alchemy account wisely by setting usage limits ensuring you never overspend. - \[How to Get the Latest Block on Ethereum\](https://alchemy.com/docs/how-to-get-the-latest-block-on-ethereum.mdx): Don't know where to start? This guide will walk you through writing a simple web3 script to get the latest block number from the Ethereum mainnet using Alchemy. - \[What are Uncle Blocks?\](https://alchemy.com/docs/what-are-uncle-blocks.mdx): Uncle blocks are blocks that did not get mined onto the canonical chain. When two or more miners produce blocks at nearly the same time, uncle blocks are created. - \[What is Archive Data on Ethereum?\](https://alchemy.com/docs/what-is-archive-data-on-ethereum.mdx): Archive data is data on the blockchain that is older than 128 blocks, which is approximately 4 epochs or 25.6 minutes old - \[Internal Playbook: Upgrading Ethereum Nodes\](https://alchemy.com/docs/internal-playbook-upgrading-ethereum-nodes.mdx): Check out this internal playbook for why, when, and how we upgrade our Ethereum nodes for our users 🚀 - \[How to Calculate Ethereum Miner Rewards\](https://alchemy.com/docs/how-to-calculate-ethereum-miner-rewards.mdx): Tutorial on how to calculate miner rewards for a single Ethereum block - \[Worldchain\](https://alchemy.com/docs/snapshots/worldchain.mdx) - \[Avalanche\](https://alchemy.com/docs/snapshots/avalanche.mdx) - \[Aptos\](https://alchemy.com/docs/snapshots/aptos.mdx) - \[Shape\](https://alchemy.com/docs/snapshots/shape.mdx) - \[Ink\](https://alchemy.com/docs/snapshots/ink.mdx) - \[Soneium\](https://alchemy.com/docs/snapshots/soneium.mdx) - \[Unichain\](https://alchemy.com/docs/snapshots/unichain.mdx) - \[Blockchain Basics\](https://alchemy.com/docs/blockchain-basics.mdx): Blockchain basics include understanding blockchains, blockchain networks, consensus mechanisms including Proof-of-Work, and the differences between UTXO and Account Models. - \[What is a blockchain?\](https://alchemy.com/docs/what-is-a-blockchain.mdx): A blockchain is a network of computers that agree upon a common state of data. It is a decentralized system that is resistant to censorship and control. - \[What is Proof of Work?\](https://alchemy.com/docs/proof-of-work.mdx): Proof of Work is a computationally expensive challenge for computers used to control difficulty and secure a blockchain network through mining, where nodes are financially incentivized to find hashes of data. - \[What are blockchain consensus mechanisms?\](https://alchemy.com/docs/what-are-blockchain-consensus-mechanisms.mdx): Blockchain consensus mechanisms are rules that a distributed and decentralized blockchain network follows to agree on what is considered valid. - \[What does a blockchain network look like?\](https://alchemy.com/docs/what-are-blockchain-networks.mdx): A blockchain network is a distributed database with nodes worldwide achieving decentralized consensus. - \[What is a 51% attack?\](https://alchemy.com/docs/51-percent-attack.mdx): A 51% attack occurs when a miner group controls over 50% of a network, allowing them to double-spend transactions. It's costly and requires more than 51% resources. - \[What is the Bitcoin genesis block?\](https://alchemy.com/docs/bitcoin-genesis-block.mdx): The Bitcoin genesis block is the very first \\block\\ of transactions ever confirmed on the Bitcoin blockchain after launching. - \[UTXO vs. Account Models\](https://alchemy.com/docs/utxo-vs-account-models.mdx): Bitcoin uses UTXO model for user balances, Ethereum and EVM chains use account model. UTXOs are non-fungible and spent once, accounts track overall balance. - \[Web3 Glossary\](https://alchemy.com/docs/web3-glossary.mdx): All words and definitions related to Blockchain and Ethereum. - \[Blockchain 101\](https://alchemy.com/docs/blockchain-101.mdx): Blockchain basics for developer topics. - \[Cryptography Basics\](https://alchemy.com/docs/cryptography-basics.mdx): Learn the basics of cryptography including public key cryptography, hashing algorithms, and tree data structures. - \[What is Public Key Cryptography?\](https://alchemy.com/docs/public-key-cryptography.mdx): Public Key Cryptography uses a public and private key to encrypt and decrypt messages. It's also called asymmetric encryption and used in RSA and ECDSA. - \[What is a hashing algorithm?\](https://alchemy.com/docs/hashing-algorithm.mdx): A hashing algorithm reduces any input to a unique fixed-sized output. Cryptographic hashing algorithms are one-way, produce the same output for the same input, and have rare collisions. - \[How do tree data structures work?\](https://alchemy.com/docs/tree-data-structures.mdx): Tree data structures are hierarchical structures used to store and organize data. They consist of nodes, with a parent-child relationship, and can have different enforcements such as being binary or a binary search tree. - \[What are Merkle trees?\](https://alchemy.com/docs/what-are-merkle-trees.mdx): Merkle Trees are a data structure used to efficiently verify that data belongs in a larger set of data. They are commonly used in Peer to Peer networks to increase scalability. - \[How are Merkle trees used in blockchains?\](https://alchemy.com/docs/merkle-trees-in-blockchains.mdx): Merkle trees store transaction data efficiently in blockchains. The root hash is committed, reducing blockchain size. Merkle proofs verify data efficiently. They are space and computationally efficient, good for scalability and decentralization. - \[What are Patricia Merkle Tries?\](https://alchemy.com/docs/patricia-merkle-tries.mdx): Patricia Merkle Tries combine a radix trie with a Merkle tree to store key-value pairs and verify data integrity, ideal for editing and storing ephemeral data. - \[Ethereum Basics\](https://alchemy.com/docs/ethereum-basics.mdx): Learn the basics of Ethereum including Proof-of-Stake, gas, accounts, nodes, transactions, frontend libraries, and how to access data with JSON-RPC. - \[What is Ethereum?\](https://alchemy.com/docs/what-is-ethereum.mdx): Ethereum is a decentralized blockchain platform that enables the creation of smart contracts and decentralized applications (dApps) using its native cryptocurrency, Ether (ETH). - \[What is Proof of Stake?\](https://alchemy.com/docs/what-is-proof-of-stake.mdx): Proof of Stake in Ethereum requires validators to stake 32ETH instead of mining with electricity, resulting in a secure, scalable, and energy-efficient network. Block finality should be considered when requesting data. - \[How does Ethereum gas work?\](https://alchemy.com/docs/ethereum-gas.mdx): Ethereum gas is the cost of executing operations. Demand determines the price, with a base fee to incentivize transactions. The fee is burned, and miners receive tips. - \[What are Ethereum Accounts?\](https://alchemy.com/docs/ethereum-accounts.mdx): Ethereum has two types of accounts: externally owned accounts (EOAs) and contract accounts. EOAs are like Bitcoin key pairs, while contract accounts are for smart contracts. - \[How to Read Data with JSON-RPC\](https://alchemy.com/docs/how-to-read-data-with-json-rpc.mdx): We use JSON-RPC to communicate with Ethereum. All nodes have a JSON-RPC interface for read requests. Signed JSON-RPC requests are needed for writing. - \[How to create a JSON REST API for Ethereum\](https://alchemy.com/docs/create-json-rest-api.mdx): Use ExpressJS to create a server with endpoints for HTTP verbs. Parse JSON input with app.use() and test with axios library. - \[What are Ethereum nodes?\](https://alchemy.com/docs/ethereum-nodes.mdx): Ethereum nodes uphold network integrity and data. Full nodes store and validate all blocks and transactions locally. Ethereum uses Merkle Patricia Tries for data storage. - \[How do Ethereum transactions work?\](https://alchemy.com/docs/how-ethereum-transactions-work.mdx): Ethereum transactions involve sending ether or tokens from one address to another, with fees paid in gas to incentivize miners to process the transaction on the blockchain. - \[Introduction to Ethereum Frontend Libraries\](https://alchemy.com/docs/ethereum-frontend-libraries.mdx): Ethers.js and web3.js are popular Ethereum Javascript libraries for JSON-RPC protocol interaction. Ethers.js is lightweight, well-tested, and ideal for new projects. - \[Solidity Basics\](https://alchemy.com/docs/solidity-basics.mdx): Learn the basics of Solidity, the programming language used for writing Ethereum smart contracts, including syntax, functions, mappings, and more! - \[What is Hardhat?\](https://alchemy.com/docs/what-is-hardhat.mdx): Hardhat is a dev environment for Ethereum smart contracts that enables compiling, deploying, testing, and debugging. It has local testing, Solidity compilation, and easy contract deployment. - \[What is Solidity Syntax?\](https://alchemy.com/docs/what-is-solidity-syntax.mdx): Solidity is a programming language used to write smart contracts on the Ethereum blockchain. It has a syntax similar to JavaScript and is used to define the rules and logic of the contract. - \[How does Solidity work with the EVM?\](https://alchemy.com/docs/how-does-solidity-work.mdx): Solidity compiles to bytecode for the Ethereum Virtual Machine. It's less abstract than JavaScript, and inefficiency can be costly due to blockchain storage and operation fees. - \[Solidity vs. JavaScript: Similarities & Differences\](https://alchemy.com/docs/solidity-vs-javascript.mdx): Solidity and JavaScript share similarities in syntax, but differ in version control, type declaration, and use of \\this\\ keyword. Solidity has static typing and supports tuples. - \[How do Solidity functions work?\](https://alchemy.com/docs/solidity-functions.mdx): Solidity functions use function keyword, can be view or pure , and have visibility levels: public , external , internal , private . - \[How to Modify State Variables\](https://alchemy.com/docs/how-to-modify-state-variables.mdx): In this guide, we will set up a simple Hardhat project structure, add a contract with a state variable and a function to modify it. We will then write a quick test to make sure the function modifies the state variable as expected - let's get to it! 📘 Hardhat is one of the ultimate web3 development ... - \[What does it mean to revert transactions?\](https://alchemy.com/docs/revert-transactions.mdx): Reverting a transaction erases all state changes and stops execution, but the sender still pays for gas and it can be included in a block. - \[How do Solidity Mappings work?\](https://alchemy.com/docs/solidity-mappings.mdx): Solidity mappings store key-value pairs in a structured and deterministic way, useful for address association. They enable efficient searching and can be nested for complex relationships. - \[What are Solidity events?\](https://alchemy.com/docs/solidity-events.mdx): Solidity events log information to the blockchain outside of smart contracts' storage variables using the event keyword. They're emitted by smart contracts and read by connected code. - \[How do Solidity arrays work?\](https://alchemy.com/docs/how-solidity-arrays-work.mdx): Solidity arrays can be fixed or dynamic, with access to .length . Dynamic storage arrays have .push() and .pop() . Structs group data for record-keeping. - \[How do Solidity structs work?\](https://alchemy.com/docs/how-do-solidity-structs-work.mdx): Solidity structs create custom data types for record-keeping, combining with arrays and functions to add, retrieve, and update records. They can be protected by checking msg.sender. - \[Smart Contract Basics\](https://alchemy.com/docs/smart-contract-basics.mdx): Smart contracts are executable code that is run on blockchains like Ethereum. Learn the basics including ABIs, inheritance, unit testing, ERC-20 contracts, and NFTs! - \[How do smart contracts communicate?\](https://alchemy.com/docs/smart-contract-communication.mdx): Smart contracts use their ABI to define functions, encode contract calls for the EVM, and read data from transactions. - \[How to Unit Test a Smart Contract\](https://alchemy.com/docs/how-to-unit-test-a-smart-contract.mdx): To unit test a Solidity smart contract using Hardhat, set up a project structure, add a Faucet.sol contract file, and create a test file structure. Use describe and it functions to define the test suite and targets. Test withdraw() , destroyFaucet() , and withdrawAll() functions. - \[How do smart contract ABIs work?\](https://alchemy.com/docs/smart-contract-abi.mdx): Smart contracts produce two artifacts: ABI (human-readable interface) and bytecode (machine-readable program) necessary for front-end tools to communicate with Ethereum computer. - \[What are multi-signature contracts?\](https://alchemy.com/docs/multi-sig-contracts.mdx): Multi-signature contracts require multiple signatures for transactions, providing security against lost or compromised keys. Gnosis Safe is a multi-signature smart contract deployer on Ethereum. - \[What is Smart Contract inheritance?\](https://alchemy.com/docs/smart-contract-inheritance.mdx): Smart Contract inheritance allows creating new contracts that inherit variables and functions, saving time and effort in developing new contracts. - \[What is an ERC-20 token?\](https://alchemy.com/docs/what-is-erc-20.mdx): An ERC-20 token is an Ethereum network asset representation, like company shares, reward points, or cryptocurrency. It's a standard for compatibility and app development. - \[What are NFTs?\](https://alchemy.com/docs/what-are-nfts.mdx): NFTs are unique blockchain tokens that represent ownership, including real-world objects. They store metadata off-chain using decentralized file networks like IPFS. - \[What are upgradeable smart contracts?\](https://alchemy.com/docs/upgradeable-smart-contracts.mdx): Upgradeable smart contracts use three contracts: Proxy, Implementation, and ProxyAdmin. This pattern enables iterative releases and patching of source code. - \[What is Smart Contract Storage Layout?\](https://alchemy.com/docs/smart-contract-storage-layout.mdx): Contract storage layout refers to the rules governing how contracts’ storage variables are laid out in long-term memory. - \[When to use Storage vs. Memory vs. Calldata in Solidity\](https://alchemy.com/docs/when-to-use-storage-vs-memory-vs-calldata-in-solidity.mdx): Learn about the different data locations in Solidity and when to them - \[What is the difference between Memory and Calldata in Solidity?\](https://alchemy.com/docs/what-is-the-difference-between-memory-and-calldata-in-solidity.mdx): Learn about the differences between the memory and calldata storage options in Solidity - \[What are Payable Functions in Solidity?\](https://alchemy.com/docs/solidity-payable-functions.mdx): Learn about payable functions in Solidity, their importance in handling Ether deposits, and how to create and use them in smart contracts. - \[How to Get a Smart Contract's Balance in Solidity\](https://alchemy.com/docs/how-to-get-a-smart-contracts-balance-in-solidity.mdx): Learn how to get any smart contract's balance in Solidity - \[How to Send Value from Within a Smart Contract Using Solidity\](https://alchemy.com/docs/how-to-send-value-from-within-a-smart-contract-using-solidity.mdx): Learn how you can send Ether through a smart contract - \[How to Interpret Binaries in Solidity\](https://alchemy.com/docs/how-to-interpret-binaries-in-solidity.mdx): What is an Application Binary Interface (ABI)? What are binaries in Solidity? - \[How to Interact with ERC-20 tokens in Solidity\](https://alchemy.com/docs/how-to-interact-with-erc-20-tokens-in-solidity.mdx): Learn how to interact with, and build on top of existing ERC-20 tokens using Solidity - \[How to Interact with ERC-721 Tokens in Solidity\](https://alchemy.com/docs/how-to-interact-with-erc-721-tokens-in-solidity.mdx): Learn how to interact with, and build on top of existing ERC-721 tokens using Solidity - \[How to Make Your Dapp Compatible With Smart Contract Wallets Using ERC-1271\](https://alchemy.com/docs/how-to-make-your-dapp-compatible-with-smart-contract-wallets.mdx): Learn how to verify signatures of smart contract wallets in your dapp by implementing ERC-1271. - \[How to Verify a Message Signature on Ethereum\](https://alchemy.com/docs/how-to-verify-a-message-signature-on-ethereum.mdx): This tutorial will teach you how to sign and verify a message signature using Web3.js and Ethers.js - \[Build & Deploy a "Hello World" Solana Program\](https://alchemy.com/docs/hello-world-solana-program.mdx): Step-by-step guide to building, deploying, and calling a minimal Solana on-chain program using Rust and Alchemy's Solana RPC. - \[Set up Frontend for Solana Application\](https://alchemy.com/docs/hello-world-solana-application.mdx): Step-by-step guide to integrating, calling, and interacting with a Solana on-chain program using Rust and Alchemy's Solana RPC from your own application. - \[How to Deploy a Smart Contract to the Sepolia Testnet\](https://alchemy.com/docs/how-to-deploy-a-smart-contract-to-the-sepolia-testnet.mdx): Learn how to deploy smart contracts to the Sepolia testnet, the preferred Ethereum blockchain for testing decentralized applications. - \[Node API Overview\](https://alchemy.com/docs/node.mdx): Low-level, chain-agnostic access to blockchains (RPC, WebSockets, tracing, debugging) - \[Supported Chains\](https://alchemy.com/docs/reference/node-supported-chains.mdx): Use the Node API for low-level access to Alchemy-supported blockchains - \[Subscription API Overview\](https://alchemy.com/docs/reference/subscription-api.mdx): Learn how to subscribe to pending transactions, log events, new blocks and more using WebSockets on Ethereum, Polygon, Arbitrum, and Optimism. - \[Best Practices for Using WebSockets in Web3\](https://alchemy.com/docs/reference/best-practices-for-using-websockets-in-web3.mdx): How to use websockets when building on Ethereum, Polygon, Optimism, and Arbitrum. - \[Subscription API Endpoints\](https://alchemy.com/docs/reference/subscription-api-endpoints.mdx): List of subscription endpoints for web3 events - \[alchemy\_minedTransactions\](https://alchemy.com/docs/reference/alchemy-minedtransactions.mdx): Emits full transaction objects or hashes that are mined on the network based on provided filters and block tags. - \[alchemy\_pendingTransactions\](https://alchemy.com/docs/reference/alchemy-pendingtransactions.mdx): Emits full transaction objects or hashes that are sent to the network, marked as pending, based on provided filters. - \[newPendingTransactions\](https://alchemy.com/docs/reference/newpendingtransactions.mdx): Emits transaction hashes that are sent to the network and marked as \\pending\\. - \[newHeads\](https://alchemy.com/docs/reference/newheads.mdx): Emits new blocks that are added to the blockchain. - \[logs\](https://alchemy.com/docs/reference/logs.mdx): Emits logs attached to a new block that match certain topic filters. - \[monadNewHeads\](https://alchemy.com/docs/reference/monadnewheads.mdx): Fires a notification each time as soon as a block is Proposed and the node has a chance to speculatively execute. - \[monadLogs\](https://alchemy.com/docs/reference/monadlogs.mdx): Returns logs (that match a given filter) as soon as the block is Proposed. - \[Yellowstone gRPC Overview\](https://alchemy.com/docs/reference/yellowstone-grpc-overview.mdx): Overview of Yellowstone gRPC - High-performance real-time Solana data streaming - \[Yellowstone gRPC Quickstart\](https://alchemy.com/docs/reference/yellowstone-grpc-quickstart.mdx): Get started with Yellowstone gRPC streaming in minutes - \[API Reference Overview\](https://alchemy.com/docs/reference/yellowstone-grpc-api-overview.mdx): Yellowstone gRPC subscription types and filtering options - \[Subscribe Request\](https://alchemy.com/docs/reference/yellowstone-grpc-subscribe-request.mdx): Comprehensive guide to the SubscribeRequest structure and configuration - \[Subscribe to Slots\](https://alchemy.com/docs/reference/yellowstone-grpc-subscribe-slots.mdx): Track Solana slot progression and chain state in real-time - \[Subscribe to Transactions\](https://alchemy.com/docs/reference/yellowstone-grpc-subscribe-transactions.mdx): Stream Solana transactions in real-time with powerful filtering options - \[Subscribe to Accounts\](https://alchemy.com/docs/reference/yellowstone-grpc-subscribe-accounts.mdx): Monitor Solana account changes in real-time with account subscriptions - \[Subscribe to Blocks\](https://alchemy.com/docs/reference/yellowstone-grpc-subscribe-blocks.mdx): Stream complete Solana block data in real-time - \[Code Examples\](https://alchemy.com/docs/reference/yellowstone-grpc-examples.mdx): Practical Rust examples for Yellowstone gRPC - \[Best Practices\](https://alchemy.com/docs/reference/yellowstone-grpc-best-practices.mdx): Essential tips and patterns for production Yellowstone gRPC applications - \[Trace API Quickstart\](https://alchemy.com/docs/reference/trace-api-quickstart.mdx): The Trace API provides insights into transaction processing and on-chain activity. - \[What are EVM Traces?\](https://alchemy.com/docs/reference/what-are-evm-traces.mdx): A guide to understanding EVM traces, their types, and how to use them. - \[Trace API vs. Debug API\](https://alchemy.com/docs/reference/trace-api-vs-debug-api.mdx): The differences between the Trace API by Openethereum and the Debug API by Geth - \[What is trace\_transaction?\](https://alchemy.com/docs/reference/what-is-trace\_transaction.mdx): Learn what the trace\_transaction method is, how to use it on EVM blockchains, and test an example use case. - \[What is trace\_block?\](https://alchemy.com/docs/reference/what-is-trace\_block.mdx): Learn what the trace\_block method is, how to use it on EVM blockchains, and test an example use case. - \[What is trace\_filter?\](https://alchemy.com/docs/reference/what-is-trace\_filter.mdx): Learn what the trace\_filter method is, how to use it on EVM blockchains, and test an example use case. - \[trace\_call vs debug\_traceCall\](https://alchemy.com/docs/reference/trace\_call-vs-debug\_tracecall.mdx): The differences between the trace\_call method by OpenEthereum and the debug\_traceCall method by Geth - \[Debug API Quickstart\](https://alchemy.com/docs/reference/debug-api-quickstart.mdx): The Debug API provides deeper insights into transaction processing and on-chain activity. - \[Data APIs Overview\](https://alchemy.com/docs/data.mdx): Use Alchemy Data to build and scale your business - \[Portfolio APIs\](https://alchemy.com/docs/reference/portfolio-apis.mdx): Everything you need to view onchain assets. - \[Token API Overview\](https://alchemy.com/docs/reference/token-api-overview.mdx): Learn about Alchemy's Token APIs. - \[Token API Quickstart\](https://alchemy.com/docs/reference/token-api-quickstart.mdx): A new developer's guide to using the Token API and getting token information. Query Token data using alchemy-web3 (recommended) or fetch. - \[Transfers API Overview\](https://alchemy.com/docs/reference/transfers-api-quickstart.mdx): The Transfers API allows you to easily fetch historical transactions for any address without having to scan the entire chain and index everything for each of your users. - \[Prices API Quickstart\](https://alchemy.com/docs/reference/prices-api-quickstart.mdx): A new developer's guide to fetching current and historical token prices via the Prices API. - \[Prices API FAQ\](https://alchemy.com/docs/reference/prices-api-faq.mdx): Commonly asked questions when using Alchemy's Prices API for fungible token prices. - \[NFT API Overview\](https://alchemy.com/docs/reference/nft-api-overview.mdx): Go from zero to hero with the Alchemy NFT API. Learn how to query NFT data, then dive into some fun tutorials! - \[NFT API Quickstart\](https://alchemy.com/docs/reference/nft-api-quickstart.mdx): Go from zero to hero with the Alchemy NFT API. Learn how to query NFT data, then dive into some fun tutorials! - \[Alchemy DAS APIs for Solana NFTs and Fungible Tokens (Beta)\](https://alchemy.com/docs/reference/alchemy-das-apis-for-solana.mdx): Alchemy DAS APIs for Solana NFTs and Fungible Tokens (Beta) - \[NFT API Endpoints Overview\](https://alchemy.com/docs/reference/nft-api-endpoints.mdx): List of all NFT API endpoints - \[NFT API FAQ\](https://alchemy.com/docs/reference/nft-api-faq.mdx): Frequently Asked Questions regarding our NFT API - \[Webhooks Overview\](https://alchemy.com/docs/reference/webhooks-overview.mdx): Fast, consistent, and custom push notifications! - \[Webhooks Quickstart\](https://alchemy.com/docs/reference/notify-api-quickstart.mdx): Fast, consistent, and custom push notifications! - \[Custom Webhooks GraphQL Examples\](https://alchemy.com/docs/reference/custom-webhooks-example.mdx): List of sample GraphQL queries that Alchemy supports - \[Custom Webhook Filters\](https://alchemy.com/docs/reference/custom-webhook-filters.mdx): Understand what filters are available for Custom Webhooks and how to use them - \[Custom Webhook Variables\](https://alchemy.com/docs/reference/custom-webhook-variables.mdx): Understand how Custom Webhook variables work and how to use them - \[Webhook Types\](https://alchemy.com/docs/reference/webhook-types.mdx): List of all the Alchemy Notify webhook types to stream web3 data in real-time - \[Custom Webhook\](https://alchemy.com/docs/reference/custom-webhook.mdx): Track any smart contract or marketplace activity, monitor any contract creation, or ingest any other on-chain interaction. Infinite data access with precise filter controls. - \[Address Activity Webhook\](https://alchemy.com/docs/reference/address-activity-webhook.mdx): Get real-time updates of value and token transfers for the addresses that you track using the Address Activity webhook - \[NFT Activity Webhook\](https://alchemy.com/docs/reference/nft-activity-webhook.mdx): Get real-time updates when an NFT is transferred from the NFT collections that you track using the NFT Activity webhook - \[Transaction Simulation\](https://alchemy.com/docs/reference/simulation.mdx): Discover Alchemy's Transaction Simulation APIs for predicting the precise impact of a transaction before it reaches the blockchain. - \[Asset Changes\](https://alchemy.com/docs/reference/simulation-asset-changes.mdx): Simulates a transaction and returns a list of asset changes. - \[Execution Simulation\](https://alchemy.com/docs/reference/simulation-execution.mdx): Simulates a transaction and returns decoded execution traces and decoded logs. - \[Bundle Simulation\](https://alchemy.com/docs/reference/simulation-bundle.mdx): Simulates multiple transactions sequentially. - \[Transaction Simulation Examples\](https://alchemy.com/docs/reference/simulation-examples.mdx): Explore practical examples to help you get started with Alchemy's Simulation APIs. - \[Transaction Simulation FAQs\](https://alchemy.com/docs/reference/simulation-faqs.mdx): Find answers to frequently asked questions related to Alchemy's Transaction Simulation APIs - \[Utility API Overview\](https://alchemy.com/docs/reference/utility-api-overview.mdx): Enhanced API to get all transaction receipts for a given block by number or block hash. - \[Alchemy Subgraphs Deprecation Notice\](https://alchemy.com/docs/alchemy-subgraphs/deprecation-notice.mdx): Alchemy Subgraphs has been sunset. Learn how to migrate to Goldsky. - \[Smart Wallets\](https://alchemy.com/docs/wallets.mdx): Build zero-friction user onboarding and transactions end-to-end with one SDK. - \[Wallets API Quickstart (SDK)\](https://alchemy.com/docs/wallets/smart-wallet-quickstart/sdk.mdx): Learn to interact with Wallet APIs using the Wallet Client SDK - \[React Quickstart\](https://alchemy.com/docs/wallets/react/quickstart.mdx): Learn how to get started with Alchemy Smart Wallets in React. - \[Initialization\](https://alchemy.com/docs/wallets/react/installation.mdx): Build Alchemy Smart Wallets in a new app - \[Environment Setup\](https://alchemy.com/docs/wallets/react/setup.mdx): How to set up Alchemy Smart Wallets using the Alchemy Dashboard. - \[UI Customization\](https://alchemy.com/docs/wallets/react/quickstart/ui-customization.mdx): Learn how to customize the login UI for smart wallets - \[App Integration\](https://alchemy.com/docs/wallets/react/quickstart/existing-project.mdx): Learn how to integrate Alchemy Smart Wallets into your existing React application with embedded wallets and authentication. - \[Using within React Native applications\](https://alchemy.com/docs/wallets/react-native/overview.mdx): A guide on integrating Smart Wallets within a React Native application - \[Getting started quickly with Smart Wallets on Expo\](https://alchemy.com/docs/wallets/react-native/getting-started/getting-started-quickstart.mdx): A guide on configuring a template using Smart Wallets with a React Native Expo application - \[Getting started with Smart Wallets on Expo\](https://alchemy.com/docs/wallets/react-native/getting-started/getting-started-expo.mdx): A guide on integrating Smart Wallets within a React Native Expo application - \[Getting started with Smart Wallets on bare React Native\](https://alchemy.com/docs/wallets/react-native/getting-started/getting-started-rn-bare.mdx): A guide on integrating Smart Wallets within a Bare React Native application - \[Setup authentication to smart wallets on React Native\](https://alchemy.com/docs/wallets/react-native/getting-started/app-integration.mdx): Setup authentication to smart wallets on React Native - \[Other Javascript Frameworks\](https://alchemy.com/docs/wallets/core/overview.mdx): How to use Smart Wallets with other Javascript Frameworks - \[Core Quickstart\](https://alchemy.com/docs/wallets/core/quickstart.mdx): Learn how to get started with the Account Kit Core package - \[Wallets API Quickstart\](https://alchemy.com/docs/wallets/reference/smart-wallet-quickstart.mdx): How to go from zero to hero with Wallet APIs - \[Wallets API Quickstart (SDK)\](https://alchemy.com/docs/wallets/smart-wallet-quickstart/sdk.mdx): Learn to interact with Wallet APIs using the Wallet Client SDK - \[Wallets API Quickstart (API)\](https://alchemy.com/docs/wallets/smart-wallet-quickstart/api.mdx): Learn to interact with Wallet APIs using any RPC client - \[Recipes\](https://alchemy.com/docs/wallets/recipes/overview.mdx): Step-by-step guides for common Smart Wallet features and integrations. - \[Send USDC (or other ERC-20s)\](https://alchemy.com/docs/wallets/recipes/send-usdc.mdx): Learn how to build and send a transaction that transfers USDC from a smart account using Smart Wallets. - \[How to programmatically create a wallet\](https://alchemy.com/docs/wallets/recipes/programmatic-wallet-creation.mdx): Generate a signer, initialize a Smart Wallet Client, sponsor gas with a policy, derive the counterfactual address and deploy by sending the first UserOperation. - \[Onramp Funds to Embedded Smart Wallets with Coinbase\](https://alchemy.com/docs/wallets/recipes/onramp-funds.mdx): Step-by-step guide to let users buy crypto with Coinbase Onramp and fund an Alchemy Embedded Smart Wallet. - \[Session Keys App\](https://alchemy.com/docs/wallets/recipes/wallet-session-keys-app.mdx) - \[Upgrade to Smart Accounts\](https://alchemy.com/docs/wallets/recipes/upgrade-to-smart-accounts.mdx): Learn how to upgrade existing wallets to smart accounts with two different approaches. - \[Multi-chain Apps\](https://alchemy.com/docs/wallets/recipes/multi-chain-setup.mdx): Learn how to build multi-chain apps with Smart Wallets. - \[Social Payments and Defi\](https://alchemy.com/docs/wallets/recipes/social-payments-and-defi.mdx) - \[Supported Chains\](https://alchemy.com/docs/wallets/supported-chains.mdx) - \[Overview\](https://alchemy.com/docs/wallets/transactions/overview.mdx): A comprehensive guide to sending transactions with Smart Wallets - \[Send transactions\](https://alchemy.com/docs/wallets/transactions/send-transactions.mdx): Execute a single transaction - \[Send batch transactions\](https://alchemy.com/docs/wallets/transactions/send-batch-transactions.mdx): Batch multiple calls together into one transaction - \[Send parallel transactions\](https://alchemy.com/docs/wallets/transactions/send-parallel-transactions.mdx) - \[How EIP-7702 Works\](https://alchemy.com/docs/wallets/transactions/using-eip-7702.mdx): Understanding how Smart Wallets use EIP-7702 - \[Gasless transactions\](https://alchemy.com/docs/wallets/transactions/sponsor-gas/overview.mdx): Sponsor gas fees for your users - \[Sponsor gas\](https://alchemy.com/docs/wallets/transactions/sponsor-gas.mdx): Sponsor gas fees for your users - \[Sponsor fees & rent on Solana\](https://alchemy.com/docs/wallets/transactions/solana/sponsor-gas.mdx): How to sponsor fees & rent on Solana - \[Pay gas with any token\](https://alchemy.com/docs/wallets/transactions/pay-gas-with-any-token.mdx): Enable users to pay gas with tokens like USDC - \[Same-chain swaps (Alpha)\](https://alchemy.com/docs/wallets/transactions/swap-tokens.mdx) - \[Cross-chain swaps (Alpha)\](https://alchemy.com/docs/wallets/transactions/cross-chain-swap-tokens.mdx) - \[Session Keys\](https://alchemy.com/docs/wallets/reference/wallet-apis-session-keys.mdx): Learn how to use session keys with Wallet APIs - \[Session Keys (SDK)\](https://alchemy.com/docs/wallets/reference/wallet-apis-session-keys/sdk.mdx): Learn how to use session keys using the Wallet Client SDK - \[Session Keys (API)\](https://alchemy.com/docs/wallets/reference/wallet-apis-session-keys/api.mdx): Learn how to use session keys using any RPC client - \[Retry Transactions\](https://alchemy.com/docs/wallets/transactions/retry-transactions.mdx) - \[Sign messages\](https://alchemy.com/docs/wallets/transactions/signing/sign-messages.mdx): Sign messages using your Smart Wallet - \[Sign typed data\](https://alchemy.com/docs/wallets/transactions/signing/sign-typed-data.mdx): Sign EIP-712 typed data with your Smart Wallet - \[Configure client\](https://alchemy.com/docs/wallets/concepts/smart-account-client.mdx): Configure smart wallet client - \[Overview\](https://alchemy.com/docs/wallets/authentication/overview.mdx): Comprehensive guide to authentication methods and user onboarding with Alchemy Smart Wallets - \[Email OTP Authentication\](https://alchemy.com/docs/wallets/authentication/login-methods/email-otp.mdx): How to implement Email OTP authentication across different frameworks - \[Email Magic Link Authentication\](https://alchemy.com/docs/wallets/authentication/login-methods/email-magic-link.mdx): How to implement Email Magic Link authentication across different frameworks - \[Social Login Authentication\](https://alchemy.com/docs/wallets/authentication/login-methods/social-login.mdx): How to implement Social Login authentication across different frameworks - \[Custom Social Providers with Auth0\](https://alchemy.com/docs/wallets/react/login-methods/social-providers.mdx): How to implement custom social providers using Auth0 in your React app - \[Bring Your Own Authentication\](https://alchemy.com/docs/wallets/authentication/login-methods/bring-your-own-auth.mdx): Integrate your existing authentication system with Alchemy Smart Wallets using JWT tokens - \[Passkey Signup Authentication\](https://alchemy.com/docs/wallets/authentication/login-methods/passkey-signup.mdx): How to implement Passkey Signup authentication across different frameworks - \[Passkey Login Authentication\](https://alchemy.com/docs/wallets/react/login-methods/passkey-login.mdx): How to implement Passkey Login authentication in your React app - \[Add Passkey\](https://alchemy.com/docs/wallets/react/add-passkey.mdx): Learn how to add a passkey to your users' accounts with Smart Wallets. - \[SMS Authentication\](https://alchemy.com/docs/wallets/authentication/login-methods/sms-login.mdx): How to authenticate users with phone number and SMS OTP code - \[\[NEW\] On-chain Passkeys\](https://alchemy.com/docs/wallets/react/login-methods/onchain-passkeys.mdx): How to use on-chain passkeys to authenticate users and send user operations - \[Adding and Removing Login Methods\](https://alchemy.com/docs/wallets/signer/authentication/adding-and-removing-login-methods.mdx): Learn how to add and remove login methods to an account - \[Authentication with UI components\](https://alchemy.com/docs/wallets/react/ui-components.mdx): How to use our pre-built authentication component in your React app - \[Custom theme\](https://alchemy.com/docs/wallets/react/customization/theme.mdx): Customize the theme of your Smart Wallets app - \[Tailwind CSS Setup\](https://alchemy.com/docs/wallets/react/tailwind-setup.mdx): Complete guide to setting up Tailwind CSS with UI components - \[Custom UI for Authentication\](https://alchemy.com/docs/wallets/react/react-hooks.mdx): Overview of implementing custom authentication UI in your React app - \[Signer Quickstart\](https://alchemy.com/docs/wallets/signer/quickstart.mdx): Get started with the Alchemy Signer - \[Connect external wallets\](https://alchemy.com/docs/wallets/react/login-methods/eoa-login.mdx): How to connect external wallets on EVM and Solana - \[Styling Connectors\](https://alchemy.com/docs/wallets/react/connectors/customization.mdx): Customize external wallet connectors including ordering and features wallets - \[Setting Up Multi-Factor Authentication\](https://alchemy.com/docs/wallets/react/mfa/setup-mfa.mdx): How to set up additional security with authenticator apps in your React application - \[Email OTP with Multi-Factor Authentication\](https://alchemy.com/docs/wallets/react/mfa/email-otp.mdx): How to authenticate using Email OTP when MFA is enabled - \[Email Magic Link with Multi-Factor Authentication\](https://alchemy.com/docs/wallets/react/mfa/email-magic-link.mdx): How to authenticate users with Email Magic Link and MFA in your React app - \[Social Login with Multi-Factor Authentication\](https://alchemy.com/docs/wallets/react/mfa/social-login.mdx): How to authenticate users with Social Login when MFA is enabled - \[Getting started with Solana Smart Wallets\](https://alchemy.com/docs/wallets/react/solana-wallets/get-started.mdx): Learn how to use Smart Wallets on Solana - \[Server wallets\](https://alchemy.com/docs/wallets/authentication/login-methods/server-wallets.mdx): Control wallets programmatically using access keys - \[Pregenerate Wallets\](https://alchemy.com/docs/wallets/react/pregenerate-wallets.mdx): Learn how to pre-generate Smart Wallet addresses for your users with nothing more than an email address. - \[Manage user sessions\](https://alchemy.com/docs/wallets/signer/user-sessions.mdx): Learn how to configure and leverage sessions for you users with the Alchemy Signer - \[Managing ownership\](https://alchemy.com/docs/wallets/smart-contracts/modular-account-v2/managing-ownership.mdx): Managing ownership on your Modular Account V2 - \[Export Private Key\](https://alchemy.com/docs/wallets/signer/export-private-key.mdx): Learn how to enable a user to export their private key with the Alchemy Signer - \[Privy\](https://alchemy.com/docs/wallets/third-party/signers/privy.mdx): Use Privy with Alchemy Smart Wallets for EIP-7702, sponsorship, swaps, and batching - \[Turnkey\](https://alchemy.com/docs/wallets/third-party/signers/turnkey.mdx): Use Turnkey with Smart Wallets for EIP-7702, sponsorship, and batching - \[Custom Integration\](https://alchemy.com/docs/wallets/third-party/signers/custom-integration.mdx): Bring your own signer to Alchemy Smart Wallets via EIP-7702 - \[Choosing a Signer\](https://alchemy.com/docs/wallets/signer/what-is-a-signer.mdx): Explore Smart Wallets integration guides for signers including Magic.Link, Privy, Web3Auth, EOAs, and many more! - \[Low-level Infrastructure Overview\](https://alchemy.com/docs/wallets/transactions/low-level-infra/overview.mdx): Raw EIP-4337 APIs for advanced developers - \[Quickstart\](https://alchemy.com/docs/wallets/low-level-infra/quickstart.mdx): Get started with Alchemy's ERC-4337 infrastructure - \[Gas Manager Admin API Endpoints\](https://alchemy.com/docs/wallets/low-level-infra/gas-manager/policy-management/api-endpoints.mdx): The Gas Manager Admin API Endpoints allows you to programmatically manage your gas manager policies. - \[Gas Sponsorship API Endpoints\](https://alchemy.com/docs/wallets/low-level-infra/gas-manager/gas-sponsorship/api-endpoints.mdx): The Gas Sponsorship API Endpoints allows you to sponsor gas fees for your users, removing the biggest barrier to entry. - \[Basic Gas Sponsorship\](https://alchemy.com/docs/wallets/low-level-infra/gas-manager/gas-sponsorship/using-sdk/basic-gas-sponsorship.mdx): The Gas Manager allows you to sponsor gas fees for your users on EVM networks, removing the biggest barrier to entry. - \[Conditional Gas Sponsorship\](https://alchemy.com/docs/wallets/low-level-infra/gas-manager/gas-sponsorship/using-sdk/conditional-gas-sponsorship.mdx): Step-by-step guide to sponsor gas for select transactions and users. - \[Pay Gas with Any ERC20 Token\](https://alchemy.com/docs/wallets/low-level-infra/gas-manager/gas-sponsorship/using-sdk/pay-gas-with-any-erc20-token.mdx): Learn how to enable gas payments with ERC-20 tokens. - \[Bundler Overview\](https://alchemy.com/docs/wallets/transactions/low-level-infra/bundler/overview.mdx): Raw EIP-4337 Bundler APIs for advanced developers - \[Bundler API Endpoints\](https://alchemy.com/docs/wallets/transactions/low-level-infra/bundler/overview/api-endpoints.mdx): The Bundler API Endpoints allow you to interact with the lowest level of the account abstraction stack, giving users full control over their User Operations. - \[Using SDK\](https://alchemy.com/docs/wallets/transactions/low-level-infra/bundler/overview/using-sdk.mdx) - \[Bundler Sponsored Operations\](https://alchemy.com/docs/reference/bundler-sponsored-operations.mdx): Learn how to use bundler sponsorship to cover gas fees for user operations without an onchain paymaster. - \[FAQs\](https://alchemy.com/docs/wallets/reference/bundler-faqs.mdx): Frequently asked questions about the Bundler - \[Choosing a Smart Account\](https://alchemy.com/docs/wallets/smart-contracts/choosing-a-smart-account.mdx): Learn about different smart account implementations to use with Smart Wallets - \[Modular Account V2\](https://alchemy.com/docs/wallets/smart-contracts/modular-account-v2/overview.mdx): An overview of the Modular Account V2 smart account. - \[Modular Account V2 • Getting started\](https://alchemy.com/docs/wallets/smart-contracts/modular-account-v2/getting-started.mdx): Getting started with Modular Account V2 in Smart Wallets - \[Light Account\](https://alchemy.com/docs/wallets/smart-contracts/other-accounts/light-account.mdx): What is Light Account? - \[Light Account • Getting started\](https://alchemy.com/docs/wallets/smart-contracts/other-accounts/light-account/getting-started.mdx): Getting started with Light Account in Smart Wallets - \[How to transfer ownership of a Light Account\](https://alchemy.com/docs/wallets/smart-contracts/other-accounts/light-account/transfer-ownership-light-account.mdx): Follow this guide to transfer ownership of a Light Account with - \[How to manage ownership of a Multi-Owner Light Account\](https://alchemy.com/docs/wallets/smart-contracts/other-accounts/light-account/multi-owner-light-account.mdx): Follow this guide to manage ownership of a Multi-Owner Light - \[3rd Party Smart Contracts\](https://alchemy.com/docs/wallets/third-party/smart-contracts.mdx): Learn how to use Smart Contract Accounts not included in Smart Wallets - \[Smart Contract Deployments\](https://alchemy.com/docs/wallets/smart-contracts/deployed-addresses.mdx): Deployment addresses - \[How to stamp requests\](https://alchemy.com/docs/wallets/reference/how-to-stamp-requests.mdx): Overview for how to send stamped (or verified) requests required for using Wallet APIs directly. - \[EntryPoint v0.7 Revert Codes\](https://alchemy.com/docs/wallets/reference/entrypoint-v07-revert-codes.mdx): Learn about the revert codes returned by the ERC-4337 EntryPoint v0.7 - \[EntryPoint v0.6 Revert Codes\](https://alchemy.com/docs/wallets/reference/entrypoint-v06-revert-codes.mdx): Learn about the revert codes returned by the ERC-4337 EntryPoint v0.6 - \[aa-sdk/core\](https://alchemy.com/docs/wallets/reference/aa-sdk/core.mdx): Overview of aa-sdk/core - \[AccountNotFoundError\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/classes/AccountNotFoundError.mdx): This error is thrown when an account could not be found to execute a specific action. It extends the \`BaseError\` class. - \[AccountRequiresOwnerError\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/classes/AccountRequiresOwnerError.mdx): Represents an error that occurs when an account requires an owner to execute but none is provided. - \[BaseError\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/classes/BaseError.mdx): A custom error class that extends from \`ViemBaseError\`. This class allows for error messages to include links to relevant documentation based on provided \`docsPath\` and \`docsSlug\` parameters. This is based on on viem's BaseError type (obviously from the import and extend) we want the errors here to point to our docs if we supply a docsPath though - \[BatchExecutionNotSupportedError\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/classes/BatchExecutionNotSupportedError.mdx): Represents an error indicating that batch execution is not supported for a specific account type. - \[ChainNotFoundError\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/classes/ChainNotFoundError.mdx): Error class representing a "Chain Not Found" error, typically thrown when no chain is supplied to the client. - \[DefaultFactoryNotDefinedError\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/classes/DefaultFactoryNotDefinedError.mdx): Represents an error that is thrown when no default factory is defined for a specific account type on a given chain and entry point version. This error suggests providing an override via the \`factoryAddress\` parameter when creating an account. - \[EntityIdOverrideError\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/classes/EntityIdOverrideError.mdx): Error class denoting that the provided entity id is invalid because it's overriding the native entity id. - \[EntryPointNotFoundError\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/classes/EntryPointNotFoundError.mdx): Represents an error thrown when an entry point is not found for a specific chain and entry point version. This error indicates that a default entry point does not exist for the given chain and version, and suggests providing an override. - \[FailedToFindTransactionError\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/classes/FailedToFindTransactionError.mdx): Represents an error that occurs when a transaction cannot be found for a given user operation. This error extends from \`BaseError\`. The \`hash\` of the transaction is provided to indicate which transaction could not be found. - \[FailedToGetStorageSlotError\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/classes/FailedToGetStorageSlotError.mdx): Custom error class \`FailedToGetStorageSlotError\` which is used to signal a failure when attempting to retrieve a storage slot. This error includes the slot and slot descriptor in its message and inherits from \`BaseError\`. - \[GetCounterFactualAddressError\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/classes/GetCounterFactualAddressError.mdx): Custom error class for handling errors when getting a counterfactual address. This extends the \`BaseError\` class and provides a custom error message and name. - \[IncompatibleClientError\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/classes/IncompatibleClientError.mdx): Represents an error thrown when a client is not compatible with the expected client type for a specific method. The error message provides guidance on how to create a compatible client. - \[IncorrectAccountType\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/classes/IncorrectAccountType.mdx): Represents an error thrown when an account type does not match the expected type. - \[InvalidDeferredActionNonce\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/classes/InvalidDeferredActionNonce.mdx): Error class denoting that the deferred action nonce used is invalid. - \[InvalidEntityIdError\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/classes/InvalidEntityIdError.mdx): Error class denoting that the provided entity id is invalid because it's too large. - \[InvalidEntryPointError\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/classes/InvalidEntryPointError.mdx): Represents an error thrown when an invalid entry point version is encountered for a specific chain. This error extends the \`BaseError\` class. - \[InvalidModularAccountV2Mode\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/classes/InvalidModularAccountV2Mode.mdx): Error class denoting that the provided ma v2 account mode is invalid. - \[InvalidNonceKeyError\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/classes/InvalidNonceKeyError.mdx): Error class denoting that the nonce key is invalid because its too large. - \[InvalidRpcUrlError\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/classes/InvalidRpcUrlError.mdx): Represents an error that occurs when an invalid RPC URL is provided. This class extends the \`BaseError\` class and includes the invalid URL in the error message. - \[InvalidSignerTypeError\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/classes/InvalidSignerTypeError.mdx): Represents an error thrown when an invalid signer type is provided to the SmartAccountSigner. - \[InvalidUserOperationError\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/classes/InvalidUserOperationError.mdx): Thrown when a UserOperationStruct is not a valid request extends viem BaseError - \[LocalAccountSigner\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/classes/LocalAccountSigner.mdx): Represents a local account signer and provides methods to sign messages and transactions, as well as static methods to create the signer from mnemonic or private key. - \[Logger\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/classes/Logger.mdx): Logger class provides static methods for logging at different levels such as error, warn, debug, info, and verbose. This class allows setting log levels and log filters to control the logging behavior. - \[NotAModularAccountV2Error\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/classes/NotAModularAccountV2Error.mdx): This error is thrown when an account is not a Modular Account V2 - \[SignTransactionNotSupportedError\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/classes/SignTransactionNotSupportedError.mdx): Error thrown when attempting to sign a transaction that is not supported by smart contracts. - \[SmartAccountWithSignerRequiredError\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/classes/SmartAccountWithSignerRequiredError.mdx): Error class indicating that a smart account operation requires a signer. - \[TraceHeader\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/classes/TraceHeader.mdx): Some tools that are useful when dealing with the values of the trace header. Follows the W3C trace context standard. - \[TransactionMissingToParamError\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/classes/TransactionMissingToParamError.mdx): Error thrown when a transaction is missing the \`to\` address parameter. This class extends the \`BaseError\` class. - \[UpgradeToAndCallNotSupportedError\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/classes/UpgradeToAndCallNotSupportedError.mdx): Represents an error that occurs when an attempt is made to call \`UpgradeToAndCall\` on an account type that does not support it. Includes the account type in the error message. - \[UpgradesNotSupportedError\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/classes/UpgradesNotSupportedError.mdx): An error class representing the condition where upgrades are not supported for a specific account type. This error extends the \`BaseError\` class and provides a custom error message based on the account type. - \[WaitForUserOperationError\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/classes/WaitForUserOperationError.mdx): Error thrown when waiting for user operation request to be mined. Includes the internal error as well as the request that failed. This request can then be used with dropAndReplaceUserOperation to retry the operation. - \[WalletClientSigner\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/classes/WalletClientSigner.mdx): Represents a wallet client signer for smart accounts, providing methods to get the address, sign messages, sign typed data, and sign 7702 authorizations. - \[DeploymentState\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/enumerations/DeploymentState.mdx): Overview of DeploymentState - \[LogLevel\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/enumerations/LogLevel.mdx): Overview of LogLevel - \[RoundingMode\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/enumerations/RoundingMode.mdx): Overview of RoundingMode - \[allEqual\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/functions/allEqual.mdx): Overview of the allEqual function - \[applyUserOpFeeOption\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/functions/applyUserOpFeeOption.mdx): Overview of the applyUserOpFeeOption function - \[applyUserOpOverride\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/functions/applyUserOpOverride.mdx): Overview of the applyUserOpOverride function - \[applyUserOpOverrideOrFeeOption\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/functions/applyUserOpOverrideOrFeeOption.mdx): Overview of the applyUserOpOverrideOrFeeOption function - \[asyncPipe\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/functions/asyncPipe.mdx): Overview of the asyncPipe function - \[bigIntClamp\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/functions/bigIntClamp.mdx): Overview of the bigIntClamp function - \[bigIntMax\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/functions/bigIntMax.mdx): Overview of the bigIntMax function - \[bigIntMin\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/functions/bigIntMin.mdx): Overview of the bigIntMin function - \[bigIntMultiply\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/functions/bigIntMultiply.mdx): Overview of the bigIntMultiply function - \[buildUserOperation\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/functions/buildUserOperation.mdx): Overview of the buildUserOperation function - \[buildUserOperationFromTx\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/functions/buildUserOperationFromTx.mdx): Overview of the buildUserOperationFromTx function - \[buildUserOperationFromTxs\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/functions/buildUserOperationFromTxs.mdx): Overview of the buildUserOperationFromTxs function - \[bypassPaymasterAndData\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/functions/bypassPaymasterAndData.mdx): Overview of the bypassPaymasterAndData function - \[bypassPaymasterAndDataEmptyHex\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/functions/bypassPaymasterAndDataEmptyHex.mdx): Overview of the bypassPaymasterAndDataEmptyHex function - \[checkGasSponsorshipEligibility\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/functions/checkGasSponsorshipEligibility.mdx): Overview of the checkGasSponsorshipEligibility function - \[clientHeaderTrack\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/functions/clientHeaderTrack.mdx): Overview of the clientHeaderTrack function - \[concatPaymasterAndData\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/functions/concatPaymasterAndData.mdx): Overview of the concatPaymasterAndData function - \[conditionalReturn\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/functions/conditionalReturn.mdx): Overview of the conditionalReturn function - \[convertChainIdToCoinType\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/functions/convertChainIdToCoinType.mdx): Overview of the convertChainIdToCoinType function - \[convertCoinTypeToChain\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/functions/convertCoinTypeToChain.mdx): Overview of the convertCoinTypeToChain function - \[convertCoinTypeToChainId\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/functions/convertCoinTypeToChainId.mdx): Overview of the convertCoinTypeToChainId function - \[createBundlerClient\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/functions/createBundlerClient.mdx): Creates a Bundler Client using the provided configuration parameters, including chain and optional type. - \[createSmartAccountClient\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/functions/createSmartAccountClient.mdx): Creates a smart account client using the provided configuration. This client handles various Ethereum transactions and message signing operations. - \[createSmartAccountClientFromExisting\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/functions/createSmartAccountClientFromExisting.mdx): Creates a smart account client using an existing client and specific configuration. This function can be used to reuse a pre-existing BundlerClient while customizing other aspects of the smart account. - \[deepHexlify\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/functions/deepHexlify.mdx): Overview of the deepHexlify function - \[defaultFeeEstimator\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/functions/defaultFeeEstimator.mdx): Overview of the defaultFeeEstimator function - \[dropAndReplaceUserOperation\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/functions/dropAndReplaceUserOperation.mdx): Overview of the dropAndReplaceUserOperation function - \[erc7677Middleware\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/functions/erc7677Middleware.mdx): Overview of the erc7677Middleware function - \[filterUndefined\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/functions/filterUndefined.mdx): Overview of the filterUndefined function - \[getAccountAddress\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/functions/getAccountAddress.mdx): Overview of the getAccountAddress function - \[getDefaultUserOperationFeeOptions\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/functions/getDefaultUserOperationFeeOptions.mdx): Overview of the getDefaultUserOperationFeeOptions function - \[getEntryPoint\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/functions/getEntryPoint.mdx): Retrieves the entry point definition for the specified chain and version, falling back to the default version if not provided. Throws an error if the entry point address cannot be found. - \[getUserOperationError\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/functions/getUserOperationError.mdx): Overview of the getUserOperationError function - \[isBigNumberish\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/functions/isBigNumberish.mdx): Overview of the isBigNumberish function - \[isEntryPointVersion\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/functions/isEntryPointVersion.mdx): Overview of the isEntryPointVersion function - \[isMultiplier\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/functions/isMultiplier.mdx): Overview of the isMultiplier function - \[isSigner\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/functions/isSigner.mdx): Overview of the isSigner function - \[isSmartAccountClient\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/functions/isSmartAccountClient.mdx): Overview of the isSmartAccountClient function - \[isSmartAccountWithSigner\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/functions/isSmartAccountWithSigner.mdx): Overview of the isSmartAccountWithSigner function - \[isValidFactoryAndData\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/functions/isValidFactoryAndData.mdx): Overview of the isValidFactoryAndData function - \[isValidPaymasterAndData\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/functions/isValidPaymasterAndData.mdx): Overview of the isValidPaymasterAndData function - \[isValidRequest\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/functions/isValidRequest.mdx): Overview of the isValidRequest function - \[middlewareActions\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/functions/middlewareActions.mdx): Overview of the middlewareActions function - \[parseFactoryAddressFromAccountInitCode\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/functions/parseFactoryAddressFromAccountInitCode.mdx): Overview of the parseFactoryAddressFromAccountInitCode function - \[parsePaymasterAndData\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/functions/parsePaymasterAndData.mdx): Overview of the parsePaymasterAndData function - \[pick\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/functions/pick.mdx): Overview of the pick function - \[resolveProperties\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/functions/resolveProperties.mdx): Overview of the resolveProperties function - \[sendTransaction\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/functions/sendTransaction.mdx): Overview of the sendTransaction function - \[sendTransactions\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/functions/sendTransactions.mdx): Overview of the sendTransactions function - \[sendUserOperation\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/functions/sendUserOperation.mdx): Overview of the sendUserOperation function - \[split\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/functions/split.mdx): Overview of the split function - \[stringToIndex\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/functions/stringToIndex.mdx): Overview of the stringToIndex function - \[takeBytes\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/functions/takeBytes.mdx): Overview of the takeBytes function - \[toRecord\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/functions/toRecord.mdx): Overview of the toRecord function - \[toSmartContractAccount\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/functions/toSmartContractAccount.mdx): Converts an account to a smart contract account and sets up various account-related methods using the provided parameters like transport, chain, entry point, and other utilities. - \[unpackSignRawMessageBytes\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/functions/unpackSignRawMessageBytes.mdx): Overview of the unpackSignRawMessageBytes function - \[wrapSignatureWith6492\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/functions/wrapSignatureWith6492.mdx): Overview of the wrapSignatureWith6492 function - \[AccountEntryPointRegistry\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/interfaces/AccountEntryPointRegistry.mdx): Overview of the AccountEntryPointRegistry interface - \[EntryPointDefRegistry\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/interfaces/EntryPointDefRegistry.mdx): Overview of the EntryPointDefRegistry interface - \[EntryPointRegistry\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/interfaces/EntryPointRegistry.mdx): Overview of the EntryPointRegistry interface - \[EntryPointRegistryBase\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/interfaces/EntryPointRegistryBase.mdx): Overview of the EntryPointRegistryBase interface - \[SmartAccountAuthenticator\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/interfaces/SmartAccountAuthenticator.mdx): Extends the SmartAccountSigner interface with authentication. - \[SmartAccountSigner\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/interfaces/SmartAccountSigner.mdx): A signer that can sign messages and typed data. - \[SplitTransportParams\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/interfaces/SplitTransportParams.mdx): Overview of the SplitTransportParams interface - \[UserOperationEstimateGasResponse\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/interfaces/UserOperationEstimateGasResponse.mdx): Overview of the UserOperationEstimateGasResponse interface - \[UserOperationReceipt\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/interfaces/UserOperationReceipt.mdx): Overview of the UserOperationReceipt interface - \[UserOperationRequest\_v6\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/interfaces/UserOperationRequest\_v6.mdx): Overview of the UserOperationRequest\_v6 interface - \[UserOperationRequest\_v7\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/interfaces/UserOperationRequest\_v7.mdx): Overview of the UserOperationRequest\_v7 interface - \[UserOperationResponse\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/interfaces/UserOperationResponse.mdx): Overview of the UserOperationResponse interface - \[UserOperationStruct\_v6\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/interfaces/UserOperationStruct\_v6.mdx): Overview of the UserOperationStruct\_v6 interface - \[UserOperationStruct\_v7\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/interfaces/UserOperationStruct\_v7.mdx): Overview of the UserOperationStruct\_v7 interface - \[Abi\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/Abi.mdx): Contract \[ABI Specification\](https://docs.soliditylang.org/en/latest/abi-spec.html#json) - \[AccountOp\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/AccountOp.mdx): Overview of AccountOp - \[Address\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/Address.mdx): Overview of Address - \[AuthorizationRequest\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/AuthorizationRequest.mdx): Overview of AuthorizationRequest - \[BaseSmartAccountClient\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/BaseSmartAccountClient.mdx): Overview of BaseSmartAccountClient - \[BaseSmartAccountClientActions\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/BaseSmartAccountClientActions.mdx): Overview of BaseSmartAccountClientActions - \[BatchUserOperationCallData\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/BatchUserOperationCallData.mdx): Overview of BatchUserOperationCallData - \[BigNumberish\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/BigNumberish.mdx): Overview of BigNumberish - \[BigNumberishRange\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/BigNumberishRange.mdx): Overview of BigNumberishRange - \[BuildTransactionParameters\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/BuildTransactionParameters.mdx): Overview of BuildTransactionParameters - \[BuildUserOperationFromTransactionsResult\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/BuildUserOperationFromTransactionsResult.mdx): Overview of BuildUserOperationFromTransactionsResult - \[BuildUserOperationParameters\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/BuildUserOperationParameters.mdx): Overview of BuildUserOperationParameters - \[BundlerActions\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/BundlerActions.mdx): Overview of BundlerActions - \[BundlerClient\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/BundlerClient.mdx): Overview of BundlerClient - \[BundlerRpcSchema\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/BundlerRpcSchema.mdx): Overview of BundlerRpcSchema - \[BytesLike\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/BytesLike.mdx): Overview of BytesLike - \[ClientMiddleware\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/ClientMiddleware.mdx): Overview of ClientMiddleware - \[ClientMiddlewareArgs\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/ClientMiddlewareArgs.mdx): Overview of ClientMiddlewareArgs - \[ClientMiddlewareConfig\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/ClientMiddlewareConfig.mdx): Overview of ClientMiddlewareConfig - \[ClientMiddlewareFn\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/ClientMiddlewareFn.mdx): Overview of ClientMiddlewareFn - \[ConnectionConfig\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/ConnectionConfig.mdx): Overview of ConnectionConfig - \[ConnectorData\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/ConnectorData.mdx): Overview of ConnectorData - \[DefaultEntryPointVersion\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/DefaultEntryPointVersion.mdx): Overview of DefaultEntryPointVersion - \[Deferrable\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/Deferrable.mdx): Overview of Deferrable - \[DropAndReplaceUserOperationParameters\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/DropAndReplaceUserOperationParameters.mdx): Overview of DropAndReplaceUserOperationParameters - \[EQ\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/EQ.mdx): Overview of EQ - \[Eip7702ExtendedFields\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/Eip7702ExtendedFields.mdx): Overview of Eip7702ExtendedFields - \[EmptyHex\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/EmptyHex.mdx): Overview of EmptyHex - \[EntryPointDef\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/EntryPointDef.mdx): Overview of EntryPointDef - \[EntryPointParameter\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/EntryPointParameter.mdx): Overview of EntryPointParameter - \[EntryPointVersion\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/EntryPointVersion.mdx): Overview of EntryPointVersion - \[EqualsOneOfTheComponents\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/EqualsOneOfTheComponents.mdx): Overview of EqualsOneOfTheComponents - \[Erc7677Client\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/Erc7677Client.mdx): Overview of Erc7677Client - \[Erc7677MiddlewareParams\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/Erc7677MiddlewareParams.mdx): Overview of Erc7677MiddlewareParams - \[Erc7677RpcSchema\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/Erc7677RpcSchema.mdx): Overview of Erc7677RpcSchema - \[GetAccountAddressParams\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/GetAccountAddressParams.mdx): Overview of GetAccountAddressParams - \[GetAccountParameter\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/GetAccountParameter.mdx): Overview of GetAccountParameter - \[GetContextParameter\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/GetContextParameter.mdx): Overview of GetContextParameter - \[GetEntryPointFromAccount\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/GetEntryPointFromAccount.mdx): Overview of GetEntryPointFromAccount - \[GetEntryPointOptions\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/GetEntryPointOptions.mdx): Overview of GetEntryPointOptions - \[HttpTransport\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/HttpTransport.mdx): Overview of HttpTransport - \[IsMemberOrSubtypeOfAComponent\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/IsMemberOrSubtypeOfAComponent.mdx): Overview of IsMemberOrSubtypeOfAComponent - \[IsOneOf\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/IsOneOf.mdx): Overview of IsOneOf - \[IsUndefined\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/IsUndefined.mdx): Checks if T is - \[MiddlewareClient\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/MiddlewareClient.mdx): Middleware client type - \[Multiplier\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/Multiplier.mdx): Overview of Multiplier - \[Never\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/Never.mdx): Overview of Never - \[NoUndefined\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/NoUndefined.mdx): Constructs a type by excluding from . - \[NotType\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/NotType.mdx): Used to ensure type doesn't extend another, for use in & chaining of properties - \[NullAddress\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/NullAddress.mdx): Overview of NullAddress - \[OneOf\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/OneOf.mdx): Overview of OneOf - \[OptionalFields\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/OptionalFields.mdx): Overview of OptionalFields - \[Prettify\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/Prettify.mdx): Combines members of an intersection into a readable type. - \[PromiseOrValue\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/PromiseOrValue.mdx): Overview of PromiseOrValue - \[RecordableKeys\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/RecordableKeys.mdx): Overview of RecordableKeys - \[RequiredBy\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/RequiredBy.mdx): Overview of RequiredBy - \[SendTransactionsParameters\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/SendTransactionsParameters.mdx): Overview of SendTransactionsParameters - \[SendUserOperationParameters\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/SendUserOperationParameters.mdx): Overview of SendUserOperationParameters - \[SendUserOperationResult\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/SendUserOperationResult.mdx): Overview of SendUserOperationResult - \[SignUserOperationParameters\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/SignUserOperationParameters.mdx): Overview of SignUserOperationParameters - \[SignatureRequest\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/SignatureRequest.mdx): Overview of SignatureRequest - \[SigningMethods\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/SigningMethods.mdx): Overview of SigningMethods - \[SmartAccountClient\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/SmartAccountClient.mdx): Overview of SmartAccountClient - \[SmartAccountClientActions\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/SmartAccountClientActions.mdx): Overview of SmartAccountClientActions - \[SmartAccountClientConfig\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/SmartAccountClientConfig.mdx): Overview of SmartAccountClientConfig - \[SmartAccountClientRpcSchema\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/SmartAccountClientRpcSchema.mdx): Overview of SmartAccountClientRpcSchema - \[SmartContractAccount\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/SmartContractAccount.mdx): Overview of SmartContractAccount - \[SmartContractAccountWithSigner\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/SmartContractAccountWithSigner.mdx): Overview of SmartContractAccountWithSigner - \[SupportedEntryPoint\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/SupportedEntryPoint.mdx): Overview of SupportedEntryPoint - \[ToSmartContractAccountParams\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/ToSmartContractAccountParams.mdx): Overview of ToSmartContractAccountParams - \[UnpackedSignature\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/UnpackedSignature.mdx): Overview of UnpackedSignature - \[UpgradeAccountParams\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/UpgradeAccountParams.mdx): Overview of UpgradeAccountParams - \[UpgradeToAndCallParams\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/UpgradeToAndCallParams.mdx): Overview of UpgradeToAndCallParams - \[UpgradeToData\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/UpgradeToData.mdx): Overview of UpgradeToData - \[UserOperationCallData\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/UserOperationCallData.mdx): Overview of UserOperationCallData - \[UserOperationContext\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/UserOperationContext.mdx): Overview of UserOperationContext - \[UserOperationFeeOptions\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/UserOperationFeeOptions.mdx): Overview of UserOperationFeeOptions - \[UserOperationFeeOptionsField\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/UserOperationFeeOptionsField.mdx): Overview of UserOperationFeeOptionsField - \[UserOperationOverrides\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/UserOperationOverrides.mdx): Overview of UserOperationOverrides - \[UserOperationOverridesParameter\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/UserOperationOverridesParameter.mdx): Overview of UserOperationOverridesParameter - \[UserOperationPaymasterOverrides\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/UserOperationPaymasterOverrides.mdx): Overview of UserOperationPaymasterOverrides - \[UserOperationRequest\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/UserOperationRequest.mdx): Overview of UserOperationRequest - \[UserOperationStruct\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/UserOperationStruct.mdx): Overview of UserOperationStruct - \[WaitForUserOperationTxParameters\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/WaitForUserOperationTxParameters.mdx): Overview of WaitForUserOperationTxParameters - \[WithOptional\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/WithOptional.mdx): Overview of WithOptional - \[WithRequired\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/type-aliases/WithRequired.mdx): Overview of WithRequired - \[ADD\_BREADCRUMB\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/variables/ADD\_BREADCRUMB.mdx): The symbol that is used to add a breadcrumb to the headers. Is an optional function that is used to add a breadcrumb to the headers. - \[BigNumberishRangeSchema\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/variables/BigNumberishRangeSchema.mdx): Overview of BigNumberishRangeSchema - \[BigNumberishSchema\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/variables/BigNumberishSchema.mdx): Overview of BigNumberishSchema - \[ChainSchema\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/variables/ChainSchema.mdx): Overview of ChainSchema - \[ConnectionConfigSchema\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/variables/ConnectionConfigSchema.mdx): Overview of ConnectionConfigSchema - \[EntryPointAbi\_v6\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/variables/EntryPointAbi\_v6.mdx): Overview of EntryPointAbi\_v6 - \[EntryPointAbi\_v7\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/variables/EntryPointAbi\_v7.mdx): Overview of EntryPointAbi\_v7 - \[HexSchema\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/variables/HexSchema.mdx): Overview of HexSchema - \[MultiplierSchema\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/variables/MultiplierSchema.mdx): Overview of MultiplierSchema - \[SignerSchema\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/variables/SignerSchema.mdx): Overview of SignerSchema - \[SimpleAccountAbi\_v6\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/variables/SimpleAccountAbi\_v6.mdx): Overview of SimpleAccountAbi\_v6 - \[SimpleAccountAbi\_v7\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/variables/SimpleAccountAbi\_v7.mdx): Overview of SimpleAccountAbi\_v7 - \[SimpleAccountFactoryAbi\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/variables/SimpleAccountFactoryAbi.mdx): Overview of SimpleAccountFactoryAbi - \[SmartAccountClientOptsSchema\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/variables/SmartAccountClientOptsSchema.mdx): Overview of SmartAccountClientOptsSchema - \[TRACE\_HEADER\_NAME\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/variables/TRACE\_HEADER\_NAME.mdx): These are the headers that are used in the trace headers, could be found in the spec - \[TRACE\_HEADER\_STATE\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/variables/TRACE\_HEADER\_STATE.mdx): These are the headers that are used in the trace headers, could be found in the spec - \[bundlerActions\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/variables/bundlerActions.mdx): A viem client decorator that provides Bundler specific actions. These actions include estimating gas for user operations, sending raw user operations, retrieving user operations by hash, getting supported entry points, and getting user operation receipts. NOTE: this is already added to the client returned from \`createBundlerClient\` - \[createBundlerClientFromExisting\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/variables/createBundlerClientFromExisting.mdx): Creates a bundler client from an existing public client with the provided transport and chain. - \[default7702GasEstimator\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/variables/default7702GasEstimator.mdx): A middleware function to estimate the gas usage of a user operation when using an EIP-7702 delegated account. Has an optional custom gas estimator. This function is only compatible with accounts using EntryPoint v0.7.0, and the account must have an implementation address defined in \`getImplementationAddress()\`. - \[default7702UserOpSigner\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/variables/default7702UserOpSigner.mdx): Provides a default middleware function for signing user operations with a client account when using EIP-7702 delegated accounts. If the signer doesn't support \`signAuthorization\`, then this just runs the provided \`signUserOperation\` middleware. This function is only compatible with accounts using EntryPoint v0.7.0, and the account must have an implementation address defined in \`getImplementationAddress()\`. - \[defaultEntryPointVersion\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/variables/defaultEntryPointVersion.mdx): Overview of defaultEntryPointVersion - \[defaultGasEstimator\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/variables/defaultGasEstimator.mdx): Description default gas estimator middleware for \`SmartAccountClient\` You can override this middleware with your custom gas estimator middleware by passing it to the client constructor - \[defaultPaymasterAndData\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/variables/defaultPaymasterAndData.mdx): Middleware function that sets the \`paymasterAndData\` field in the given struct based on the entry point version of the account. This is the default used by \`createSmartAccountClient\` and is not necessary to be used directly. - \[defaultUserOpSigner\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/variables/defaultUserOpSigner.mdx): Provides a default middleware function for signing user operations with a client account. This function validates the request and adds the signature to it. This is already included in the client returned from \`createSmartAccountClient\` - \[entryPointRegistry\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/variables/entryPointRegistry.mdx): Overview of entryPointRegistry - \[minPriorityFeePerBidDefaults\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/variables/minPriorityFeePerBidDefaults.mdx): Overview of minPriorityFeePerBidDefaults - \[noopMiddleware\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/variables/noopMiddleware.mdx): Noop middleware that does nothing and passes the arguments through - \[smartAccountClientActions\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/variables/smartAccountClientActions.mdx): Provides a set of smart account client actions to decorate the provided client. These actions include building and signing user operations, sending transactions, and more. NOTE: this is already added to clients returned from \`createSmartAccountClient\` - \[smartAccountClientMethodKeys\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/variables/smartAccountClientMethodKeys.mdx): Overview of smartAccountClientMethodKeys - \[waitForUserOperationTransaction\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/variables/waitForUserOperationTransaction.mdx): Waits for a user operation transaction to be confirmed by checking the receipt periodically until it is found or a maximum number of retries is reached. - \[webauthnGasEstimator\](https://alchemy.com/docs/wallets/reference/aa-sdk/core/variables/webauthnGasEstimator.mdx): A middleware function to estimate the gas usage of a user operation when using a Modular Account V2 WebAuthn account. Has an optional custom gas estimator. This function is only compatible with accounts using EntryPoint v0.7.0, and the account must have an implementation address defined in \`getImplementationAddress()\`. - \[aa-sdk/ethers\](https://alchemy.com/docs/wallets/reference/aa-sdk/ethers.mdx): Overview of aa-sdk/ethers - \[AccountSigner\](https://alchemy.com/docs/wallets/reference/aa-sdk/ethers/classes/AccountSigner.mdx): Implementation of the ethers Signer interface to use with Smart Contract Accounts - \[EthersProviderAdapter\](https://alchemy.com/docs/wallets/reference/aa-sdk/ethers/classes/EthersProviderAdapter.mdx): Lightweight Adapter for SmtAccountProvider to enable Signer Creation - \[convertEthersSignerToAccountSigner\](https://alchemy.com/docs/wallets/reference/aa-sdk/ethers/functions/convertEthersSignerToAccountSigner.mdx): Overview of the convertEthersSignerToAccountSigner function - \[convertWalletToAccountSigner\](https://alchemy.com/docs/wallets/reference/aa-sdk/ethers/functions/convertWalletToAccountSigner.mdx): Overview of the convertWalletToAccountSigner function - \[account-kit/core\](https://alchemy.com/docs/wallets/reference/account-kit/core.mdx): Overview of account-kit/core - \[ClientOnlyPropertyError\](https://alchemy.com/docs/wallets/reference/account-kit/core/classes/ClientOnlyPropertyError.mdx): Error thrown when a client only property is accessed on the server - \[InvalidAggregatedSignatureError\](https://alchemy.com/docs/wallets/reference/account-kit/core/classes/InvalidAggregatedSignatureError.mdx): Error thrown when the aggregated signature is invalid - \[InvalidContextSignatureError\](https://alchemy.com/docs/wallets/reference/account-kit/core/classes/InvalidContextSignatureError.mdx): Error thrown when the context signature is invalid - \[MultisigAccountExpectedError\](https://alchemy.com/docs/wallets/reference/account-kit/core/classes/MultisigAccountExpectedError.mdx): Error thrown when the expected account is not a multisig modular account - \[MultisigMissingSignatureError\](https://alchemy.com/docs/wallets/reference/account-kit/core/classes/MultisigMissingSignatureError.mdx): Error thrown when a multisig user op is missing a signature - \[SessionKeyPermissionsBuilder\](https://alchemy.com/docs/wallets/reference/account-kit/core/classes/SessionKeyPermissionsBuilder.mdx): A builder for creating the hex-encoded data for updating session key permissions. - \[SessionKeySigner\](https://alchemy.com/docs/wallets/reference/account-kit/core/classes/SessionKeySigner.mdx): A simple session key signer that uses localStorage or sessionStorage to store a private key. If the key is not found, it will generate a new one and store it in the storage. - \[SessionKeyAccessListType\](https://alchemy.com/docs/wallets/reference/account-kit/core/enumerations/SessionKeyAccessListType.mdx): Overview of SessionKeyAccessListType - \[SimulateAssetType\](https://alchemy.com/docs/wallets/reference/account-kit/core/enumerations/SimulateAssetType.mdx): Overview of SimulateAssetType - \[SimulateChangeType\](https://alchemy.com/docs/wallets/reference/account-kit/core/enumerations/SimulateChangeType.mdx): Overview of SimulateChangeType - \[alchemy\](https://alchemy.com/docs/wallets/reference/account-kit/core/functions/alchemy.mdx): Overview of the alchemy function - \[alchemyGasAndPaymasterAndDataMiddleware\](https://alchemy.com/docs/wallets/reference/account-kit/core/functions/alchemyGasAndPaymasterAndDataMiddleware.mdx): Overview of the alchemyGasAndPaymasterAndDataMiddleware function - \[alchemyGasManagerMiddleware\](https://alchemy.com/docs/wallets/reference/account-kit/core/functions/alchemyGasManagerMiddleware.mdx): Overview of the alchemyGasManagerMiddleware function - \[alchemyUserOperationSimulator\](https://alchemy.com/docs/wallets/reference/account-kit/core/functions/alchemyUserOperationSimulator.mdx): Overview of the alchemyUserOperationSimulator function - \[buildSessionKeysToRemoveStruct\](https://alchemy.com/docs/wallets/reference/account-kit/core/functions/buildSessionKeysToRemoveStruct.mdx): Overview of the buildSessionKeysToRemoveStruct function - \[combineSignatures\](https://alchemy.com/docs/wallets/reference/account-kit/core/functions/combineSignatures.mdx): Overview of the combineSignatures function - \[convertSignerStatusToState\](https://alchemy.com/docs/wallets/reference/account-kit/core/functions/convertSignerStatusToState.mdx): Overview of the convertSignerStatusToState function --- # Changelog | Alchemy Docs Changelog ========= Stay in touch with new updates and improvements in the Alchemy ecosystem. [February 5, 2026](https://www.alchemy.com/docs/changelog/2026/2/5) Node ---- * Made Citrea Mainnet public * Made Sui Mainnet and Testnet public **Upgrades** * Megaeth Mainnet: Megaeth v2.0.13 * Base Mainnet: Opnode [op-node/v1.16.5](https://github.com/ethereum-optimism/optimism/releases/tag/op-node%2Fv1.16.5) , Reth [v0.2.2](https://github.com/base/node-reth/releases/tag/v0.2.2) * Base Sepolia: Reth [v0.2.2](https://github.com/base/node-reth/releases/tag/v0.2.2) * Monad Mainnet: Monad [0.12.7](https://github.com/category-labs/monad/tree/main) * Polygon Mainnet: Bor [v2.5.8](https://github.com/0xPolygon/bor/releases/tag/v2.5.8) * Sei Mainnet: Seid [v6.3.1](https://github.com/sei-protocol/sei-chain/releases/tag/v6.3.1) * Story Aeneid: Geth [v1.2.0](https://github.com/piplabs/story-geth/releases/tag/v1.2.0) , Story [v1.5.2](https://github.com/piplabs/story/releases/tag/v1.5.2) * Story Mainnet: Geth [v1.2.0](https://github.com/piplabs/story-geth/releases/tag/v1.2.0) , Story [v1.5.2](https://github.com/piplabs/story/releases/tag/v1.5.2) [January 29, 2026](https://www.alchemy.com/docs/changelog/2026/1/29) Node ---- **Upgrades** * Megaeth Mainnet: Megaeth v2.0.12 * Polygon Amoy: Heimdall [v0.6.0](https://github.com/0xPolygon/heimdall-v2/releases/tag/v0.6.0) * Polygon Mainnet: Heimdall [v0.6.0](https://github.com/0xPolygon/heimdall-v2/releases/tag/v0.6.0) * Sui Mainnet: Sui [mainnet-v1.64.1](https://github.com/MystenLabs/sui/releases/tag/mainnet-v1.64.1) [January 22, 2026](https://www.alchemy.com/docs/changelog/2026/1/22) Data ---- * Improved the [getOwnersForNFT](https://www.alchemy.com/docs/reference/nft-api-endpoints/nft-api-endpoints/nft-ownership-endpoints/get-owners-for-nft-v-3) endpoint to support CryptoPunks 4-digit hex token ID format. Node ---- **Upgrades** * Avalanche Mainnet: Avalanchego [v1.14.1](https://github.com/ava-labs/avalanchego/releases/tag/v1.14.1) * Celo Mainnet: Opnode celo-v2.1.1, Opgeth [celo-v2.1.3](https://github.com/celo-org/op-geth/releases/tag/celo-v2.1.3) * Eth Sepolia: Reth [v1.9.3](https://github.com/paradigmxyz/reth/releases/tag/v1.9.3) , Lighthouse [v8.0.1](https://github.com/sigp/lighthouse/releases/tag/v8.0.1) * Scroll Mainnet: Scroll [scroll-v5.10.2](https://hub.docker.com/layers/scrolltech/l2geth/scroll-v5.10.2/images/sha256-91582c10889ad4675f2d142787ba57f70a7f06f845b954ae21c745947eaf07d8) * Scroll Sepolia: Scroll [scroll-v5.10.2](https://hub.docker.com/layers/scrolltech/l2geth/scroll-v5.10.2/images/sha256-91582c10889ad4675f2d142787ba57f70a7f06f845b954ae21c745947eaf07d8) * Unichain Mainnet: Op Node [op-node/v1.16.5](https://github.com/ethereum-optimism/optimism/releases/tag/op-node%2Fv1.16.5) * Unichain Sepolia: Op Node [op-node/v1.16.5](https://github.com/ethereum-optimism/optimism/releases/tag/op-node%2Fv1.16.5) * Megaeth Mainnet: Megaeth v2.0.10 * Megaeth Testnet: Megaeth v2.0.10 [January 15, 2026](https://www.alchemy.com/docs/changelog/2026/1/15) Rollups ------- * Added capability to scale sequencers out with faster CPU hardware. Node ---- **Updates** * [Tempo Moderato](https://www.alchemy.com/docs/reference/tempo-api-quickstart) is now public. * [MegaETH Mainnet](https://www.alchemy.com/docs/reference/megaeth-api-quickstart) is now public. **Upgrades** * Base Mainnet: Reth [v0.2.2](https://github.com/base/node-reth/releases/tag/v0.2.2) , Opgeth [v1.101605.0](https://github.com/ethereum-optimism/op-geth/releases/tag/v1.101605.0) , Op Node [op-node/v1.16.2](https://github.com/ethereum-optimism/optimism/releases/tag/op-node%2Fv1.16.2) * Base Sepolia: Opgeth [v1.101605.0](https://github.com/ethereum-optimism/op-geth/releases/tag/v1.101605.0) , Opnode [op-node/v1.16.2](https://github.com/ethereum-optimism/optimism/releases/tag/op-node%2Fv1.16.2) * Bsc Mainnet: Geth [v1.6.6](https://github.com/bnb-chain/bsc/releases/tag/v1.6.6) * Eth Mainnet: Geth [v1.16.8](https://github.com/sigp/lighthouse/releases/tag/v8.0.1) , Lighthouse [v8.0.1](https://github.com/sigp/lighthouse/releases/tag/v8.0.1) * Eth Sepolia: Geth [v1.16.6](https://github.com/sigp/lighthouse/releases/tag/v8.0.0-rc.1) , Lighthouse [v8.0.0-rc.1](https://github.com/sigp/lighthouse/releases/tag/v8.0.0-rc.1) * Mantle Mainnet: Opnode [v1.4.2](https://github.com/mantlenetworkio/networks/releases/tag/v1.4.2) , Opgeth [v1.4.2](https://github.com/mantlenetworkio/networks/releases/tag/v1.4.2) * Polygon Amoy: Heimdall [v0.5.6](https://github.com/0xPolygon/heimdall-v2/releases/tag/v0.5.6) , Erigon [v3.3.7](https://github.com/0xPolygon/erigon/releases/tag/v3.3.7) , Bor [v2.5.7](https://github.com/maticnetwork/bor/releases/tag/v2.5.7) * Polygon Mainnet: Heimdall [v0.5.6](https://github.com/0xPolygon/heimdall-v2/releases/tag/v0.5.6) , Bor [v2.5.7](https://github.com/0xPolygon/bor/releases/tag/v2.5.7) * Soneium Mainnet: Op Node [op-node/v1.16.5](https://github.com/ethereum-optimism/optimism/releases/tag/op-node%2Fv1.16.5) * Soneium Sepolia: Op Node [op-node/v1.16.5](https://github.com/ethereum-optimism/optimism/releases/tag/op-node%2Fv1.16.5) * Starknet Mainnet: Starknet [v0.21.5](https://github.com/eqlabs/pathfinder/releases/tag/v0.21.5) * Starknet Sepolia: Starknet [v0.21.5](https://github.com/eqlabs/pathfinder/releases/tag/v0.21.5) * Story Mainnet: Geth [v1.2.0](https://github.com/piplabs/story-geth/releases/tag/v1.2.0) , Story [v1.4.2](https://github.com/piplabs/story/releases/tag/v1.4.2) * Worldchain Mainnet: Op Node [op-node/v1.16.5](https://github.com/ethereum-optimism/optimism/releases/tag/op-node%2Fv1.16.5) * Worldchain Sepolia: Op Node [op-node/v1.16.5](https://github.com/ethereum-optimism/optimism/releases/tag/op-node%2Fv1.16.5) [January 8, 2026](https://www.alchemy.com/docs/changelog/2026/1/8) Node ---- **Upgrades** * Astar Mainnet: Runtime [runtime-2000](https://github.com/AstarNetwork/Astar/releases/tag/runtime-2000) * Opbnb Mainnet: Opgeth [v0.5.9](https://github.com/bnb-chain/op-geth/releases/tag/v0.5.9) , Opnode [v0.5.5](https://github.com/bnb-chain/opbnb/releases/tag/v0.5.5) * Polygon Amoy: Heimdall [v0.5.4](https://github.com/0xPolygon/heimdall-v2/releases/tag/v0.5.4) , Erigon [v3.3.6-beta3](https://github.com/0xPolygon/erigon/releases/tag/v3.3.6-beta3) , Bor [v2.5.6-beta6](https://github.com/maticnetwork/bor/releases/tag/v2.5.6-beta6) * Solana Mainnet: Solana [v3.0.12](https://github.com/anza-xyz/agave/releases/tag/v3.0.12) , Yellowstone Grpc Plugin [v9.0.0+solana.2.3.6](https://github.com/rpcpool/yellowstone-grpc/releases/tag/v9.0.0%2Bsolana.2.3.6) [December 25, 2025](https://www.alchemy.com/docs/changelog/2025/12/25) Node ---- **Upgrades** * Arbitrum Mainnet: Arbitrum [v3.9.4-7f582c3](https://github.com/OffchainLabs/nitro/releases/tag/v3.9.4) * Provisioning Ephemeral: Erigon [v3.3.2](https://github.com/erigontech/erigon/releases/tag/v3.3.2) * Zetachain Mainnet: Zetacored [v36.1.5](https://github.com/zeta-chain/node/releases/tag/v36.1.5) [December 18, 2025](https://www.alchemy.com/docs/changelog/2025/12/18) Rollups ------- * Mythical Games launching their first set of in-game items on Mythos Mainnet, using the rollup to power their NFT marketplace for popular mobile games like NFL Rivals. * World launched a redesigned World App with new features including the ability to receive paychecks directly in the app and pay merchants using a Visa card that debits from World App accounts. * XMTP launched encrypted messaging on the World App, powering [World Chat](https://world.org/blog/announcements/the-new-world-app-secure-chat-global-payments-and-mini-apps-for-everyone) . * XMTP launched on Base App, bringing encrypted messaging capabilities to the platform. Node ---- **Upgrades** * Aptos Mainnet: Aptos [aptos-node-v1.38.5](https://github.com/aptos-labs/aptos-core/releases/tag/aptos-node-v1.38.5) * Bsc Mainnet: Reth [v0.0.6-beta](https://github.com/bnb-chain/reth-bsc/releases/tag/v0.0.6-beta) * Polygon Amoy: Heimdall [v0.5.3](https://github.com/0xPolygon/heimdall-v2/releases/tag/v0.5.3) , Bor [v2.5.5](https://github.com/maticnetwork/bor/releases/tag/v2.5.5) * Polygon Mainnet: Bor [v2.5.6-beta3](https://github.com/0xPolygon/bor/releases/tag/v2.5.6-beta3) , Heimdall [v0.5.3](https://github.com/0xPolygon/heimdall-v2/releases/tag/v0.5.3) [December 11, 2025](https://www.alchemy.com/docs/changelog/2025/12/11) Legacy endpoint shutdown notice We will be shutting down our legacy RPC endpoint `alchemyapi.io` on January 31, 2026. This endpoint was originally deprecated in 2021, and you are likely not impacted by this change. However, if your app is still making RPC requests to this legacy endpoint, please migrate to our current endpoint, `g.alchemy.com`, which offers significant latency improvements while maintaining the same authentication model and API functionality. No other changes are required beyond updating the endpoint URL in your calls. If you are using the Ethers.js package, please ensure you are running [v6.16.0](https://github.com/ethers-io/ethers.js/blob/main/CHANGELOG.md#ethersv6160-2025-12-02-1947) or later, which routes requests through the current `g.alchemy.com` domain. After the shutdown date, all requests to `alchemyapi.io` will return HTTP 410 – Gone, and no Compute Units (CUs) will be billed for calls made to the deprecated endpoint. Node ---- **Updates** * [ADI Mainnet](https://www.alchemy.com/docs/reference/adi-api-quickstart) is now public 🎉 **Upgrades** * Bsc Mainnet: Erigon [v1.4.3](https://github.com/node-real/bsc-erigon/releases/tag/v1.4.3) , Geth [v1.6.4](https://github.com/bnb-chain/bsc/releases/tag/v1.6.4) * Celestia Mainnet: Celestia [v0.28.4](https://github.com/celestiaorg/celestia-node/releases/tag/v0.28.4) * Polygon Amoy: Bor [v2.5.3](https://github.com/maticnetwork/bor/releases/tag/v2.5.3) , Heimdall [v0.5.2](https://github.com/0xPolygon/heimdall-v2/releases/tag/v0.5.2) * Polygon Mainnet: Heimdall [v0.5.2](https://github.com/0xPolygon/heimdall-v2/releases/tag/v0.5.2) , Bor [v2.5.3](https://github.com/0xPolygon/bor/releases/tag/v2.5.3) * Scroll Mainnet: Scroll scroll-v5.10.0 * Scroll Sepolia: Scroll scroll-v5.10.0 * Story Mainnet: Geth [v1.1.1](https://github.com/piplabs/story-geth/releases/tag/v1.1.1) , Story [v1.4.1](https://github.com/piplabs/story/releases/tag/v1.4.1) [December 4, 2025](https://www.alchemy.com/docs/changelog/2025/12/4) Developer Experience -------------------- **Docs** * Shipped a comprehensive revamp of the [Solana documentation](https://www.alchemy.com/docs/solana) with improved navigation, updated content, and new developer tools. * Completely refreshed the [Solana Quickstart Guide](https://www.alchemy.com/docs/solana) with a streamlined onboarding flow, tested working scripts for sending requests, creating and funding wallets, and a full breakdown of all supported Solana methods organized by category. * Published two brand-new tutorials with fresh, working code repositories that walk developers through building live, functioning sample apps—replacing the previous outdated guides. * Introduced a new [Compute Unit (CU) Calculator](https://solana-demo-sigma.vercel.app/) to help developers understand how many CUs their integrated methods require and plan their usage accordingly. * Updated the Solana FAQ with a methods-by-category breakdown, making it easier to discover what's supported and what you can build with each method. Rollups ------- * Launched Mythos Mainnet for Mythical Games, our first OP Stack Layer 3 rollup. Mythical Games will use this rollup to power in-game NFT items and their marketplace for popular mobile games like NFL Rivals. * Shipped support for the Fusaka activation on Ethereum Mainnet, enabling rollups with Ethereum Mainnet as the parent chain to continue sequencing after the network upgrade. Node ---- **Upgrades** * Arbitrum Mainnet: Arbitrum [v3.9.3-8bc5554](https://hub.docker.com/layers/offchainlabs/nitro-node/v3.9.3-8bc5554) * Arbitrum Nova: Arbitrum [v3.9.3-8bc5554](https://hub.docker.com/layers/offchainlabs/nitro-node/v3.9.3-8bc5554) * Arbitrum One: Arbitrum [v3.9.3-8bc5554](https://hub.docker.com/layers/offchainlabs/nitro-node/v3.9.3-8bc5554) * Arbitrum Sepolia: Arbitrum [v3.9.3-8bc5554](https://hub.docker.com/layers/offchainlabs/nitro-node/v3.9.3-8bc5554) * Base Mainnet: Opgeth [v1.101603.5](https://github.com/ethereum-optimism/op-geth/releases/tag/v1.101603.5) , Opnode [op-node/v1.16.2](https://github.com/ethereum-optimism/optimism/releases/tag/op-node%2Fv1.16.2) , Reth [v1.9.3](https://github.com/paradigmxyz/reth/releases/tag/v1.9.3) * Gnosis Chiado: Erigon [v3.2.2](https://github.com/erigontech/erigon/releases/tag/v3.2.2) * Ink Mainnet: Op Node [op-node/v1.16.2](https://github.com/ethereum-optimism/optimism/releases/tag/op-node%2Fv1.16.2) * Mantle Sepolia: Opnode [v1.4.1](https://github.com/mantlenetworkio/networks/releases/tag/v1.4.1) , Opgeth [v1.4.1](https://github.com/mantlenetworkio/networks/releases/tag/v1.4.1) * Optimism Mainnet: Op Node [op-node/v1.16.2](https://github.com/ethereum-optimism/optimism/releases/tag/op-node%2Fv1.16.2) * Polygon Mainnet: Erigon [v3.3.2](https://github.com/0xPolygon/erigon/releases/tag/v3.3.2) , Bor [v2.5.2](https://github.com/0xPolygon/bor/releases/tag/v2.5.2) * Scroll Sepolia: Scroll [scroll-v5.9.18](https://hub.docker.com/layers/scrolltech/l2geth/scroll-v5.9.18) * Sonic Mainnet: Sonic [v2.1.4](https://github.com/0xsoniclabs/sonic/releases/tag/v2.1.4) * Starknet Mainnet: Starknet [v0.21.3](https://github.com/eqlabs/pathfinder/releases/tag/v0.21.3) * Starknet Sepolia: Starknet [v0.21.3](https://github.com/eqlabs/pathfinder/releases/tag/v0.21.3) * Worldchain Sepolia: Op Node [op-node/v1.16.2](https://github.com/ethereum-optimism/optimism/releases/tag/op-node%2Fv1.16.2) [November 27, 2025](https://www.alchemy.com/docs/changelog/2025/11/27) Node ---- **Upgrades** * Polygon Amoy: Erigon [v3.3.1-beta3](https://github.com/0xPolygon/erigon/releases/tag/v3.3.1-beta3) , Bor [v2.5.2-beta2](https://github.com/maticnetwork/bor/releases/tag/v2.5.2-beta2) , Heimdall [v0.5.1-beta](https://github.com/0xPolygon/heimdall-v2/releases/tag/v0.5.1-beta) * Unichain Mainnet: Op Node [op-node/v1.16.2](https://github.com/ethereum-optimism/optimism/releases/tag/op-node%2Fv1.16.2) * Worldchain Mainnet:Op Reth [v1.9.3](https://github.com/paradigmxyz/reth/releases/tag/v1.9.3) Load More --- # Alchemy Quickstart Guide | Alchemy Docs Copy page Alchemy Quickstart Guide ======================== Let's get started \_fast\_! Learn how to create an Alchemy key, make your first request, setup up Alchemy as your client, and get to building. Getting Started =============== 👋 _New to Alchemy? Get access to Alchemy for free_ _**[here](https://dashboard.alchemy.com/signup?utm_source=docs&utm_medium=referral&utm_content=alchemy-quickstart-guide) **_. 📋 Steps to get started with Alchemy ------------------------------------ 1. [Create an Alchemy API Key](https://www.alchemy.com/docs/create-an-api-key) 2. [Make Your First Request](https://www.alchemy.com/docs/make-your-first-request) 3. [Set up Alchemy with Viem](https://www.alchemy.com/docs/set-up-alchemy-with-viem) 4. [Use Alchemy with any Library via AI](https://www.alchemy.com/docs/alchemy-via-libraries) 💻 Start Building! ------------------ Don't know where to start? Check out the tutorials below to get more familiar, at a deeper level, with Alchemy and blockchain development: 1. Learn [How to Send Transactions on Ethereum](https://www.alchemy.com/docs/how-to-send-transactions-on-ethereum) 2. Try deploying your first [Hello World Smart Contract](https://www.alchemy.com/docs/hello-world-smart-contract) and get your hands dirty with some solidity programming! Was this page helpful? YesNo --- # Subscription API Overview | Alchemy Docs Copy page Subscription API Overview ========================= Learn how to subscribe to pending transactions, log events, new blocks and more using WebSockets on Ethereum, Polygon, Arbitrum, and Optimism. Getting Started =============== The primary way to use the Subscription API or WebSockets is through standard JSON-RPC methods. See the [Using JSON-RPC Requests section](https://www.alchemy.com/docs/reference/subscription-api#using-json-rpc-requests-to-access-websockets) below to get started. Subscription API Endpoints ========================== For a full list of Subscription API endpoints and supported chains see the [Subscription API Endpoints](https://www.alchemy.com/docs/reference/subscription-api-endpoints) doc. Below are the subscription endpoints available and the corresponding docs for each of them. Note: `alchemy_minedTransactions` and `alchemy_pendingTransactions` are only supported on the following: Ethereum, Arbitrum, Polygon and Optimism. | Subscription Type | Description | | --- | --- | | [alchemy\_minedTransactions](https://www.alchemy.com/docs/reference/alchemy-minedtransactions) | Emits full transaction objects or hashes that are mined on the network based on provided filters and block tags. | | [alchemy\_pendingTransactions](https://www.alchemy.com/docs/reference/alchemy-pendingtransactions) | Emits full transaction objects or hashes that are sent to the network, marked as "pending", based on provided filters. | | [newPendingTransactions](https://www.alchemy.com/docs/reference/newpendingtransactions) | Emits transaction hashes that are sent to the network and marked as "pending". | | [newHeads](https://www.alchemy.com/docs/reference/newheads) | Emits new blocks that are added to the blockchain. | | [logs](https://www.alchemy.com/docs/reference/logs) | Emits logs attached to a new block that match certain topic filters. | | [monadNewHeads](https://www.alchemy.com/docs/reference/monadnewheads) | Fires a notification each time as soon as a block is Proposed and the node has a chance to speculatively execute. | | [monadLogs](https://www.alchemy.com/docs/reference/monadlogs) | Emits logs attached to a new block that match certain topic filters as soon as the block is Proposed and the node has a chance to speculatively execute. | What are WebSockets and how do they differ from HTTP? ===================================================== WebSockets is a bidirectional communication protocol that maintains a network connection between a server and a client. Unlike HTTP, with WebSockets clients don't need to continuously make requests when they want information. Instead, an open WebSocket connection can push network updates to clients by allowing them to subscribe to certain network states, such as new transactions or blocks being added to the blockchain. Using JSON-RPC Requests to Access WebSockets -------------------------------------------- The `eth_subscribe` and `eth_unsubscribe` JSON-RPC methods allow you to access WebSockets. To begin, open a WebSocket using the WebSocket URL for your app. You can find your app's WebSocket URL by opening the app's page in [your dashboard](https://dashboard.alchemy.com/signup?utm_source=docs&utm_medium=referral&utm_content=reference_subscription-api) and clicking "View Key". Note that your app's URL for WebSockets is different from its URL for HTTP requests, but both can be found in the app's "Network" tab. ![](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764180092%2Fdocs%2Fapi-reference%2Fwebsockets%2F2cbc56a-image.png&w=3840&q=75) Next, install a command line tool for making WebSocket requests such as [wscat](https://github.com/websockets/wscat) . Using `wscat`, you can send requests as follows: Shell $ wscat -c wss://eth-mainnet.ws.g.alchemy.com/v2/demo // create subscription > {"id": 1, "method": "eth_subscribe", "params": ["newHeads"]} < {"jsonrpc":"2.0","id":1,"result":"0xcd0c3e8af590364c09d0fa6a1210faf5"} // incoming notifications < {"jsonrpc":"2.0","method":"eth_subscription","params":{"subscription":"0xcd0c3e8af590364c09d0fa6a1210faf5","result":{"difficulty":"0xd9263f42a87",<...>, "uncles":[]}}} < {"jsonrpc":"2.0","method":"eth_subscription","params":{"subscription":"0xcd0c3e8af590364c09d0fa6a1210faf5","result":{"difficulty":"0xd90b1a7ad02", <...>, "uncles":["0x80aacd1ea4c9da32efd8c2cc9ab38f8f70578fcd46a1a4ed73f82f3e0957f936"]}}} // cancel subscription > {"id": 1, "method": "eth_unsubscribe", "params": ["0xcd0c3e8af590364c09d0fa6a1210faf5"]} < {"jsonrpc":"2.0","id":1,"result":true} **Don't Use HTTP Methods Over WebSockets!** Though it's currently possible to send all your HTTP requests over Websockets, we discourage our developers from doing so. Instead, you should only send `eth_subscribe` and `eth_unsubscribe` requests to WebSockets. This is for several reasons: * You won't receive HTTP status codes in WebSockets responses, which can be useful and actionable. * Because individual HTTP requests are load-balanced in our infrastructure to the fastest possible server, you'll add additional latency by sending JSON-RPC requests over WebSockets. * WebSockets client-side handling has many tricky edge cases and silent failure modes, which can make your dApp less stable. WebSocket Limits ================ The following limits apply for WebSocket connections: * There is a limit of **100 WebSocket connections** for the FREE tier and **2,000 WebSocket connections** for all other tiers. * There is a limit of **1,000 unique subscriptions** per WebSocket connection. * The maximum size of a JSON-RPC `batch` request that can be sent over a WebSocket connection is 1000 * The maximum number of concurrent JSON-RPC requests (i.e. requests awaiting responses) on a single WebSocket connection is 200 * * * Error Codes =========== | Error Code | Error Message | Solution | | --- | --- | --- | | `32600` | `"Sorry, the maximum batch request size is 1000. Please reduce the size of your request and try again."` | Occurs when user attempts to send high-volume JSON-RPC traffic over Websockets. We recommend this traffic be sent over HTTP instead to optimize server backends. | | `1008` | `"WebSocket connection limit reached for this app. Please close existing connections and try again."` | Triggered when the number of open WebSocket connections for the app reaches the allowed limit. Close unused connections to restore access. | | `1008` | `"This app has exceeded its limit of open WebSockets. Please close some other connections first."` | Triggered when the team previously exceeded the limit and tries to reconnect again before the backoff interval expires. Close existing connections and wait. | | `1008` | `"You have exceeded the maximum number of concurrent requests on a single WebSocket. At most 200 concurrent requests are allowed per WebSocket."` | Triggered when a client has too many pending JSON-RPC requests on a single WebSocket. Ensure each request completes before sending more. | | `32603` | `"You have exceeded the maximum number of subscriptions on a single WebSocket."` | Triggered when a client has too many subscriptions on a single WebSocket. Unsubscribe before creating new subscriptions. | Was this page helpful? YesNo --- # Webhooks Quickstart | Alchemy Docs Copy page Webhooks Quickstart =================== Fast, consistent, and custom push notifications! Getting Started =============== To start building with webhooks: 1. Select the right webhook type 2. Create a webhook listener 3. Create and test your webhook Select the right webhook type ----------------------------- * If you’re interested in tracking transfers on a set of wallets, (< 100K wallets), get started with our [Address Activity webhooks](https://www.alchemy.com/docs/reference/address-activity-webhook) ! * If you’re interested in tracking transfers of a particular NFT, an NFT collection, or all NFTs for a chain, use the [NFT Activity webhooks](https://www.alchemy.com/docs/reference/nft-activity-webhook) ! * For all other use cases, we recommend leveraging our [Custom webhooks](https://www.alchemy.com/docs/reference/custom-webhook) ! Create a webhook listener ------------------------- Webhook listeners receive requests and process event data. The listener responds to the Alchemy server with a `200` status code once it successfully receives the webhook event. Your webhook listener can be a simple server or Slack integration to receive the webhook listener data. After setting up the webhooks in your Alchemy dashboard (or programmatically) use the starter code in JavaScript, Python, Go, and Rust below. typescript python go rust import express from "express"; import { getRequiredEnvVar, setDefaultEnvVar } from "./envHelpers"; import { addAlchemyContextToRequest, validateAlchemySignature, AlchemyWebhookEvent, } from "./webhooksUtil"; async function main(): Promise { const app = express(); setDefaultEnvVar("PORT", "8080"); setDefaultEnvVar("HOST", "127.0.0.1"); setDefaultEnvVar("SIGNING_KEY", "whsec_test"); const port = +getRequiredEnvVar("PORT"); const host = getRequiredEnvVar("HOST"); const signingKey = getRequiredEnvVar("SIGNING_KEY"); // Middleware needed to validate the alchemy signature app.use( express.json({ verify: addAlchemyContextToRequest, }) ); app.use(validateAlchemySignature(signingKey)); // Register handler for Alchemy Notify webhook events // TODO: update to your own webhook path app.post("/webhook-path", (req, res) => { const webhookEvent = req.body as AlchemyWebhookEvent; // Do stuff with with webhook event here! console.log(`Processing webhook event id: ${webhookEvent.id}`); // Be sure to respond with 200 when you successfully process the event res.send("Alchemy Webhooks are the best!"); }); // Listen to Alchemy Notify webhook events app.listen(port, host, () => { console.log(`Example Alchemy Webhooks app listening at ${host}:${port}`); }); } main(); Create and test your webhooks ----------------------------- 1. Navigate to the [webhooks dashboard](https://dashboard.alchemy.com/apps/latest/webhooks?utm_source=docs&utm_medium=referral&utm_content=reference_notify-api-quickstart) and click **Create Webhook** OR create one by calling the [createWebhook](https://www.alchemy.com/docs/data/webhooks/custom-webhook-api-methods/custom-webhook-api-methods/notify-api-methods/create-webhook) endpoint. When it asks for your Webhook URL, enter your endpoint or follow these steps to create an NGROK endpoint: * Sign-up for a [free Ngrok account](https://dashboard.ngrok.com/signup) . * Install Ngrok using [the Ngrok guide](https://dashboard.ngrok.com/get-started/setup) . On macOS run `brew install ngrok`. * Connect your Ngrok account by running `ngrok authtoken YOUR_AUTH_TOKEN`. * Start your local forwarding tunnel: `ngrok http 80`. ![](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764193608%2Fdocs%2Fapi-reference%2Fdata%2Fwebhooks%2Fwebhooks-quickstart%2F49a5266-Screen_Shot_2022-03-01_at_1.33.31_PM.png&w=3840&q=75 "Screen Shot 2022-03-01 at 1.33.31 PM.png") 2. Once you have a URL to test your webhook (in this case `https://461a-199-116-73-171.ngrok.io` pictured above), paste your NGROK endpoint into the Webhook URL field and hit “Test Webhook”, and see the event appear here: [http://localhost:4040/inspect/http](http://localhost:4040/inspect/http) 3. Navigate to your [webhooks dashboard](https://dashboard.alchemy.com/apps/latest/webhooks?utm_source=docs&utm_medium=referral&utm_content=reference_notify-api-quickstart) . 4. Click **Create Webhook** on the webhook you want to test. 5. Paste **your unique URL** and hit the **Test Webhook** button. 6. You'll see the webhooks here: `http://localhost:4040/inspect/http`. Webhook Signature & Security ============================ Signatures ---------- To make your webhooks secure, you can verify that they originated from Alchemy by generating a HMAC SHA-256 hash code using your unique webhook signing key. ### Find your signing key To find your signing key, navigate to the [webhooks dashboard](https://dashboard.alchemy.com/apps/latest/webhooks?utm_source=docs&utm_medium=referral&utm_content=reference_notify-api-quickstart) , select your webhook, and copy the singing key from the top right of that webhook's detail page. ### Validate the signature received Every outbound request contains a hashed authentication signature in the header. It's computed by concatenating your signing key and request body. Then generates a hash using the HMAC SHA256 hash algorithm. To verify the signature came from Alchemy, you generate the HMAC SHA256 hash and compare it with the signature received. ### Example request header Request POST /yourWebhookServer/push HTTP/1.1 Content-Type: application/json; X-Alchemy-Signature: your-hashed-signature ### Example signature validation typescript Python Go Rust import * as crypto from "crypto"; function isValidSignatureForStringBody( body: string, // must be raw string body, not json transformed version of the body signature: string, // your "X-Alchemy-Signature" from header signingKey: string, // taken from dashboard for specific webhook ): boolean { const hmac = crypto.createHmac("sha256", signingKey); // Create a HMAC SHA256 hash using the signing key hmac.update(body, "utf8"); // Update the token hash with the request body using utf8 const digest = hmac.digest("hex"); return signature === digest; } Auth Token ---------- The Auth Token, located at the top of you [webhooks dashboard](https://dashboard.alchemy.com/apps/latest/webhooks?utm_source=docs&utm_medium=referral&utm_content=reference_notify-api-quickstart) , is required to let you manage your webhooks via our webhooks API! Webhooks IP addresses --------------------- As an added security measure, you can ensure your webhook notification originates from Alchemy by using one of the following IP addresses: * `54.236.136.17` * `34.237.24.169` Webhook Delivery Behavior ========================= * **Event Ordering** - All first-time webhooks notifications, regardless of the selected chain/network and its speed, will be delivered in order to users. * **Automatic Retries** - Webhooks have built-in retry-logic with exponential backoff for non-200 response codes in failures to reach your server. For Free and PAYG tier teams, these will fire with back off up to 10 minutes after. For Enterprise customers, this back off period will extend to 1 hour. * **Manual Retries (Coming Soon)** - Soon you’ll have the ability to manually trigger retries for failed events! Was this page helpful? YesNo --- # Smart Wallets | Alchemy Docs Copy page Smart Wallets ============= ![smart wallets overview](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764187314%2Fdocs%2Faa-sdk%2Fimages%2FoverviewHeader.png&w=3840&q=75) [React Quickstart\ \ Build an onchain app from scratch with wallets and transactions.](https://www.alchemy.com/docs/wallets/react/quickstart) [Try demo\ \ See Smart Wallets in action with an interactive demo.](https://demo.alchemy.com/) Everything You Need for Onchain Applications -------------------------------------------- [User onboarding\ \ Email, social, biometric, or EOA login.](https://www.alchemy.com/docs/wallets/authentication/login-methods/email-otp) [Gasless transactions\ \ Remove gas fees for users.](https://www.alchemy.com/docs/wallets/transactions/sponsor-gas) [Batching\ \ Multiple transactions in 1 click on EVM & Solana.](https://www.alchemy.com/docs/wallets/transactions/send-batch-transactions) [Whitelabel UI\ \ Pre-built UI components or fully whitelabel.](https://www.alchemy.com/docs/wallets/react/customization/theme) [Secure policy engine\ \ Advanced permissions and automations.](https://www.alchemy.com/docs/wallets/signer/policies/overview) Frameworks ---------- [React\ \ Pre-built React components and hooks.](https://www.alchemy.com/docs/wallets/react/quickstart) [React Native\ \ Native mobile wallet experiences.](https://www.alchemy.com/docs/wallets/react-native/overview) [Javascript\ \ Framework-agnostic implementation.](https://www.alchemy.com/docs/wallets/core/overview) [APIs\ \ Server-side wallet management.](https://www.alchemy.com/docs/reference/smart-wallet-quickstart) Common Starting Places ---------------------- [Build a new app\ \ Build an onchain app from scratch with wallets and transactions.](https://www.alchemy.com/docs/wallets/react/quickstart) [Upgrade existing wallets\ \ Upgrade to smart wallets using EIP-7702 or direct wagmi integration.](https://www.alchemy.com/docs/wallets/recipes/upgrade-to-smart-accounts) [Bring your app onchain\ \ Add wallet and transaction functionality to existing web2 applications.](https://www.alchemy.com/docs/wallets/authentication/login-methods/bring-your-own-auth) [Manage wallets in backend\ \ Server-side applications with signing and sending on your backend.](https://www.alchemy.com/docs/reference/smart-wallet-quickstart) Resources --------- [Support\ \ Troubleshoot issues or get in touch.](https://www.alchemy.com/docs/wallets/resources/faqs) [Recipes\ \ End-to-end guides for common features.](https://www.alchemy.com/docs/wallets/recipes/overview) [Pricing\ \ Save costs as you scale.](https://wallet-calculator.alchemy.com/) Was this page helpful? YesNo --- # October 16, 2025 | Changelog | Alchemy Docs [Changelog](https://www.alchemy.com/docs/changelog) October 16, 2025 ================ Developer Experience -------------------- Added [Yellowstone gRPC](https://www.alchemy.com/docs/reference/yellowstone-grpc-overview) API Reference & docs - a high-performance real-time Solana data streaming interface. Rollups ------- Added Fusaka support on Sepolia - Fusaka is the upcoming Ethereum hard fork introducing key protocol upgrades. Supporting it on Sepolia ensures rollups remain compatible and secure as they post data to Ethereum. Mainnet rollout is expected in December. Node ---- **Upgrades** * Arbitrum Sepolia: Arbitrum [v3.7.6](https://github.com/OffchainLabs/nitro/releases/tag/v3.7.6) * Astar Mainnet: Runtime [runtime-1900](https://github.com/AstarNetwork/Astar/releases/tag/runtime-1900) * Eth Sepolia: Reth [v1.8.2](https://github.com/paradigmxyz/reth/releases/tag/v1.8.2) , Lighthouse [v8.0.0-rc.0](https://github.com/sigp/lighthouse/releases/tag/v8.0.0-rc.0) , Geth [v1.16.4](https://github.com/ethereum/go-ethereum/releases/tag/v1.16.4) * Gensyn Sepolia: Op Node [op-node/v1.14.1](https://github.com/ethereum-optimism/optimism/releases/tag/op-node%2Fv1.14.1) * Ink Sepolia: Op Node [op-node/v1.14.1](https://github.com/ethereum-optimism/optimism/releases/tag/op-node%2Fv1.14.1) * Optimism Sepolia: Op Node [op-node/v1.14.1](https://github.com/ethereum-optimism/optimism/releases/tag/op-node%2Fv1.14.1) * Polygon Amoy: Bor [v2.3.2-beta](https://github.com/maticnetwork/bor/releases/tag/v2.3.2-beta) * Rise Testnet: Rise Docker [v0.3.6](https://github.com/risechain/rise-node/releases/tag/rise-node%2Fv0.3.6) * Soneium Sepolia: Op Node [op-node/v1.14.1](https://github.com/ethereum-optimism/optimism/releases/tag/op-node%2Fv1.14.1) * Sonic Mainnet: Sonic [v2.1.2](https://github.com/0xsoniclabs/sonic/releases/tag/v2.1.2) * Starknet Sepolia: Starknet [v0.20.5](https://github.com/eqlabs/pathfinder/releases/tag/v0.20.5) * Superseed Sepolia: Op Node [op-node/v1.14.1](https://github.com/ethereum-optimism/optimism/releases/tag/op-node%2Fv1.14.1) * Worldchain Sepolia: Op Node [op-node/v1.14.1](https://github.com/ethereum-optimism/optimism/releases/tag/op-node%2Fv1.14.1) --- # October 23, 2025 | Changelog | Alchemy Docs [Changelog](https://www.alchemy.com/docs/changelog) October 23, 2025 ================ Rollups ------- Upgraded all Arbitrum Chain rollups to ArbOS 40 Callisto. This adds features like EIP-7702 (account abstraction for EOAs) and EIP-2935 (historical block hashes). Node ---- **Upgrades** * Bsc Mainnet: Erigon [v1.4.1](https://github.com/node-real/bsc-erigon/releases/tag/v1.4.1) * Celestia Testnet: Celestia [v0.27.5-mocha](https://github.com/celestiaorg/celestia-node/releases/tag/v0.27.5-mocha) * Eth Hoodi: Reth [v1.8.2](https://github.com/sigp/lighthouse/releases/tag/v8.0.0-rc.1) , Lighthouse [v8.0.0-rc.1](https://github.com/sigp/lighthouse/releases/tag/v8.0.0-rc.1) * Gnosis Chiado: Erigon [v3.2.1](https://github.com/erigontech/erigon/releases/tag/v3.2.1) * Gnosis Mainnet: Erigon [v3.2.1](https://github.com/erigontech/erigon/releases/tag/v3.2.1) * Moonbeam Mainnet: Moonbeam [v0.47.3](https://github.com/moonbeam-foundation/moonbeam/releases/tag/v0.47.3) * Polygon Mainnet: Bor [v2.3.3](https://github.com/maticnetwork/bor/releases/tag/v2.3.3) * Solana Mainnet: Solana [v2.3.13](https://github.com/anza-xyz/agave/releases/tag/v2.3.13) * Sui Testnet: Sui [testnet-v1.59.0](https://github.com/MystenLabs/sui/releases/tag/testnet-v1.59.0) --- # November 6, 2025 | Changelog | Alchemy Docs [Changelog](https://www.alchemy.com/docs/changelog) November 6, 2025 ================ Node ---- * Made Arc Testnet public * Released Aptos **Upgrades** * Arc Mainnet: Arc Execution 0.2.2-rc1 * Arbitrum One: Arbitrum [v3.7.1-926f1ab](https://hub.docker.com/layers/offchainlabs/nitro-node/v3.7.1-926f1ab/images/sha256-0f593aee01b40b587aa92bcdb58dcbfbe798519362a47051b0b59e78f7b34354) * Base Mainnet: Opnode [op-node/v1.14.3](https://github.com/ethereum-optimism/optimism/releases/tag/op-node%2Fv1.14.3) , Opreth Flashblocks [v0.1.15](https://github.com/base/node-reth/releases/tag/v0.1.15) , Reth [v1.8.3](https://github.com/paradigmxyz/reth/releases/tag/v1.8.3) * Base Sepolia: Opnode [op-node/v1.14.3](https://github.com/ethereum-optimism/optimism/releases/tag/op-node%2Fv1.14.3) , Opreth Flashblocks [v0.1.15](https://github.com/base/node-reth/releases/tag/v0.1.15) * Berachain Mainnet: Reth [v1.2.0](https://github.com/berachain/bera-reth/releases/tag/v1.2.0) * Bsc Mainnet: Erigon [v1.4.2](https://github.com/node-real/bsc-erigon/releases/tag/v1.4.2) * Eth Hoodi: Reth [v1.8.3](https://github.com/paradigmxyz/reth/releases/tag/v1.8.3) , Lighthouse [v8.0.0](https://github.com/sigp/lighthouse/releases/tag/v8.0.0) * Opbnb Mainnet: Op Geth [v0.5.8](https://github.com/bnb-chain/op-geth/releases/tag/v0.5.8) * Optimism Mainnet: Opnode [op-node/v1.16.0](https://github.com/ethereum-optimism/optimism/releases/tag/op-node%2Fv1.16.0) , Opreth Flashblocks [v0.1.12](https://github.com/base/node-reth/releases/tag/v0.1.12) * Optimism Sepolia: Opnode [op-node/v1.16.0](https://github.com/ethereum-optimism/optimism/releases/tag/op-node%2Fv1.16.0) , Opreth Flashblocks [v0.1.12](https://github.com/base/node-reth/releases/tag/v0.1.12) * Story Aeneid: Geth [v1.1.2](https://github.com/piplabs/story-geth/releases/tag/v1.1.2) , Story [v1.4.0](https://github.com/piplabs/story/releases/tag/v1.4.0) * Tempo Mainnet: Binary [v0.1.6](https://testnet-assets.tempoxyz.dev/binaries/v0.1.6/tempo-v0.1.6-x86_64-unknown-linux-gnu.tar.gz) --- # November 20, 2025 | Changelog | Alchemy Docs [Changelog](https://www.alchemy.com/docs/changelog) November 20, 2025 ================= Developer Experience -------------------- **Dashboard** * Redesigned the [app endpoints page](https://dashboard.alchemy.com/apps?utm_source=docs&utm_medium=referral&utm_content=changelog_2025_11_20) to make it easier to configure networks for your apps. You can now enable/disable all networks from the same screen with improved filtering (mainnet/testnet), alphabetical sorting and quicker access to WebSocket URLs. **Docs** * Revamped landing pages for API overview, Node, Chains, Data, and Rollups sections with visual cards and icons for easier navigation and better content organization. * Reorganized the Chains section by consolidating all chain-related quickstarts, FAQs, and APIs into a dedicated tab for a cleaner and more intuitive docs experience. Node ---- **Upgrades** * Aptos Mainnet: Aptos [aptos-node-v1.37.4](https://github.com/aptos-labs/aptos-core/releases/tag/aptos-node-v1.37.4) * Arbitrum Sepolia: Arbitrum [v3.9.0-cca645a](https://hub.docker.com/layers/offchainlabs/nitro-node/v3.9.0-cca645a/images/sha256-856c6f79baf92805628256d7556424b82dc021d1b97498d84602129b317797f1) * Base Mainnet: Opnode op-node/v1.16.1 ([Release Notes](https://github.com/paradigmxyz/reth/releases/tag/v1.9.2) ), Reth [v1.9.2](https://github.com/paradigmxyz/reth/releases/tag/v1.9.2) * Base Sepolia: Opnode op-node/v1.16.2 ([Release Notes](https://github.com/paradigmxyz/reth/releases/tag/v1.9.3) ), Reth [v1.9.3](https://github.com/paradigmxyz/reth/releases/tag/v1.9.3) * Bsc Mainnet: Reth [v0.0.4-archivenode-alpha](https://github.com/bnb-chain/reth-bsc/releases/tag/v0.0.4-archivenode-alpha) * Ink Sepolia: Op Node [op-node/v1.16.2](https://github.com/ethereum-optimism/optimism/releases/tag/op-node%2Fv1.16.2) * Polygon Amoy: Heimdall [v0.5.0-beta](https://github.com/0xPolygon/heimdall-v2/releases/tag/v0.5.0-beta) , Bor [v2.5.0](https://github.com/maticnetwork/bor/releases/tag/v2.5.0) , Erigon [v3.3.0](https://github.com/0xPolygon/erigon/releases/tag/v3.3.0) * Polygon Mainnet: Erigon [v3.3.0](https://github.com/0xPolygon/erigon/releases/tag/v3.3.0) , Heimdall [v0.4.4](https://github.com/0xPolygon/heimdall-v2/releases/tag/v0.4.4) , Bor [v2.5.0](https://github.com/0xPolygon/bor/releases/tag/v2.5.0) * Solana Mainnet: Solana [v3.0.10](https://github.com/anza-xyz/agave/releases/tag/v3.0.10) * Soneium Mainnet: Op Node [op-node/v1.16.2](https://github.com/ethereum-optimism/optimism/releases/tag/op-node%2Fv1.16.2) * Soneium Sepolia: Op Node [op-node/v1.16.2](https://github.com/ethereum-optimism/optimism/releases/tag/op-node%2Fv1.16.2) * Starknet Mainnet: Starknet [v0.21.1](https://github.com/eqlabs/pathfinder/releases/tag/v0.21.1) * Starknet Sepolia: Starknet [v0.21.1](https://github.com/eqlabs/pathfinder/releases/tag/v0.21.1) * Unichain Sepolia: Op Node [op-node/v1.16.2](https://github.com/ethereum-optimism/optimism/releases/tag/op-node%2Fv1.16.2) * Worldchain Mainnet: Op Node [op-node/v1.16.2](https://github.com/ethereum-optimism/optimism/releases/tag/op-node%2Fv1.16.2) * Worldchain Sepolia: Op Node [op-node/v1.16.2](https://github.com/ethereum-optimism/optimism/releases/tag/op-node%2Fv1.16.2) --- # October 30, 2025 | Changelog | Alchemy Docs [Changelog](https://www.alchemy.com/docs/changelog) October 30, 2025 ================ Node ---- * Corrected MegaETH testnet name and made it public **Upgrades** * Arc Mainnet: Arc Execution 0.2.1-rc3 * Avalanche Mainnet: Avalanchego [v1.14.0-fuji](https://github.com/ava-labs/avalanchego/releases/tag/v1.14.0-fuji) * Base Mainnet: Opnode [op-node/v1.14.3](https://github.com/ethereum-optimism/optimism/releases/tag/op-node%2Fv1.14.3) , Opreth Flashblocks [v0.1.12](https://github.com/base/node-reth/releases/tag/v0.1.12) , Opgeth [v1.101603.2](https://github.com/ethereum-optimism/op-geth/releases/tag/v1.101603.2) * Base Sepolia: Opnode [op-node/v1.14.3](https://github.com/ethereum-optimism/optimism/releases/tag/op-node%2Fv1.14.3) , Opreth Flashblocks [v0.1.12](https://github.com/base/node-reth/releases/tag/v0.1.12) , Opgeth [v1.101603.2](https://github.com/ethereum-optimism/op-geth/releases/tag/v1.101603.2) * Celestia Mainnet: Celestia [v0.26.4](https://github.com/celestiaorg/celestia-node/releases/tag/v0.26.4) * Linea Mainnet: Besu [v4.0-rc17-20251024131506-d32162b](https://github.com/Consensys/linea-monorepo/releases/tag/linea-besu-package-beta-v4.0-rc17-20251024131506-d32162b) , Geth [v1.16.5](https://github.com/ethereum/go-ethereum/releases/tag/v1.16.5) , Maru [bcfdb43](https://hub.docker.com/layers/consensys/maru/bcfdb43/images/sha256-c5095c7dc7ce966fb7dacd36614859e4863a15a28a1821799f86377b3d33bc38) * Polygon Mainnet: Bor [v2.3.4](https://github.com/maticnetwork/bor/releases/tag/v2.3.4) * Sei Testnet: Seid [v6.2.2](https://github.com/sei-protocol/sei-chain/releases/tag/v6.2.2) --- # August 14, 2025 | Changelog | Alchemy Docs [Changelog](https://www.alchemy.com/docs/changelog) August 14, 2025 =============== * Berachain Bepolia: Reth [v1.0.0-rc.10](https://github.com/berachain/bera-reth/releases/tag/v1.0.0-rc.10) , Beacond [v1.3.0-rc1](https://github.com/berachain/beacon-kit/releases/tag/v1.3.0-rc1) * Bsc Mainnet: Erigon [v1.3.12](https://github.com/node-real/bsc-erigon/releases/tag/v1.3.12) * Gnosis Chiado: Erigon [v3.0.15](https://github.com/erigontech/erigon/releases/tag/v3.0.15) * Gnosis Mainnet: Erigon [v3.0.15](https://github.com/erigontech/erigon/releases/tag/v3.0.15) * Rise Testnet: Rise Docker [sha-fe712f4](https://github.com/risechain/rise-node/releases/tag/rise-node%2Fv0.3.3) , Op Node Docker [sha-76df9cb](https://github.com/risechain/rise-node/releases/tag/rise-node%2Fv0.3.3) * Scroll Mainnet: Scroll [scroll-v5.9.2](https://hub.docker.com/layers/scrolltech/l2geth/scroll-v5.9.2/images/sha256-503d5c39f11a54df73779c72c757dd0c78a073ae3512201fed085bfd00f0039d) * Scroll Sepolia: Scroll [scroll-v5.9.2](https://hub.docker.com/layers/scrolltech/l2geth/scroll-v5.9.2/images/sha256-503d5c39f11a54df73779c72c757dd0c78a073ae3512201fed085bfd00f0039d) * Starknet Mainnet: Starknet [v0.19.0](https://github.com/eqlabs/pathfinder/releases/tag/v0.19.0) * Starknet Sepolia: Starknet [v0.19.0](https://github.com/eqlabs/pathfinder/releases/tag/v0.19.0) --- # July 31, 2025 | Changelog | Alchemy Docs [Changelog](https://www.alchemy.com/docs/changelog) July 31, 2025 ============= * Base Mainnet: Opnode [op-node/v1.13.5](https://github.com/ethereum-optimism/optimism/releases/tag/op-node%2Fv1.13.5) , Reth [v1.6.0](https://github.com/paradigmxyz/reth/releases/tag/v1.6.0) , Opreth Flashblocks [v0.1.6](https://github.com/base/node-reth/releases/tag/v0.1.6) * Base Sepolia: Opnode [op-node/v1.13.5](https://github.com/ethereum-optimism/optimism/releases/tag/op-node%2Fv1.13.5) , Reth [v1.6.0](https://github.com/paradigmxyz/reth/releases/tag/v1.6.0) , Opreth Flashblocks [v0.1.6](https://github.com/base/node-reth/releases/tag/v0.1.6) * Bsc Mainnet: Geth [v1.5.19](https://github.com/bnb-chain/bsc/releases/tag/v1.5.19) * Optimism Mainnet: Op Geth [v1.101511.1](https://github.com/ethereum-optimism/op-geth/releases/tag/v1.101511.1) * Polygon Amoy: Erigon [v3.0.15](https://github.com/erigontech/erigon/releases/tag/v3.0.15) , Heimdall [v0.2.16](https://github.com/0xPolygon/heimdall-v2/releases/tag/v0.2.16) * Polygon Mainnet: Erigon [v3.0.15](https://github.com/erigontech/erigon/releases/tag/v3.0.15) , Heimdall [v0.2.16](https://github.com/0xPolygon/heimdall-v2/releases/tag/v0.2.16) --- # December 25, 2025 | Changelog | Alchemy Docs [Changelog](https://www.alchemy.com/docs/changelog) December 25, 2025 ================= Node ---- **Upgrades** * Arbitrum Mainnet: Arbitrum [v3.9.4-7f582c3](https://github.com/OffchainLabs/nitro/releases/tag/v3.9.4) * Provisioning Ephemeral: Erigon [v3.3.2](https://github.com/erigontech/erigon/releases/tag/v3.3.2) * Zetachain Mainnet: Zetacored [v36.1.5](https://github.com/zeta-chain/node/releases/tag/v36.1.5) --- # November 27, 2025 | Changelog | Alchemy Docs [Changelog](https://www.alchemy.com/docs/changelog) November 27, 2025 ================= Node ---- **Upgrades** * Polygon Amoy: Erigon [v3.3.1-beta3](https://github.com/0xPolygon/erigon/releases/tag/v3.3.1-beta3) , Bor [v2.5.2-beta2](https://github.com/maticnetwork/bor/releases/tag/v2.5.2-beta2) , Heimdall [v0.5.1-beta](https://github.com/0xPolygon/heimdall-v2/releases/tag/v0.5.1-beta) * Unichain Mainnet: Op Node [op-node/v1.16.2](https://github.com/ethereum-optimism/optimism/releases/tag/op-node%2Fv1.16.2) * Worldchain Mainnet:Op Reth [v1.9.3](https://github.com/paradigmxyz/reth/releases/tag/v1.9.3) --- # Initialization | Alchemy Docs Copy page Initialization ============== In this doc and the three following we will build a Next.js application with Alchemy Smart Wallets from scratch. If you're using any other tech stack, follow along with the key points of integration and adjust as needed! Create a new Next.js app ------------------------ Start by initializing a new [Next.js app](https://nextjs.org/) . Run: npx create-next-app@latest \ --typescript \ --tailwind \ --app This command passes in flags to use Typescript, Tailwind and the next app router. The following docs in this guide will expect you to use these. Install Dependencies -------------------- You will need these three libraries: * **@account-kit/infra**: Core interfaces and functions for Smart Wallets ([learn more](https://www.alchemy.com/docs/wallets/reference/account-kit/infra) ) * **@account-kit/react**: React Hooks, components and utilities for Smart Wallets ([learn more](https://www.alchemy.com/docs/wallets/reference/account-kit/react) ) * **@tanstack/react-query**: A required async state library to make smart wallet react hooks easier to use ([learn more about this library's motivation here](https://tanstack.com/query/latest/docs/framework/react/overview) ) Go ahead and install them to the project with a single command: npm pnpm yarn npm install @account-kit/infra @account-kit/react @tanstack/react-query Was this page helpful? YesNo --- # October 9, 2025 | Changelog | Alchemy Docs [Changelog](https://www.alchemy.com/docs/changelog) October 9, 2025 =============== Developer Experience -------------------- ### Dashboard * Added multi-network method support in the [developer sandbox](https://sandbox.alchemy.com/) . * Simplified Node RPC API setup for easier in-browser calls. * Redesigned Smart Wallets page for clearer login configuration, usage, and keys. * Introduced a Wallets quickstart in the app page. ### Docs * Published a video guide on [building a web3 dashboard with Alchemy + Cursor](https://www.alchemy.com/docs/web3-dashboard-prompt) . * Added quickstart and FAQ guides for Plasma, Moonbeam, Bob, Mode, and Citrea chains. Rollups ------- Optimized OP sequencer infrastructure, boosting throughput ~26% and extending disk headroom ~10×. Node ---- **Upgrades** * Avalanche Mainnet: Avalanchego [v1.13.5](https://github.com/ava-labs/avalanchego/releases/tag/v1.13.5) * Base Mainnet: Opnode [op-node/v1.13.7](https://github.com/ethereum-optimism/optimism/releases/tag/op-node%2Fv1.13.7) , Opreth Flashblocks [v0.1.9](https://github.com/base/node-reth/releases/tag/v0.1.9) * Base Sepolia: Opnode [op-node/v1.13.7](https://github.com/ethereum-optimism/optimism/releases/tag/op-node%2Fv1.13.7) , Opreth Flashblocks [v0.1.9](https://github.com/base/node-reth/releases/tag/v0.1.9) * Bsc Mainnet: Erigon [v1.4.0](https://github.com/node-real/bsc-erigon/releases/tag/v1.4.0) * Polygon Mainnet: Heimdall [v0.4.0](https://github.com/0xPolygon/heimdall-v2/releases/tag/v0.4.0) , Erigon [v3.1.1](https://github.com/0xPolygon/erigon/releases/tag/v3.1.1) , Bor [v2.3.1](https://github.com/maticnetwork/bor/releases/tag/v2.3.1) * Scroll Mainnet: Scroll [scroll-v5.9.2](https://hub.docker.com/layers/scrolltech/l2geth/scroll-v5.9.2) * Sei Mainnet: Seid [v6.1.12](https://github.com/sei-protocol/sei-chain/releases/tag/v6.1.12) * Sei Testnet: Seid [v6.1.12](https://github.com/sei-protocol/sei-chain/releases/tag/v6.1.12) * Worldchain Mainnet: Op Reth [v1.8.2](https://github.com/paradigmxyz/reth/releases/tag/v1.8.2) --- # November 13, 2025 | Changelog | Alchemy Docs [Changelog](https://www.alchemy.com/docs/changelog) November 13, 2025 ================= Developer Experience -------------------- * Extracted and moved all the chain related docs (quickstarts, faqs, API docs) from the "Node API" tab to its own tab called "[Chains](https://www.alchemy.com/docs/reference/chain-apis-overview) " for better organization & cleaner docs experience. * Added quickstart, FAQ and API docs for the [Tron](https://www.alchemy.com/docs/reference/tron-api-quickstart) chain. Rollups ------- * Launched WorldL3 Devnet, a Layer 3 rollup that settles on World Chain. This testing environment enables World Chain partners to build and test L3 solutions while leveraging World Chain's ecosystem tooling, including on-ramp services. Mythical Games is the first partner deploying on this rollup. Node ---- **Upgrades** * Avalanche Mainnet: Avalanchego [v1.14.0](https://github.com/ava-labs/avalanchego/releases/tag/v1.14.0) * Berachain Mainnet: Reth [v1.3.0](https://github.com/berachain/bera-reth/releases/tag/v1.3.0) * Bsc Mainnet: Geth [v1.6.3](https://github.com/bnb-chain/bsc/releases/tag/v1.6.3) * Polygon Amoy: Bor [v2.4.0-beta5](https://github.com/maticnetwork/bor/releases/tag/v2.4.0-beta5) * Polygon Mainnet: Heimdall [v0.4.4](https://github.com/0xPolygon/heimdall-v2/releases/tag/v0.4.4) * Solana : Solana [v3.0.10](https://github.com/anza-xyz/agave/releases/tag/v3.0.10) * Soneium Mainnet: Op Node [op-node/v1.16.1](https://github.com/ethereum-optimism/optimism/releases/tag/op-node%2Fv1.16.1) * Soneium Sepolia: Op Node [op-node/v1.16.1](https://github.com/ethereum-optimism/optimism/releases/tag/op-node%2Fv1.16.1) * Worldchain Mainnet: Op Node [op-node/v1.16.1](https://github.com/ethereum-optimism/optimism/releases/tag/op-node%2Fv1.16.1) --- # July 17, 2025 | Changelog | Alchemy Docs [Changelog](https://www.alchemy.com/docs/changelog) July 17, 2025 ============= * Aptos Mainnet: Aptos [aptos-node-v1.31.4](https://github.com/aptos-labs/aptos-core/releases/tag/aptos-node-v1.31.4) * Base Mainnet: Opnode [op-node/v1.13.4](https://github.com/ethereum-optimism/optimism/releases/tag/op-node%2Fv1.13.4) , Reth [v1.4.8](https://github.com/paradigmxyz/reth/releases/tag/v1.4.8) , Opreth Flashblocks [v0.1.3](https://github.com/base/node-reth/releases/tag/v0.1.3) * Bsc Mainnet: Erigon [v1.3.10](https://github.com/node-real/bsc-erigon/releases/tag/v1.3.10) * Degen Mainnet: Nitro [v3.6.7](https://github.com/OffchainLabs/nitro/releases/tag/v3.6.7) * Earnm Testnet: Nitro [v3.6.7](https://github.com/OffchainLabs/nitro/releases/tag/v3.6.7) * Humanity Mainnet: Nitro [v3.6.7](https://github.com/OffchainLabs/nitro/releases/tag/v3.6.7) * Polygon Amoy: Bor [v2.2.8](https://github.com/maticnetwork/bor/releases/tag/v2.2.8) , Heimdall [v0.2.10](https://github.com/0xPolygon/heimdall-v2/releases/tag/v0.2.10) , Erigon [v3.0.14](https://github.com/erigontech/erigon/releases/tag/v3.0.14) * Polygon Mainnet: Heimdall [v0.2.10](https://github.com/0xPolygon/heimdall-v2/releases/tag/v0.2.10) , Erigon [v3.0.14](https://github.com/erigontech/erigon/releases/tag/v3.0.14) , Bor [v2.2.8](https://github.com/maticnetwork/bor/releases/tag/v2.2.8) * Polygon Zkevm: Cdk Erigon [v2.61.20](https://github.com/0xPolygonHermez/cdk-erigon/releases/tag/v2.61.20) * Rise Testnet: Rise Docker [sha-444e405](https://github.com/risechain/rise-node/releases/tag/rise-node%2Fv0.2.1) , Op Node Docker [sha-76df9cb](https://github.com/risechain/rise-node/releases/tag/rise-node%2Fv0.2.1) * Starknet Mainnet: Pathfinder [v0.18.0](https://github.com/eqlabs/pathfinder/releases/tag/v0.18.0) * Starknet Sepolia: Pathfinder [v0.18.0](https://github.com/eqlabs/pathfinder/releases/tag/v0.18.0) * World Testnet: Nitro [v3.6.7](https://github.com/OffchainLabs/nitro/releases/tag/v3.6.7) * Worldmobile Mainnet: Nitro [v3.6.7](https://github.com/OffchainLabs/nitro/releases/tag/v3.6.7) * Xmtp Testnet: Nitro [v3.6.7](https://github.com/OffchainLabs/nitro/releases/tag/v3.6.7) * Xprotocol Testnet: Nitro [v3.6.7](https://github.com/OffchainLabs/nitro/releases/tag/v3.6.7) --- # July 24, 2025 | Changelog | Alchemy Docs [Changelog](https://www.alchemy.com/docs/changelog) July 24, 2025 ============= * Eth Mainnet: Reth [v1.5.1](https://github.com/paradigmxyz/reth/releases/tag/v1.5.1) , Lighthouse [v7.1.0](https://github.com/sigp/lighthouse/releases/tag/v7.1.0) * Eth Sepolia: Reth [v1.5.1](https://github.com/paradigmxyz/reth/releases/tag/v1.5.1) , Lighthouse [v7.1.0](https://github.com/sigp/lighthouse/releases/tag/v7.1.0) * Eth Holesky: Reth [v1.5.1](https://github.com/paradigmxyz/reth/releases/tag/v1.5.1) , Lighthouse [v7.1.0](https://github.com/sigp/lighthouse/releases/tag/v7.1.0) * Eth Hoodi: Reth [v1.5.1](https://github.com/paradigmxyz/reth/releases/tag/v1.5.1) , Lighthouse [v7.1.0](https://github.com/sigp/lighthouse/releases/tag/v7.1.0) * Optimism Mainnet: Reth [v1.5.1](https://github.com/paradigmxyz/reth/releases/tag/v1.5.1) * Base Mainnet: Opnode [op-node/v1.13.5](https://github.com/ethereum-optimism/optimism/releases/tag/op-node%2Fv1.13.5) , Reth [v1.5.1](https://github.com/paradigmxyz/reth/releases/tag/v1.5.1) , Opreth Flashblocks [v0.1.5](https://github.com/base/node-reth/releases/tag/v0.1.5) * Base Sepolia: Opnode [op-node/v1.13.5](https://github.com/ethereum-optimism/optimism/releases/tag/op-node%2Fv1.13.5) , Reth [v1.5.1](https://github.com/paradigmxyz/reth/releases/tag/v1.5.1) , Opreth Flashblocks [v0.1.5](https://github.com/base/node-reth/releases/tag/v0.1.5) * Bsc Mainnet: Geth [v1.5.18](https://github.com/bnb-chain/bsc/releases/tag/v1.5.18) , Erigon [v1.3.11](https://github.com/node-real/bsc-erigon/releases/tag/v1.3.11) * Polygon Amoy: Heimdall [v0.2.14](https://github.com/0xPolygon/heimdall-v2/releases/tag/v0.2.14) , Erigon [v3.0.14](https://github.com/erigontech/erigon/releases/tag/v3.0.14) , Bor [v2.2.9](https://github.com/maticnetwork/bor/releases/tag/v2.2.9) * Polygon Mainnet: Heimdall [v0.2.14](https://github.com/0xPolygon/heimdall-v2/releases/tag/v0.2.14) , Erigon [v3.0.14](https://github.com/erigontech/erigon/releases/tag/v3.0.14) , Bor [v2.2.9](https://github.com/maticnetwork/bor/releases/tag/v2.2.9) * Avalanche Mainnet: Avalanchego [v1.13.3](https://github.com/ava-labs/avalanchego/releases/tag/v1.13.3) * Rootstock Mainnet: LOVELL [7.2.0](https://github.com/rsksmart/rskj/releases/tag/LOVELL-7.2.0) * Rootstock Testnet: LOVELL [7.2.0](https://github.com/rsksmart/rskj/releases/tag/LOVELL-7.2.0) * Botanix Mainnet: Reth [1.1.13](https://github.com/botanix-labs/botanix-releases/tree/main/releases/1.1.13) * Zetachain Mainnet: Zetacored [v32.0.0](https://github.com/zeta-chain/node/releases/tag/v32.0.0) * Scroll Mainnet: Scroll [scroll-v5.8.72](https://hub.docker.com/layers/scrolltech/l2geth/scroll-v5.8.72/images/sha256-42fa8dd8cf7157adb557c51de1c08f00a6b9c6528803292bf453783cd093ebcd) * Scroll Sepolia: Scroll [scroll-v5.8.73](https://hub.docker.com/layers/scrolltech/l2geth/scroll-v5.8.73/images/sha256-d28b59c1e9c4757d52f749fb01ba76d83695b5cb080100b9e25ec03957491710) * Rise Testnet: Rise Docker [sha-fe66819](https://github.com/risechain/rise-node/releases/tag/v0.3.0) , Op Node Docker [sha-76df9cb](https://github.com/risechain/rise-node/releases/tag/v0.3.0) --- # August 7, 2025 | Changelog | Alchemy Docs [Changelog](https://www.alchemy.com/docs/changelog) August 7, 2025 ============== * Aptos Mainnet: Aptos [aptos-node-v1.31.4](https://github.com/aptos-labs/aptos-core/releases/tag/aptos-node-v1.31.4) * Aptos Testnet: Aptos [aptos-node-v1.33.1-rc](https://github.com/aptos-labs/aptos-core/releases/tag/aptos-node-v1.33.1-rc) * Astar Mainnet: Runtime [runtime-1700](https://github.com/AstarNetwork/Astar/releases/tag/runtime-1700) * Avalanche Mainnet: Avalanchego [v1.13.4](https://github.com/ava-labs/avalanchego/releases/tag/v1.13.4) * Berachain Bepolia: Reth [v1.0.0-rc.8](https://github.com/berachain/bera-reth/releases/tag/v1.0.0-rc.8) , Beacond [v1.3.0-rc1](https://github.com/berachain/beacon-kit/releases/tag/v1.3.0-rc1) * Bsc Mainnet: Erigon [v1.3.11](https://github.com/node-real/bsc-erigon/releases/tag/v1.3.11) * Rise Testnet: Rise Docker [sha-281e8dc](https://github.com/risechain/rise-node/releases/tag/rise-node/v0.3.1) , Op Node Docker [sha-76df9cb](https://github.com/risechain/rise-node/releases/tag/rise-node/v0.3.1) * Sei Mainnet: Seid [v6.1.4](https://github.com/sei-protocol/sei-chain/releases/tag/v6.1.4) --- # October 2, 2025 | Changelog | Alchemy Docs [Changelog](https://www.alchemy.com/docs/changelog) October 2, 2025 =============== Wallets ------- Shipped a recipe for [programmatic wallet creation](https://www.alchemy.com/docs/wallets/recipes/programmatic-wallet-creation) . Rollups ------- * **[Gensyn Mainnet](https://tea.xyz/) launched**, network focused on distributed AI training. * Scaled **World to an 80M block gas limit**, which at times surpasses Base’s throughput. Node ---- **Upgrades** * Astar Mainnet: Runtime [runtime-1800](https://github.com/AstarNetwork/Astar/releases/tag/runtime-1800) * Base Mainnet: Opnode [op-node/v1.13.7](https://github.com/ethereum-optimism/optimism/releases/tag/op-node%2Fv1.13.7) , Opreth Flashblocks [v0.1.8](https://github.com/base/node-reth/releases/tag/v0.1.8) * Base Sepolia: Opnode [op-node/v1.13.7](https://github.com/ethereum-optimism/optimism/releases/tag/op-node%2Fv1.13.7) , Opreth Flashblocks [v0.1.8](https://github.com/base/node-reth/releases/tag/v0.1.8) * Eth Holesky: Reth [v1.8.2](https://github.com/sigp/lighthouse/releases/tag/v8.0.0-rc.0) , Lighthouse [v8.0.0-rc.0](https://github.com/sigp/lighthouse/releases/tag/v8.0.0-rc.0) * Eth Hoodi: Reth [v1.8.1](https://github.com/sigp/lighthouse/releases/tag/v8.0.0-rc.0) , Lighthouse [v8.0.0-rc.0](https://github.com/sigp/lighthouse/releases/tag/v8.0.0-rc.0) * Optimism Mainnet: Opnode [op-node/v1.13.6](https://github.com/ethereum-optimism/optimism/releases/tag/op-node%2Fv1.13.6) , Opreth Flashblocks [v0.1.9](https://github.com/base/node-reth/releases/tag/v0.1.9) * Polygon Mainnet: Heimdall [v0.4.0](https://github.com/0xPolygon/heimdall-v2/releases/tag/v0.4.0) , Bor [v2.3.0](https://github.com/maticnetwork/bor/releases/tag/v2.3.0) , Erigon [v3.1.1](https://github.com/0xPolygon/erigon/releases/tag/v3.1.1) * Solana Mainnet: Solana [2.3.6](https://github.com/anza-xyz/agave/releases/tag/v2.3.6) , Yellowstone Grpc Plugin [v9.0.0+solana.2.3.6](https://github.com/rpcpool/yellowstone-grpc/releases/tag/v9.0.0%2Bsolana.2.3.6) * Worldchain Mainnet: Op Node [op-node/v1.13.6](https://github.com/ethereum-optimism/optimism/releases/tag/op-node%2Fv1.13.6) --- # December 4, 2025 | Changelog | Alchemy Docs [Changelog](https://www.alchemy.com/docs/changelog) December 4, 2025 ================ Developer Experience -------------------- **Docs** * Shipped a comprehensive revamp of the [Solana documentation](https://www.alchemy.com/docs/solana) with improved navigation, updated content, and new developer tools. * Completely refreshed the [Solana Quickstart Guide](https://www.alchemy.com/docs/solana) with a streamlined onboarding flow, tested working scripts for sending requests, creating and funding wallets, and a full breakdown of all supported Solana methods organized by category. * Published two brand-new tutorials with fresh, working code repositories that walk developers through building live, functioning sample apps—replacing the previous outdated guides. * Introduced a new [Compute Unit (CU) Calculator](https://solana-demo-sigma.vercel.app/) to help developers understand how many CUs their integrated methods require and plan their usage accordingly. * Updated the Solana FAQ with a methods-by-category breakdown, making it easier to discover what's supported and what you can build with each method. Rollups ------- * Launched Mythos Mainnet for Mythical Games, our first OP Stack Layer 3 rollup. Mythical Games will use this rollup to power in-game NFT items and their marketplace for popular mobile games like NFL Rivals. * Shipped support for the Fusaka activation on Ethereum Mainnet, enabling rollups with Ethereum Mainnet as the parent chain to continue sequencing after the network upgrade. Node ---- **Upgrades** * Arbitrum Mainnet: Arbitrum [v3.9.3-8bc5554](https://hub.docker.com/layers/offchainlabs/nitro-node/v3.9.3-8bc5554) * Arbitrum Nova: Arbitrum [v3.9.3-8bc5554](https://hub.docker.com/layers/offchainlabs/nitro-node/v3.9.3-8bc5554) * Arbitrum One: Arbitrum [v3.9.3-8bc5554](https://hub.docker.com/layers/offchainlabs/nitro-node/v3.9.3-8bc5554) * Arbitrum Sepolia: Arbitrum [v3.9.3-8bc5554](https://hub.docker.com/layers/offchainlabs/nitro-node/v3.9.3-8bc5554) * Base Mainnet: Opgeth [v1.101603.5](https://github.com/ethereum-optimism/op-geth/releases/tag/v1.101603.5) , Opnode [op-node/v1.16.2](https://github.com/ethereum-optimism/optimism/releases/tag/op-node%2Fv1.16.2) , Reth [v1.9.3](https://github.com/paradigmxyz/reth/releases/tag/v1.9.3) * Gnosis Chiado: Erigon [v3.2.2](https://github.com/erigontech/erigon/releases/tag/v3.2.2) * Ink Mainnet: Op Node [op-node/v1.16.2](https://github.com/ethereum-optimism/optimism/releases/tag/op-node%2Fv1.16.2) * Mantle Sepolia: Opnode [v1.4.1](https://github.com/mantlenetworkio/networks/releases/tag/v1.4.1) , Opgeth [v1.4.1](https://github.com/mantlenetworkio/networks/releases/tag/v1.4.1) * Optimism Mainnet: Op Node [op-node/v1.16.2](https://github.com/ethereum-optimism/optimism/releases/tag/op-node%2Fv1.16.2) * Polygon Mainnet: Erigon [v3.3.2](https://github.com/0xPolygon/erigon/releases/tag/v3.3.2) , Bor [v2.5.2](https://github.com/0xPolygon/bor/releases/tag/v2.5.2) * Scroll Sepolia: Scroll [scroll-v5.9.18](https://hub.docker.com/layers/scrolltech/l2geth/scroll-v5.9.18) * Sonic Mainnet: Sonic [v2.1.4](https://github.com/0xsoniclabs/sonic/releases/tag/v2.1.4) * Starknet Mainnet: Starknet [v0.21.3](https://github.com/eqlabs/pathfinder/releases/tag/v0.21.3) * Starknet Sepolia: Starknet [v0.21.3](https://github.com/eqlabs/pathfinder/releases/tag/v0.21.3) * Worldchain Sepolia: Op Node [op-node/v1.16.2](https://github.com/ethereum-optimism/optimism/releases/tag/op-node%2Fv1.16.2) --- # December 11, 2025 | Changelog | Alchemy Docs [Changelog](https://www.alchemy.com/docs/changelog) December 11, 2025 ================= Legacy endpoint shutdown notice We will be shutting down our legacy RPC endpoint `alchemyapi.io` on January 31, 2026. This endpoint was originally deprecated in 2021, and you are likely not impacted by this change. However, if your app is still making RPC requests to this legacy endpoint, please migrate to our current endpoint, `g.alchemy.com`, which offers significant latency improvements while maintaining the same authentication model and API functionality. No other changes are required beyond updating the endpoint URL in your calls. If you are using the Ethers.js package, please ensure you are running [v6.16.0](https://github.com/ethers-io/ethers.js/blob/main/CHANGELOG.md#ethersv6160-2025-12-02-1947) or later, which routes requests through the current `g.alchemy.com` domain. After the shutdown date, all requests to `alchemyapi.io` will return HTTP 410 – Gone, and no Compute Units (CUs) will be billed for calls made to the deprecated endpoint. Node ---- **Updates** * [ADI Mainnet](https://www.alchemy.com/docs/reference/adi-api-quickstart) is now public 🎉 **Upgrades** * Bsc Mainnet: Erigon [v1.4.3](https://github.com/node-real/bsc-erigon/releases/tag/v1.4.3) , Geth [v1.6.4](https://github.com/bnb-chain/bsc/releases/tag/v1.6.4) * Celestia Mainnet: Celestia [v0.28.4](https://github.com/celestiaorg/celestia-node/releases/tag/v0.28.4) * Polygon Amoy: Bor [v2.5.3](https://github.com/maticnetwork/bor/releases/tag/v2.5.3) , Heimdall [v0.5.2](https://github.com/0xPolygon/heimdall-v2/releases/tag/v0.5.2) * Polygon Mainnet: Heimdall [v0.5.2](https://github.com/0xPolygon/heimdall-v2/releases/tag/v0.5.2) , Bor [v2.5.3](https://github.com/0xPolygon/bor/releases/tag/v2.5.3) * Scroll Mainnet: Scroll scroll-v5.10.0 * Scroll Sepolia: Scroll scroll-v5.10.0 * Story Mainnet: Geth [v1.1.1](https://github.com/piplabs/story-geth/releases/tag/v1.1.1) , Story [v1.4.1](https://github.com/piplabs/story/releases/tag/v1.4.1) --- # September 11, 2025 | Changelog | Alchemy Docs [Changelog](https://www.alchemy.com/docs/changelog) September 11, 2025 ================== Rollups ------- * **OP Stack: Batcher v1.15.0 on all chains** — Upgraded all chains to the latest batcher with smoother, configurable sequencer throttling to better handle DA bottlenecks. Developer Experience -------------------- * **Docs changes** — Added docs for the following chains: [Rise](https://www.alchemy.com/docs/reference/rise-api-quickstart) & [WorldMobileChain](https://www.alchemy.com/docs/reference/world-mobile-chain-api-quickstart) . This includes quickstarts, faq guides and API pages. Node ---- **Upgrades** * Abstract Mainnet: Abstract [v29.1.2](https://hub.docker.com/layers/matterlabs/external-node/2.0-v29.1.2) * Celestia Mainnet: Celestia [v0.25.3](https://github.com/celestiaorg/celestia-node/releases/tag/v0.25.3) * Flow Mainnet: Evm Gateway [v1.3.0-preview.1-experimental.1](https://github.com/onflow/flow-evm-gateway/releases/tag/v1.3.0-preview.1-experimental.1) , Access Node v0.42.3 * Moonbeam All: Moonbeam [v0.47.0](https://github.com/moonbeam-foundation/moonbeam/releases/tag/v0.47.0) * Polygon Amoy: Bor [v2.3.0-beta2](https://github.com/maticnetwork/bor/releases/tag/v2.3.0-beta2) , Heimdall [v0.4.0-beta3](https://github.com/0xPolygon/heimdall-v2/releases/tag/v0.4.0-beta3) , Erigon [v3.0.17](https://github.com/erigontech/erigon/releases/tag/v3.0.17) * Polygon Mainnet: Heimdall [v0.3.1](https://github.com/0xPolygon/heimdall-v2/releases/tag/v0.3.1) , Bor [v2.2.11-beta2](https://github.com/0xPolygon/bor/releases/tag/v2.2.11-beta2) , Erigon [v3.0.17](https://github.com/erigontech/erigon/releases/tag/v3.0.17) * Starknet Mainnet: Pathfinder [v0.20.2](https://github.com/eqlabs/pathfinder/releases/tag/v0.20.2) --- # August 28, 2025 | Changelog | Alchemy Docs [Changelog](https://www.alchemy.com/docs/changelog) August 28, 2025 =============== Node ---- **Upgrades** * Abstract Testnet: Abstract [v29.1.2](https://github.com/matter-labs/zksync-era/releases/tag/core-v29.1.2) * Bsc Mainnet: Erigon [v1.3.12](https://github.com/node-real/bsc-erigon/releases/tag/v1.3.12) * Lens Testnet: Lens [v29.1.2](https://github.com/matter-labs/zksync-era/releases/tag/core-v29.1.2) * Mantle Mainnet: Opnode [v1.3.1](https://github.com/mantlenetworkio/mantle-v2/releases/tag/v1.3.1) , Opgeth [v1.3.1](https://github.com/mantlenetworkio/networks/releases/tag/v1.3.1) * Polygon Amoy: Heimdall [v0.3.0-beta](https://github.com/0xPolygon/heimdall-v2/releases/tag/v0.3.0-beta) , Bor [v2.2.10](https://github.com/maticnetwork/bor/releases/tag/v2.2.10) * Polygon Mainnet: Bor [v2.2.10](https://github.com/maticnetwork/bor/releases/tag/v2.2.10) * Rise Testnet: Rise Docker [v0.3.4](https://github.com/risechain/rise-node/releases/tag/rise-node%2Fv0.3.4) * Ronin Mainnet: Ronin [v1.1.1](https://github.com/ronin-chain/ronin/releases/tag/v1.1.1) * Sei Mainnet: Seid [v6.1.7](https://github.com/sei-protocol/sei-chain/releases/tag/v6.1.7) * Solana Mainnet: Solana [2.3.6](https://github.com/anza-xyz/agave/releases/tag/v2.3.6) , Yellowstone Grpc Plugin [v9.0.0+solana.2.3.6](https://github.com/rpcpool/yellowstone-grpc/releases/tag/v9.0.0%2Bsolana.2.3.6) * Starknet Mainnet: Starknet [v0.20.0](https://github.com/eqlabs/pathfinder/releases/tag/v0.20.0) * Starknet Sepolia: Starknet [v0.20.0](https://github.com/eqlabs/pathfinder/releases/tag/v0.20.0) * Zksync Sepolia: Zksync [v29.1.2](https://github.com/matter-labs/zksync-era/releases/tag/core-v29.1.2) Wallets ------- * **OIDC access tokens** — `user.accessToken` now available in `aa-sdk` post-OIDC authentication to fetch additional user info. * **Docs Improvements** — New **[Authentication](https://www.alchemy.com/docs/wallets/authentication/overview) ** and **[Transactions](https://www.alchemy.com/docs/wallets/transactions/overview) ** overview pages, navigation cleanup & [Getting Started](https://www.alchemy.com/docs/wallets/smart-contracts/other-accounts/modular-account/getting-started) for modular accounts now includes installing ERC-6900 plugins. --- # September 18, 2025 | Changelog | Alchemy Docs [Changelog](https://www.alchemy.com/docs/changelog) September 18, 2025 ================== Developer Experience -------------------- **Custom usage alerts are back.** * Existing usage alerts have been re-enabled. * Pay-as-you-go and Enterprise developers are now able to create new usage alerts by setting usage thresholds in CUs or dollars. **Redesigned dashboard to streamline navigation between apps:** * Select an app to see its metrics, services (node, wallets, rollups, webhooks, etc.), and settings. * Easily switch between apps with the new header. * All your account settings in one place: usage, billing, and more. Wallets ------- Shipped a big docs update that includes: * [Transactions docs](https://www.alchemy.com/docs/wallets/transactions/overview) overhaul. * New guides for sending parallel transactions and retrying stuck transactions. * Added and improved docs for swap API and transaction batching. * Enhanced Solana gas sponsorship docs. * Fixed and standardized broken links, slugs, and relative paths across wallets docs. Node ---- **Upgrades** * Aptos Testnet: Aptos [aptos-node-v1.33.1-rc](https://github.com/aptos-labs/aptos-core/releases/tag/aptos-node-v1.33.1-rc) * Berachain Mainnet: Reth [v1.1.0](https://github.com/paradigmxyz/reth/releases/tag/v1.1.0) * Optimism Mainnet: Opnode [op-node/v1.13.6](https://github.com/ethereum-optimism/optimism/releases/tag/op-node%2Fv1.13.6) , Reth [v1.7.0](https://github.com/paradigmxyz/reth/releases/tag/v1.7.0) * Ronin Mainnet: Ronin [v1.1.2](https://github.com/ronin-chain/ronin/releases/tag/v1.1.2) * Ronin Saigon: Ronin [v1.1.2](https://github.com/ronin-chain/ronin/releases/tag/v1.1.2) * Rootstock Mainnet: Rootstock [REED-8.0.0](https://github.com/rsksmart/rskj/releases/tag/REED-8.0.0) * Rootstock Testnet: Rootstock [REED-8.0.0](https://github.com/rsksmart/rskj/releases/tag/REED-8.0.0) --- # December 18, 2025 | Changelog | Alchemy Docs [Changelog](https://www.alchemy.com/docs/changelog) December 18, 2025 ================= Rollups ------- * Mythical Games launching their first set of in-game items on Mythos Mainnet, using the rollup to power their NFT marketplace for popular mobile games like NFL Rivals. * World launched a redesigned World App with new features including the ability to receive paychecks directly in the app and pay merchants using a Visa card that debits from World App accounts. * XMTP launched encrypted messaging on the World App, powering [World Chat](https://world.org/blog/announcements/the-new-world-app-secure-chat-global-payments-and-mini-apps-for-everyone) . * XMTP launched on Base App, bringing encrypted messaging capabilities to the platform. Node ---- **Upgrades** * Aptos Mainnet: Aptos [aptos-node-v1.38.5](https://github.com/aptos-labs/aptos-core/releases/tag/aptos-node-v1.38.5) * Bsc Mainnet: Reth [v0.0.6-beta](https://github.com/bnb-chain/reth-bsc/releases/tag/v0.0.6-beta) * Polygon Amoy: Heimdall [v0.5.3](https://github.com/0xPolygon/heimdall-v2/releases/tag/v0.5.3) , Bor [v2.5.5](https://github.com/maticnetwork/bor/releases/tag/v2.5.5) * Polygon Mainnet: Bor [v2.5.6-beta3](https://github.com/0xPolygon/bor/releases/tag/v2.5.6-beta3) , Heimdall [v0.5.3](https://github.com/0xPolygon/heimdall-v2/releases/tag/v0.5.3) --- # January 22, 2026 | Changelog | Alchemy Docs [Changelog](https://www.alchemy.com/docs/changelog) January 22, 2026 ================ Data ---- * Improved the [getOwnersForNFT](https://www.alchemy.com/docs/reference/nft-api-endpoints/nft-api-endpoints/nft-ownership-endpoints/get-owners-for-nft-v-3) endpoint to support CryptoPunks 4-digit hex token ID format. Node ---- **Upgrades** * Avalanche Mainnet: Avalanchego [v1.14.1](https://github.com/ava-labs/avalanchego/releases/tag/v1.14.1) * Celo Mainnet: Opnode celo-v2.1.1, Opgeth [celo-v2.1.3](https://github.com/celo-org/op-geth/releases/tag/celo-v2.1.3) * Eth Sepolia: Reth [v1.9.3](https://github.com/paradigmxyz/reth/releases/tag/v1.9.3) , Lighthouse [v8.0.1](https://github.com/sigp/lighthouse/releases/tag/v8.0.1) * Scroll Mainnet: Scroll [scroll-v5.10.2](https://hub.docker.com/layers/scrolltech/l2geth/scroll-v5.10.2/images/sha256-91582c10889ad4675f2d142787ba57f70a7f06f845b954ae21c745947eaf07d8) * Scroll Sepolia: Scroll [scroll-v5.10.2](https://hub.docker.com/layers/scrolltech/l2geth/scroll-v5.10.2/images/sha256-91582c10889ad4675f2d142787ba57f70a7f06f845b954ae21c745947eaf07d8) * Unichain Mainnet: Op Node [op-node/v1.16.5](https://github.com/ethereum-optimism/optimism/releases/tag/op-node%2Fv1.16.5) * Unichain Sepolia: Op Node [op-node/v1.16.5](https://github.com/ethereum-optimism/optimism/releases/tag/op-node%2Fv1.16.5) * Megaeth Mainnet: Megaeth v2.0.10 * Megaeth Testnet: Megaeth v2.0.10 --- # January 15, 2026 | Changelog | Alchemy Docs [Changelog](https://www.alchemy.com/docs/changelog) January 15, 2026 ================ Rollups ------- * Added capability to scale sequencers out with faster CPU hardware. Node ---- **Updates** * [Tempo Moderato](https://www.alchemy.com/docs/reference/tempo-api-quickstart) is now public. * [MegaETH Mainnet](https://www.alchemy.com/docs/reference/megaeth-api-quickstart) is now public. **Upgrades** * Base Mainnet: Reth [v0.2.2](https://github.com/base/node-reth/releases/tag/v0.2.2) , Opgeth [v1.101605.0](https://github.com/ethereum-optimism/op-geth/releases/tag/v1.101605.0) , Op Node [op-node/v1.16.2](https://github.com/ethereum-optimism/optimism/releases/tag/op-node%2Fv1.16.2) * Base Sepolia: Opgeth [v1.101605.0](https://github.com/ethereum-optimism/op-geth/releases/tag/v1.101605.0) , Opnode [op-node/v1.16.2](https://github.com/ethereum-optimism/optimism/releases/tag/op-node%2Fv1.16.2) * Bsc Mainnet: Geth [v1.6.6](https://github.com/bnb-chain/bsc/releases/tag/v1.6.6) * Eth Mainnet: Geth [v1.16.8](https://github.com/sigp/lighthouse/releases/tag/v8.0.1) , Lighthouse [v8.0.1](https://github.com/sigp/lighthouse/releases/tag/v8.0.1) * Eth Sepolia: Geth [v1.16.6](https://github.com/sigp/lighthouse/releases/tag/v8.0.0-rc.1) , Lighthouse [v8.0.0-rc.1](https://github.com/sigp/lighthouse/releases/tag/v8.0.0-rc.1) * Mantle Mainnet: Opnode [v1.4.2](https://github.com/mantlenetworkio/networks/releases/tag/v1.4.2) , Opgeth [v1.4.2](https://github.com/mantlenetworkio/networks/releases/tag/v1.4.2) * Polygon Amoy: Heimdall [v0.5.6](https://github.com/0xPolygon/heimdall-v2/releases/tag/v0.5.6) , Erigon [v3.3.7](https://github.com/0xPolygon/erigon/releases/tag/v3.3.7) , Bor [v2.5.7](https://github.com/maticnetwork/bor/releases/tag/v2.5.7) * Polygon Mainnet: Heimdall [v0.5.6](https://github.com/0xPolygon/heimdall-v2/releases/tag/v0.5.6) , Bor [v2.5.7](https://github.com/0xPolygon/bor/releases/tag/v2.5.7) * Soneium Mainnet: Op Node [op-node/v1.16.5](https://github.com/ethereum-optimism/optimism/releases/tag/op-node%2Fv1.16.5) * Soneium Sepolia: Op Node [op-node/v1.16.5](https://github.com/ethereum-optimism/optimism/releases/tag/op-node%2Fv1.16.5) * Starknet Mainnet: Starknet [v0.21.5](https://github.com/eqlabs/pathfinder/releases/tag/v0.21.5) * Starknet Sepolia: Starknet [v0.21.5](https://github.com/eqlabs/pathfinder/releases/tag/v0.21.5) * Story Mainnet: Geth [v1.2.0](https://github.com/piplabs/story-geth/releases/tag/v1.2.0) , Story [v1.4.2](https://github.com/piplabs/story/releases/tag/v1.4.2) * Worldchain Mainnet: Op Node [op-node/v1.16.5](https://github.com/ethereum-optimism/optimism/releases/tag/op-node%2Fv1.16.5) * Worldchain Sepolia: Op Node [op-node/v1.16.5](https://github.com/ethereum-optimism/optimism/releases/tag/op-node%2Fv1.16.5) --- # January 29, 2026 | Changelog | Alchemy Docs [Changelog](https://www.alchemy.com/docs/changelog) January 29, 2026 ================ Node ---- **Upgrades** * Megaeth Mainnet: Megaeth v2.0.12 * Polygon Amoy: Heimdall [v0.6.0](https://github.com/0xPolygon/heimdall-v2/releases/tag/v0.6.0) * Polygon Mainnet: Heimdall [v0.6.0](https://github.com/0xPolygon/heimdall-v2/releases/tag/v0.6.0) * Sui Mainnet: Sui [mainnet-v1.64.1](https://github.com/MystenLabs/sui/releases/tag/mainnet-v1.64.1) --- # January 8, 2026 | Changelog | Alchemy Docs [Changelog](https://www.alchemy.com/docs/changelog) January 8, 2026 =============== Node ---- **Upgrades** * Astar Mainnet: Runtime [runtime-2000](https://github.com/AstarNetwork/Astar/releases/tag/runtime-2000) * Opbnb Mainnet: Opgeth [v0.5.9](https://github.com/bnb-chain/op-geth/releases/tag/v0.5.9) , Opnode [v0.5.5](https://github.com/bnb-chain/opbnb/releases/tag/v0.5.5) * Polygon Amoy: Heimdall [v0.5.4](https://github.com/0xPolygon/heimdall-v2/releases/tag/v0.5.4) , Erigon [v3.3.6-beta3](https://github.com/0xPolygon/erigon/releases/tag/v3.3.6-beta3) , Bor [v2.5.6-beta6](https://github.com/maticnetwork/bor/releases/tag/v2.5.6-beta6) * Solana Mainnet: Solana [v3.0.12](https://github.com/anza-xyz/agave/releases/tag/v3.0.12) , Yellowstone Grpc Plugin [v9.0.0+solana.2.3.6](https://github.com/rpcpool/yellowstone-grpc/releases/tag/v9.0.0%2Bsolana.2.3.6) --- # August 21, 2025 | Changelog | Alchemy Docs [Changelog](https://www.alchemy.com/docs/changelog) August 21, 2025 =============== Node ---- **Upgrades** * Berachain Mainnet: Reth [v1.0.1](https://github.com/berachain/bera-reth/releases/tag/v1.0.1) , Beacond [v1.3.1](https://github.com/berachain/beacon-kit/releases/tag/v1.3.1) * Celestia Testnet: Celestia [v0.25.2-mocha](https://github.com/celestiaorg/celestia-node/releases/tag/v0.25.2-mocha) * Celo Alfajores: Opnode [celo-v2.1.0](https://github.com/celo-org/optimism/releases/tag/celo-v2.1.0) , Opgeth [celo-v2.1.2](https://github.com/celo-org/op-geth/releases/tag/celo-v2.1.2) * Celo Sepolia: Opnode [celo-v2.1.0](https://github.com/celo-org/optimism/releases/tag/celo-v2.1.0) , Opgeth [celo-v2.1.2](https://github.com/celo-org/op-geth/releases/tag/celo-v2.1.2) * Optimism Mainnet: Op Reth [v1.6.0](https://github.com/paradigmxyz/reth/releases/tag/v1.6.0) * Polygon Amoy: Bor [v2.2.10-beta](https://github.com/maticnetwork/bor/releases/tag/v2.2.10-beta) * Solana Mainnet: Agave [v2.3.7](https://github.com/anza-xyz/agave/releases/tag/v2.3.7) , Yellowstone Grpc Plugin [v7.0.0+solana.2.2.15](https://github.com/rpcpool/yellowstone-grpc/releases/tag/v7.0.0%2Bsolana.2.15) Wallets ------- * **New Funding page (Wallets in Dashboard)** — Fund crypto wallets with traditional payment methods. Convert fiat to stablecoins and cryptocurrency using credit cards, bank transfers, or ACH. [Funding page](https://dashboard.alchemy.com/services/funding/overview?utm_source=docs&utm_medium=referral&utm_content=changelog_2025_8_21) * **Solana external wallets** supported; SDK login modal is more customizable. * **ERC-20 gas sponsorship** is now exposed as a **capability in the new Wallet APIs** (feature existed previously; this surfaces it in the API). * **EIP-1193 / EIP-5792 compliance**: added handler for `wallet_getCapabilities`. * **Custom JWT auth** in account-kit; services can infer auth provider from project config UUID. * **Experimental multi-owner user deletion** in SDK and APIs. * **Security & Identity**: stronger MFA (unified OTP handlers); OIDC can return access tokens; OAuth custom providers support `audience`; added OIDC discovery endpoint. * **Reliability & fixes**: corrected permit-deadline parsing in paymaster services. * **Wallets Docs Big Improvements** — Full [redesign](https://www.alchemy.com/docs/wallets) to a feature-first information architecture with redesigned navigation and clearer flows, including new guides like **[conditional gas sponsorship](https://www.alchemy.com/docs/reference/conditional-gas-sponsorship) **. Rollups ------- * **[Tea mainnet](https://tea.xyz/) launched** — network focused on rewarding open-source contributors. Developer Experience -------------------- * Improvements to the [billing page](https://dashboard.alchemy.com/settings/billing/manage-plan?utm_source=docs&utm_medium=referral&utm_content=changelog_2025_8_21) to make it easier for admins to update their billing details * New **MCP Server** setup [guide](https://www.alchemy.com/docs/alchemy-mcp-server) to allow AI agents and tools to directly query and analyze blockchain data. * **Flashbots on Unichain** [quickstart](https://www.alchemy.com/docs/reference/unichain-flashblocks-api-quickstart) . * **Eth Beacon API** methods [documentation](https://www.alchemy.com/docs/node/ethereum/ethereum-beacon-api-endpoints/ethereum-beacon-api-endpoints/v-2-beacon-blocks-block-id-attestations) . * **Celo**: [FAQ](https://www.alchemy.com/docs/reference/celo-chain-api-faq) updated for migration to **Celo Sepolia**. --- # September 4, 2025 | Changelog | Alchemy Docs [Changelog](https://www.alchemy.com/docs/changelog) September 4, 2025 ================= Wallets ------- * **AA-SDK: smarter clients & a new status hook** — Refactored hooks to work directly with smart wallet clients, improved client tracking and error handling and added `useWaitForCallsStatus` for polling call statuses. * **Wallets Docs** — New [React quickstart](https://www.alchemy.com/docs/wallets/quickstart) plus [Tailwind/setup](https://www.alchemy.com/docs/wallets/react/tailwind-setup) guides; clearer external wallet integration & customization flows; updated OpenID/OIDC & JWT docs; Rollups ------- * **Arbitrum Stack: BoLD support (rolling out)** — Upgrading Arbitrum Stack rollups to support **BoLD**, Arbitrum’s new dispute protocol that enables permissionless validation of chain state for stronger security and decentralization. Rollout has begun on select chains, with more to follow. * **More resilient block building** — Improvements to block building reliability when there are issues connecting to the Beacon Chain. Developer Experience -------------------- * **Easier quickstart with Rollups in dashboard** — Added a step-by-step [quickstart guide](https://dashboard.alchemy.com/services/rollups/quickstart?utm_source=docs&utm_medium=referral&utm_content=changelog_2025_9_4) to Rollups tab so you can get started with it easily. * **Docs updates** - Added missing chain docs (XMTP, tea, settlus, rise, ronin, frax, zora, degen, gensyn), deprecated Geist chain, added flashblocks quickstart guide to OP Mainnet & updated `eth_getLogs` blockrange [limit](https://www.alchemy.com/docs/node/ethereum/ethereum-api-endpoints/eth-get-logs) for free tier. Node Upgrades ------------- * Sei Mainnet: Seid [v6.1.9](https://github.com/sei-protocol/sei-chain/releases/tag/v6.1.9) * Sonic Mainnet: Sonic [v2.1.0](https://github.com/0xsoniclabs/sonic/releases/tag/v2.1.0) * Starknet Mainnet: Starknet [v0.20.1](https://github.com/eqlabs/pathfinder/releases/tag/v0.20.1) --- # February 5, 2026 | Changelog | Alchemy Docs [Changelog](https://www.alchemy.com/docs/changelog) February 5, 2026 ================ Node ---- * Made Citrea Mainnet public * Made Sui Mainnet and Testnet public **Upgrades** * Megaeth Mainnet: Megaeth v2.0.13 * Base Mainnet: Opnode [op-node/v1.16.5](https://github.com/ethereum-optimism/optimism/releases/tag/op-node%2Fv1.16.5) , Reth [v0.2.2](https://github.com/base/node-reth/releases/tag/v0.2.2) * Base Sepolia: Reth [v0.2.2](https://github.com/base/node-reth/releases/tag/v0.2.2) * Monad Mainnet: Monad [0.12.7](https://github.com/category-labs/monad/tree/main) * Polygon Mainnet: Bor [v2.5.8](https://github.com/0xPolygon/bor/releases/tag/v2.5.8) * Sei Mainnet: Seid [v6.3.1](https://github.com/sei-protocol/sei-chain/releases/tag/v6.3.1) * Story Aeneid: Geth [v1.2.0](https://github.com/piplabs/story-geth/releases/tag/v1.2.0) , Story [v1.5.2](https://github.com/piplabs/story/releases/tag/v1.5.2) * Story Mainnet: Geth [v1.2.0](https://github.com/piplabs/story-geth/releases/tag/v1.2.0) , Story [v1.5.2](https://github.com/piplabs/story/releases/tag/v1.5.2) --- # September 25, 2025 | Changelog | Alchemy Docs [Changelog](https://www.alchemy.com/docs/changelog) September 25, 2025 ================== Developer Experience -------------------- ### Dashboard * Fixes and reliability improvements to Webhooks * Automatic creation of smart wallets configs upon app creation for faster integration ### Docs * Guides to help you build with AI * [Add Alchemy RPC To Any Project using Cursor](https://www.alchemy.com/docs/add-alchemy-rpc-to-any-project) * [Build a Web3 Dashboard with Cursor](https://www.alchemy.com/docs/web3-dashboard-prompt) * Revamped quickstart guides * [Alchemy quickstart guide](https://www.alchemy.com/docs/alchemy-quickstart-guide) * [Create an API key](https://www.alchemy.com/docs/create-an-api-key) * [Make your first Alchemy request](https://www.alchemy.com/docs/make-your-first-request) * [Set up Alchemy with Viem](https://www.alchemy.com/docs/set-up-alchemy-with-viem) Wallets ------- Shipped [Server Wallets](https://www.alchemy.com/docs/wallets/authentication/login-methods/server-wallets) . Server wallets enable backend applications to programmatically control wallets using access keys, without requiring interactive authentication. This is perfect for automated systems, batch operations, or when you need to sign transactions from your backend. Node ---- **Upgrades** * Aptos Testnet: Aptos [aptos-node-v1.35.1-rc](https://github.com/aptos-labs/aptos-core/releases/tag/aptos-node-v1.35.1-rc) * Berachain Mainnet: Reth [v1.7.0](https://github.com/paradigmxyz/reth/releases/tag/v1.7.0) , Beacond [v1.3.1](https://github.com/berachain/beacon-kit/releases/tag/v1.3.1) * Bsc Mainnet: Erigon [v1.3.13](https://github.com/node-real/bsc-erigon/releases/tag/v1.3.13) * Plasma Mainnet: Reth [v1.7.0](https://github.com/paradigmxyz/reth/releases/tag/v1.7.0) , Plasma Consensus 0.12.4 * Polygon Amoy: Bor [v2.3.0-beta4](https://github.com/maticnetwork/bor/releases/tag/v2.3.0-beta4) * Arbitrum One: Nitro [v3.7.1](https://github.com/OffchainLabs/nitro/releases/tag/v3.7.1) * Solana Mainnet: Solana [2.3.6](https://github.com/anza-xyz/agave/releases/tag/v2.3.6) , Yellowstone Grpc Plugin [v9.0.0+solana.2.3.6](https://github.com/rpcpool/yellowstone-grpc/releases/tag/v9.0.0%2Bsolana.2.3.6) --- # How EIP-7702 Works | Alchemy Docs Copy page How EIP-7702 Works ================== Alchemy Smart Wallets use [EIP-7702](https://eips.ethereum.org/EIPS/eip-7702) by default to give users access to all Smart Wallet capabilities including gas sponsorship, batching, and more - while keeping the same address. How it works ------------ EIP-7702 enables EOAs (Externally Owned Accounts) to delegate control to Smart Wallets that can execute code directly from their addresses. When using Transaction APIs: * You can use your signer address directly as the account address - no need to call `wallet_requestAccount` first * Transaction APIs automatically detect whether a user must first delegate via EIP-7702 * If delegation is required, Transaction APIs prepare the correct authorization payload * Your application prompts the user to sign when required * We combine the delegation and transaction into a single onchain submission Once delegated, the user's account behaves as a Smart Wallet while keeping the same address and assets. Subsequent transactions only require a single user operation signature. For implementation details, see the [Send Transactions](https://www.alchemy.com/docs/wallets/transactions/send-transactions) guide. How to use non-7702 mode ------------------------ If you need to use a traditional Smart Contract Account instead of EIP-7702, you can opt out of the default 7702 behavior by calling `wallet_requestAccount` first. When you call `wallet_requestAccount` with a signer address, it creates a dedicated Smart Contract Account address. Using this SCA address (instead of your signer address) in subsequent API calls will bypass 7702 mode. **When to use SCA mode:** * Backwards compatibility with existing Smart Contract Accounts * Using chains that don't yet support EIP-7702 * Using a signer that doesn't support signing EIP-7702 authorizations * Specific requirements for smart contract account architecture SDKAPI import { createSmartWalletClient } from "@account-kit/wallet-client"; import { LocalAccountSigner } from "@aa-sdk/core"; import { alchemy, sepolia } from "@account-kit/infra"; const signer = LocalAccountSigner.privateKeyToAccountSigner( process.env.PRIVATE_KEY!, ); const client = createSmartWalletClient({ transport: alchemy({ apiKey: process.env.ALCHEMY_API_KEY! }), chain: sepolia, signer, }); // Request a Smart Contract Account const account = await client.requestAccount(); // Use the SCA address as the `from` param to bypass 7702 mode await client.sendCalls({ from: account.address, calls: [...], }); Advanced -------- How Wallet APIs handle delegation and signing When interacting with Wallet APIs, delegation is handled automatically as part of transaction preparation. If a user has not yet delegated on the target chain, the API response will include **multiple signature requests**: 1. An **EIP-7702 authorization signature** (for delegation) 2. An **ERC-4337 user operation signature** (for the transaction itself) Your application is responsible for: * Prompting the user to sign each request * Returning the signatures to Alchemy We combine these signatures into a single UserOperation and submits it to the bundler. After delegation is completed, future requests only require a user operation signature. EIP-7702 authorization signing When delegation is required, Wallet APIs return a **Prepared EIP-7702 Authorization** object. This includes: * The delegation contract address * A nonce * The chain ID * A `signatureRequest` describing how the authorization must be signed For quick testing purposes, you can simply use `eth_sign` to sign the `signatureRequest.rawPayload`. For production usage, we recommend: * Verifying the delegation address is trusted * Using a dedicated EIP-7702 signing utility to compute the hash to sign Example of signing utility: * [Viem](https://viem.sh/docs/eip7702/signAuthorization) Delegation-only (smart account upgrade) flows You do not need to send a dummy or no-op transaction to perform delegation. If a user needs to upgrade to a Smart Wallet: * Call `wallet_prepareCalls` with your intended calls (or an empty call set) * Wallet APIs detect that delegation is required * The response includes the required authorization and user operation signature requests We handle combining delegation with the user operation automatically. Wallet compatibility considerations Some wallets restrict or block signing EIP-7702 authorizations for security reasons. In particular: * MetaMask only allows delegation to its own contract via its UI * MetaMask does not support signing arbitrary EIP-7702 authorization payloads For MetaMask users, you may need to rely on wallet-native features such as ERC-5792 batching instead of direct EIP-7702 delegation flows. Ensure your users’ wallets support EIP-7702 authorization signing before enabling this flow. EIP-7702 delegations EIP-7702 delegation is now the default mode for Alchemy Smart Wallets. When you use your signer address directly with `wallet_prepareCalls` or other Transaction APIs, 7702 mode is automatically enabled. The `eip7702Auth` capability supports the interface defined in [ERC-7902](https://eips.ethereum.org/EIPS/eip-7902) . Currently, Wallet APIs only support delegation to the following contract: `0x69007702764179f14F51cdce752f4f775d74E139` (Modular Account v2) All other delegation addresses will be rejected. Once delegated, an account remains delegated until the delegation is replaced or removed. To reset an account back to a pure EOA, delegate to `0x0000000000000000000000000000000000000000` as defined in [EIP-7702](https://eips.ethereum.org/EIPS/eip-7702#behavior) . **Undelegating (returning to a pure EOA)** To remove a delegation and return an account to a pure EOA, you must **re-delegate to the zero address**: `0x0000000000000000000000000000000000000000`. **Bundlers cannot relay undelegations**, so you must submit this transaction directly from the account (with enough native gas token to cover fees). If you are re-delegating to another 4337 account, the bundler can relay the delegation. To undelegate: 1. Fund the account with a native gas token. 2. Sign an EIP-7702 authorization delegating to `address(0)` with `currentNonce + 1`. 3. Send an empty transaction (using `currentNonce`) that includes the authorization. We recommend using Viem to sign the EIP-7702 authorization (with `executor: self`): [Viem signAuthorization](https://viem.sh/docs/eip7702/signAuthorization) . Third party signers If you have an existing custom signer or another third-party embedded wallet provider, you can upgrade your embedded EOAs to smart wallets by connecting your existing signer. This will allow you to use EIP-7702 to get features like gas sponsorship, batching, and more. **Requirement:** Your signer or embedded wallet provider must support signing EIP-7702 authorizations in order to delegate to a smart account. To bring your own signer, you create a `SmartAccountSigner` that implements `signAuthorization`. See the details for the interface requirements [here](https://www.alchemy.com/docs/wallets/resources/types#smartaccountsigner) . For example, you can upgrade an existing Privy embedded EOA by extending a Wallet Client to use the `sign7702Authorization` action exposed by Privy. See full example code [here](https://github.com/alchemyplatform/alchemy-wallets-7702-thirdparty-example) . The bulk of the logic happens in [`use-embedded-smart-wallet.ts`](https://github.com/alchemyplatform/alchemy-wallets-7702-thirdparty-example/blob/main/hooks/use-smart-embedded-wallet.ts) . In this react hook, a Privy embedded wallet is wrapped in a `WalletClientSigner` that supports `signAuthorization`. This signer is then passed to `createSmartWalletClient` to construct a client for sending transactions. use-smart-embedded-wallet.ts use-smart-embedded-wallet.ts import { Address, Authorization, createWalletClient, custom } from "viem"; import { useSign7702Authorization } from "@privy-io/react-auth"; import { AuthorizationRequest, WalletClientSigner } from "@aa-sdk/core"; import { sepolia, alchemy } from "@account-kit/infra"; import { useEffect, useState } from "react"; import { createSmartWalletClient, SmartWalletClient, } from "@account-kit/wallet-client"; import { ConnectedWallet as PrivyWallet } from "@privy-io/react-auth"; /\*_ Creates an Alchemy Smart Wallet client for an embedded Privy wallet using EIP-7702. _/; export const useSmartEmbeddedWallet = ({ embeddedWallet, }: { embeddedWallet: PrivyWallet; }) => { const { signAuthorization } = useSign7702Authorization(); const [client, setClient] = useState(); useEffect(() => { const apiKey = process.env.NEXT_PUBLIC_ALCHEMY_API_KEY; if (!apiKey) { throw new Error("Missing NEXT_PUBLIC_ALCHEMY_API_KEY"); } (async () => { const provider = await embeddedWallet.getEthereumProvider(); const baseSigner = new WalletClientSigner( createWalletClient({ account: embeddedWallet.address as Address, chain: sepolia, transport: custom(provider), }), "privy", ); const signer = { ...baseSigner, signAuthorization: async ( unsignedAuth: AuthorizationRequest, ): Promise> => { const signature = await signAuthorization({ ...unsignedAuth, contractAddress: unsignedAuth.address ?? unsignedAuth.contractAddress, }); return { ...unsignedAuth, ...signature, }; }, }; const client = createSmartWalletClient({ chain: sepolia, transport: alchemy({ apiKey, }), signer, policyId: process.env.NEXT_PUBLIC_ALCHEMY_POLICY_ID, }); setClient(client); })(); }, [embeddedWallet, signAuthorization]); return { client }; }; When using the `SmartWalletClient` you must set the `eip7702Auth` capability to `true`, as shown in [`smart-wallet-demo.tsx`](https://github.com/alchemyplatform/alchemy-wallets-7702-thirdparty-example/blob/main/components/smart-wallet-demo.tsx) smart-wallet-demo.tsx smart-wallet-demo.tsx import { ConnectedWallet as PrivyWallet } from "@privy-io/react-auth"; import { useSmartEmbeddedWallet } from "../hooks/use-smart-embedded-wallet"; import { useCallback, useState } from "react"; import type { Address, Hex } from "viem"; export const SmartWalletDemo = ({ embeddedWallet, }: { embeddedWallet: PrivyWallet; }) => { const { client } = useSmartEmbeddedWallet({ embeddedWallet }); const [status, setStatus] = useState< | { status: "idle" | "error" | "sending" } | { status: "success"; txHash: Hex } >({ status: "idle" }); const delegateAndSend = useCallback(async () => { if (!client) { return; } setStatus({ status: "sending" }); try { const { id: callId, } = await client.sendCalls({ capabilities: { eip7702Auth: true, }, from: embeddedWallet.address as Address, calls: [\ {\ to: "0x0000000000000000000000000000000000000000",\ data: "0x",\ },\ ], }); if (!callId) { throw new Error("Missing call id"); } const { receipts } = await client.waitForCallsStatus({ id: callId }); if (!receipts?.length) { throw new Error("Missing transaction receipts"); } const [receipt] = receipts; if (receipt?.status !== "success") { throw new Error("Transaction failed"); } setStatus({ status: "success", txHash: receipt.transactionHash }); } catch (err) { console.error("Transaction failed:", err); setStatus({ status: "error" }); } }, [client, embeddedWallet]); return (

Embedded EOA Address

{embeddedWallet.address}

{status.status === "success" && (

Congrats! Sponsored transaction successful!

You've successfully upgraded your EOA to a smart account and sent your first sponsored transaction.{" "} Keep building .

Transaction Hash:{" "} {status.txHash}

)} {status.status === "error" && (

Transaction Failed

There was an error sending your sponsored transaction. Please try again.

)}
); }; Next steps ---------- Build more: * [Sponsor gas](https://www.alchemy.com/docs/wallets/transactions/sponsor-gas) Was this page helpful? YesNo --- # App Integration | Alchemy Docs Copy page App Integration =============== Initializing Alchemy Provider ----------------------------- Wrap your application with the Alchemy Provider to enable embedded wallet functionality. ### 1\. Create a file: `providers.tsx` "use client"; import { config, queryClient } from "@/config"; import { AlchemyAccountProvider, AlchemyAccountsProviderProps, } from "@account-kit/react"; import { QueryClientProvider } from "@tanstack/react-query"; import { PropsWithChildren } from "react"; export const Providers = ( props: PropsWithChildren<{ initialState?: AlchemyAccountsProviderProps["initialState"]; }>, ) => { return ( {props.children} ); }; ### 2\. Update your `layout.tsx` import { config } from "@/config"; import { cookieToInitialState } from "@account-kit/core"; import type { Metadata } from "next"; import { Inter } from "next/font/google"; import { headers } from "next/headers"; import "./globals.css"; import { Providers } from "./providers"; const inter = Inter({ subsets: ["latin"] }); export const metadata: Metadata = { title: "My App with Embedded Wallets", description: "My app with Alchemy Smart Wallets integration", }; export default async function RootLayout({ children, }: Readonly<{ children: React.ReactNode; }>) { const headersList = await headers(); const initialState = cookieToInitialState( config, headersList.get("cookie") ?? undefined, ); return ( {children} ); } ### 3\. Add authentication to your app Now you can use the Alchemy React components to add wallet authentication anywhere in your app. **Example page with login functionality** "use client"; import { useAuthModal, useLogout, useSignerStatus, useUser, } from "@account-kit/react"; export default function Home() { const user = useUser(); const { openAuthModal } = useAuthModal(); const signerStatus = useSignerStatus(); const { logout } = useLogout(); return (
{signerStatus.isInitializing ? ( <>Loading... ) : user ? (

Success!

You're logged in as {user.email ?? "anon"}.
) : ( )}
); } Now that you have basic authentication working, you can explore additional features: [Send User Operations\ \ Learn how to perform transactions by sending user operations with your smart wallet.](https://www.alchemy.com/docs/wallets/transactions/send-transactions) [Customize UI Components\ \ Customize and style the UI components to match your application's design.](https://www.alchemy.com/docs/wallets/react/ui-components) [Add Gas Sponsorship\ \ Enable gasless transactions by setting up gas sponsorship for your users.](https://www.alchemy.com/docs/wallets/transactions/sponsor-gas) [Multi-Factor Authentication\ \ Enhance security by implementing multi-factor authentication for your users.](https://www.alchemy.com/docs/wallets/react/mfa/setup-mfa) Was this page helpful? YesNo --- # Alchemy MCP Server | Alchemy Docs Copy page Alchemy MCP Server ================== Get started with the Alchemy Model Context Protocol (MCP) server. The Model Context Protocol (MCP) is an open protocol designed to allow AI agents, IDEs, and automation tools to consume, query, and analyze structured data through context-aware APIs. This server exposes Alchemy's APIs through the MCP protocol, allowing AI agents and tools to directly query and analyze blockchain data. Quick Setup ----------- To quickly set up the Alchemy MCP server, add this configuration to your MCP config file (typically found in Claude Desktop or Cursor settings): { "mcpServers": { "alchemy": { "command": "npx", "args": [\ "-y",\ "@alchemy/mcp-server"\ ], "env": { "ALCHEMY_API_KEY": "YOUR_API_KEY" } } } } > The Alchemy MCP server currently only supports [STDIO transport](https://modelcontextprotocol.io/specification/2025-06-18/basic/transports#stdio) > for local MCP client use. Remote connection to the MCP server via [Streamable-Http transport](https://modelcontextprotocol.io/specification/2025-06-18/basic/transports#streamable-http) > is currently in development. > Want to learn more about Alchemy's MCP Server? Visit the official repo [here](https://github.com/alchemyplatform/alchemy-mcp-server) > or read more below! Key Features of Alchemy MCP Server ---------------------------------- * Query token prices and price history (including flexible time frame queries) * Get NFT ownership information and contract data * View transaction history across multiple networks * Check token balances across multiple blockchain networks * Retrieve detailed asset transfers with filtering How You Would Use The Alchemy MCP Server ---------------------------------------- AI agents like Claude, Cursor, and ChatGPT are “chat agents” by default. To work with MCP, they act as **MCP clients**. Within an MCP client like Cursor, you can define an `mcp.json` configuration file that specifies: * Which MCP servers the agent should connect to * What environment variables and arguments to pass so the server runs correctly Once connected, the client instantly gains access to all the tools defined in the server, enabling the LLM to use them in real time. The main focus right now for Alchemy MCP is on: * Local developers using Claude Code or Cursor * Developers running AI agents locally that need access to blockchain data Alchemy MCP Video Walkthrough ----------------------------- Was this page helpful? YesNo --- # Alchemy Subgraphs Deprecation Notice | Alchemy Docs Copy page Alchemy Subgraphs Deprecation Notice ==================================== Alchemy Subgraphs has been sunset. Learn how to migrate to Goldsky. Alchemy Subgraphs was sunset on December 8, 2025. All subgraph and query endpoints have been discontinued. We've partnered with [Goldsky](https://goldsky.com/?utm_source=alchemy&utm_medium=email&utm_campaign=alchemy_migration) to offer you a more powerful indexing solution. Migrate to Goldsky ------------------ To continue using subgraphs, migrate to Goldsky — they support all Alchemy networks and subgraph features. 1. [Sign up for Goldsky](https://app.goldsky.com/signup?utm_source=alchemy&utm_medium=email&utm_campaign=alchemy_migration) 2. [Follow the migration guide](https://docs.goldsky.com/subgraphs/migrate-from-alchemy/guide?utm_source=alchemy&utm_medium=email&utm_campaign=alchemy_migration) (takes less than 30 minutes) 3. [View feature & pricing comparison](https://docs.goldsky.com/subgraphs/migrate-from-alchemy/comparison?utm_source=alchemy&utm_medium=email&utm_campaign=alchemy_migration) Why Goldsky? ------------ We partnered with a provider that raises the bar for indexing performance: * **Products:** [Subgraphs](https://goldsky.com/products/subgraphs?utm_source=alchemy&utm_medium=email&utm_campaign=alchemy_migration) , [Webhooks](https://docs.goldsky.com/subgraphs/webhooks?utm_source=alchemy&utm_medium=email&utm_campaign=alchemy_migration) (subgraph events), and [Mirror](https://docs.goldsky.com/mirror/introduction?utm_source=alchemy&utm_medium=email&utm_campaign=alchemy_migration) (data streaming) * **Features:** Every network and feature from Alchemy Subgraphs included * **Reliability:** 99.99%+ uptime SLAs and real-time support For questions about migration, contact [Goldsky support](https://goldsky.com/?utm_source=alchemy&utm_medium=email&utm_campaign=alchemy_migration) . Was this page helpful? YesNo --- # Alchemy Sandbox | Alchemy Docs Copy page Alchemy Sandbox =============== Guide on setting up a request on the Alchemy Sandbox to simulate your app behavior and data requests What is the Alchemy Sandbox? ============================ The Alchemy Sandbox is a tool that allows users to simulate blockchain method calls using Alchemy's API endpoints. It is designed to streamline the development and debugging process for Web3 applications by providing an interactive "play" environment to build and test calls against Alchemy's supported blockchain networks. ![](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1749481314%2Fdocs%2FScreenshot_2025-06-09_at_8.01.49_AM_x1xbmh.png&w=3840&q=75) What can I do with Alchemy's Sandbox? ===================================== With Alchemy's Sandbox, you can quickly create, debug, and share API requests -- all without a single line of setup. What blockchain networks can I simulate calls on using Alchemy Sandbox? ======================================================================= As of June 2025, the following networks (including their respective test networks) are supported: Abstract, ApeChain, Anime, Arbitrum, Arbitrum Nova, Astar, Avalanche, Base, Berachain, Blast, BNB Smart Chain, Celo, CrossFi, Degen, Ethereum, Fantom Opera, Flow EVM, Frax, Gnosis, Ink, Lens, Linea, Mantle, Metis, Monad, OP Mainnet, opBNB, Polygon PoS, Polygon zkEVM, Polynomial, Ronin, Rootstock, Scroll, Sei, Settlus, Shape, Solana, Soneium, Sonic, Starknet, Story, Superseed, Tea, Unichain, World Chain, XMTP, ZetaChain, ZKsync, Zora Note: API support varies by chain. How to set up a request on Alchemy Sandbox ========================================== Setting up a method request on Alchemy's sandbox is easy. Let's set up a simple `eth_getBalance` request on Ethereum mainnet: 1. 1. Visit the [Alchemy Sandbox](https://dashboard.alchemy.com/sandbox?utm_source=docs&utm_medium=referral&utm_content=alchemy-sandbox) in the Dashboard ![Untitled](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1749482005%2Fdocs%2FScreenshot_2025-06-09_at_8.13.06_AM_lbl2fq.png&w=3840&q=75) 2. Click the `Select an app` dropdown and select your application if you want the simulated request to use your app's API key, allowing you to test your key and analytics directly if needed. Otherwise, you can leave the default `Sandblox Demo App` as the selection. ![](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1749482452%2Fdocs%2FScreenshot_2025-06-09_at_8.20.47_AM_g6hdtp.png&w=3840&q=75) 3. In the `Chain and network` section, select the chain and its respective network. Since we want to get the latest block number on Ethereum mainnet, we will select `Ethereum` and `Ethereum mainnet`. ![](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1749482584%2Fdocs%2FScreenshot_2025-06-09_at_8.22.58_AM_wrstf3.png&w=3840&q=75) 4. The `Category` section is useful if you want to see what methods are available for each API category supported on the selected chain. You'll notice toggling the `Chain and Network` selection to `Arbitrum` will reduce the Categories available down, indicating what APIs are supported on that chain. For now, you can leave it blank as we are only setting up a simple request. ![](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1749482721%2Fdocs%2FScreenshot_2025-06-09_at_8.25.16_AM_uwtiav.png&w=3840&q=75) 5. If not already selected, make sure to toggle to the `eth_getBalance` in the `Method` section of the Sandbox. You will notice this is a powerful component of the Sandbox, as you can select any method to test out. ![](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1749483543%2Fdocs%2FScreenshot_2025-06-09_at_8.38.58_AM_vxa0m4.png&w=3840&q=75) 5. Your request is now fully set up! Select `Send Request`! 🚀 You can change any of the parameters, like the `Address` or `Block`, if you would like to do further testing. This is a fully customizable "Sandbox" experience. As you change parameters, you'll notice the `Request preview` section on the right side of the screen also adapts to your changes. You can also immediately jump to that endpoint's documentation by selecting `View docs`. ![](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1749483597%2Fdocs%2FScreenshot_2025-06-09_at_8.39.52_AM_ev2hak.png&w=3840&q=75) You will notice a `Response` section appear: ![](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1749483730%2Fdocs%2FScreenshot_2025-06-09_at_8.42.05_AM_snbk0h.png&w=3840&q=75) The balance for the address `0xfe3b557e8fb62b89f4916b721be55ceb828dbd73` is `0.000000000000003285 ether`. Further testing using Alchemy's Sandbox ======================================= Alchemy's Sandbox provides a powerful and user-friendly environment for testing your Web3 applications without the need for local setup or private infrastructure. Whether you're validating requests to Alchemy’s APIs, experimenting across supported chains, or debugging contract interactions, the Sandbox enables faster iteration and smoother development. It's a valuable resource for developers looking to prototype, test, and refine their dApps with confidence—before going live. Was this page helpful? YesNo --- # Request Logs | Alchemy Docs Copy page Request Logs ============ Guide on interacting with request logs on Alchemy's dashboard This guide provides a comprehensive overview of how to use the Request Logs feature in the Alchemy Dashboard to monitor and debug JSON-RPC API requests. ### Why It Matters The Request Logs feature in the Alchemy Dashboard is a powerful tool for developers building on different blockchains. It solves several critical problems: * **Debugging Made Easy**: Request Logs provides a user-friendly interface to search, filter, and analyze historical API requests, saving hours of manual debugging compared to raw log files or custom scripts. * **Transparency and Control**: Developers gain visibility into every JSON-RPC request sent through Alchemy's infrastructure, including successes, failures, and errors, helping identify bottlenecks or misconfigured requests. * **Performance Optimization**: By analyzing request durations, error rates, and method usage, developers can optimize dApp performance and ensure a seamless user experience. Request Logs empowers developers to maintain reliable dApps, reduce downtime, and improve user satisfaction with actionable insights into API interactions. ### How to Use It ![](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1749676270%2FScreenshot_2025-06-11_at_2.11.07_PM_g03ees.png&w=3840&q=75) #### Overview of the Request Logs Feature The Request Logs feature, accessible via the Alchemy Dashboard's Request Explorer, allows you to view and analyze all JSON-RPC requests made to Alchemy's API endpoints for your application. Key functionalities include: **Search and Filter**: Filter requests by parameters such as: * **App**: Filter by a specific app. * **Network**: Filter by a specific blockchain network. * **Method**: Specific JSON-RPC methods (e.g., `eth_blockNumber`, `eth_getLogs`). * **HTTP Response**: Success (2xx) or error codes (4xx, 5xx). * **JSON-RPC Error code**: Filter by specific error codes. * **All errors**: See all requests that resulted in an error. * **Response time**: Time taken for the request to complete. * **JSON-RPC ID**: Filter by a specific request ID. ![](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1749676305%2FScreenshot_2025-06-11_at_2.11.41_PM_eqswvu.png&w=3840&q=75) **Detailed Request View**: Inspect individual requests to see: * Request payload and response. * Error messages (if any). * Node-specific details or network errors. To access Request Logs: 1. Log in to the Alchemy Dashboard. 2. Navigate to the tools section on the sidebar. 3. Click request logs to enter the request logs dashboard. ![](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1749676289%2FScreenshot_2025-06-11_at_2.11.24_PM_rwldpd.png&w=3840&q=75) #### Code Samples Below are code samples to help you interact with Alchemy's API and troubleshoot issues using insights from Request Logs. ##### Sample 1: Fetching the Latest Nonce Before Sending a Transaction If Request Logs show "nonce too low" errors for eth\_sendRawTransaction, use this code to fetch the latest nonce: const { ethers } = require("ethers"); const provider = new ethers.JsonRpcProvider("https://eth-mainnet.g.alchemy.com/v2/YOUR_API_KEY"); async function getLatestNonce(walletAddress) { try { const nonce = await provider.getTransactionCount(walletAddress, "latest"); console.log(`Latest nonce: ${nonce}`); return nonce; } catch (error) { console.error("Error fetching nonce:", error); } } // Example usage getLatestNonce("0xYourWalletAddress"); **Usage**: Run this before sending a transaction to ensure the correct nonce. Check Request Logs to confirm eth\_getTransactionCount requests succeed (HTTP 200). ##### Sample 2: Batching Requests to Avoid Rate Limits If Request Logs show HTTP 429 (Too Many Requests) errors, batch requests using fetch API: const apiKey = "YOUR_API_KEY"; const url = `https://eth-mainnet.g.alchemy.com/v2/${apiKey}`; async function batchRequests() { try { const batchRequest = { jsonrpc: "2.0", method: "batch", params: [\ { jsonrpc: "2.0", id: 1, method: "eth_blockNumber", params: [] },\ { jsonrpc: "2.0", id: 2, method: "eth_getBalance", params: ["0xYourWalletAddress", "latest"] }\ ], id: 1 }; const response = await fetch(url, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(batchRequest) }); const data = await response.json(); console.log("Batch responses:", data); } catch (error) { console.error("Batch request failed:", error); } } batchRequests(); **Usage**: Batching reduces the number of requests, lowering the chance of hitting rate limits. Monitor Request Logs for fewer eth\_blockNumber and eth\_getBalance entries. ### Best Practices #### Pro Tips * **Use Specific Filters**: Combine filters (e.g., method + error code) to quickly isolate issues in Request Explorer. * **Monitor Regularly**: Check Request Logs daily or use Alchemy's Notify API for real-time alerts on errors. * **Leverage Timestamps**: Filter by timestamp to focus on specific timeframes when debugging reported issues. #### Limits * **Data Retention**: Logs are available for up to 10 days. Export logs regularly for longer-term analysis. * **Rate Limits**: HTTP 429 errors indicate rate limit breaches. Optimize with batching or upgrade your plan. * **Block Range for eth\_getLogs**: Limit eth\_getLogs block ranges (e.g., 5,000 blocks) to avoid timeouts. #### Common Issues and Solutions * **Issue**: HTTP 429 (Too Many Requests) in logs. * **Solution**: Use batch requests (see Sample 2) or reduce request frequency. * **Issue**: "Nonce too low" errors in eth\_sendRawTransaction. * **Solution**: Fetch the latest nonce before each transaction (see Sample 1). * **Issue**: Empty or missing logs. * **Solution**: Verify API key, app, and network filters. Check for dashboard delays during high network congestion. #### Additional Notes * **Security**: Avoid exposing API keys in client-side code. Use HTTP header-based authentication. * **Documentation**: See Alchemy's Error Reference for JSON-RPC error codes. * **Support**: Contact Alchemy Support via the dashboard or check the FAQ. By leveraging Request Logs and these practices, you can monitor, debug, and optimize your dApp's API interactions for a reliable user experience. Was this page helpful? YesNo --- # Set Up Alchemy with any Library via AI | Alchemy Docs Copy page Set Up Alchemy with any Library via AI ====================================== Use AI tools to kickoff your Alchemy journey > 👋 **Don't have an API Key?** [Start here](https://www.alchemy.com/docs/create-an-api-key) > before building with AI! Many Coding Languages, Many Great Web3 Libraries ------------------------------------------------ Across coding languages you'll find many [great web3 libraries](https://www.alchemy.com/dapps/best/web3-libraries) . In most cases the best place to start would be to consult the documentation of the web3 library you're using OR, as we'll recommend below, [build with AI tools](https://www.alchemy.com/docs/docs/tutorials/build-with-ai/ai-powered-id-es) . If you are starting from your favorite tools' documentation, look for json rpc provider or client HTTP transport. That's where you'll configure your Alchemy URL! Essentially you will be pointing your library to your node, and you'll be using Alchemy to host your nodes for you! Quickstart with AI ------------------ There's no easier way than to get started with something like [cursor](https://cursor.com/) or [claude code](https://claude.com/product/claude-code) as shown in this video: Simply tell your AI tool to "write a script using ethers.js connected to Alchemy" and you'll be off to the races! One key thing to keep in mind is that the AI tool may not have the most recent documentation available, so often times it may be useful to tell it to consult the most recent docs. For all Alchemy docs you can scroll up to the top of the page and click "Copy Page" to get the info your AI tool needs to be completely up to date with the particular documentation! Next Steps ---------- So, what's next for you? * Want to build an application using the latest and greatest web3 login experience? Check out [getting started with our wallets](https://www.alchemy.com/docs/docs/wallets/react/quickstart) . * Need the industry best APIs to access blockchain data (tokens, transfers, nfts, prices and more)? Jump on over to our [data APIs](https://www.alchemy.com/docs/docs/reference/data-overview) . * Want to find all the methods available to you on our node API? Check out the [documentation here](https://www.alchemy.com/docs/docs/reference/node-api-overview) . * Need to learn more about crypto? We've got you covered at [Alchemy University](https://university.alchemy.com/) . Was this page helpful? YesNo --- # What is a 51% attack? | Alchemy Docs Copy page What is a 51% attack? ===================== A 51% attack occurs when a miner group controls over 50% of a network, allowing them to double-spend transactions. It's costly and requires more than 51% resources. Most of us have heard the term 51% attack before, and it sounds terrifying! A 51% attack refers to a point in time where a group of [miners](https://www.alchemy.com/docs/proof-of-work) have control of more than 50% of the network and wish to act maliciously. _How much damage can actually be done during this time?_ 🤔 Let's think about what we have learned. Every block is built upon the hash of the block before it. To change a block that has been confirmed many times, let's say the block has been confirmed 6 times for example, the attacking blockchain would need to mine **8 new blocks before the existing blockchain mines 1** to be [accepted as the Main Chain.](https://www.alchemy.com/docs/what-are-blockchain-consensus-mechanism) This would require _more than just 51% of the resources_! 💰 Of course, the attacking blockchain could also just stubbornly stick to its chain for a longer period of time. The more time they do this, the more expensive the attack becomes. If they had these kind of resources, they could make significant money just playing along honestly! What can the attack actually accomplish? One thing that an attack could do is **double-spend** a transaction, by choosing to override it within the new blocks. So if someone sent you a large payment, they could attack the network and essentially override that payment. Of course, this attack would cost a lot of money, so it's very unlikely this would be cost-effective. For safety purposes, if someone sends you millions of dollars on the blockchain, maybe wait a day or two to be sure it's cleared. We'll talk more about [UTXOs](https://www.alchemy.com/docs/utxo-vs-account-model) which will help us understand how **double-spends** are prevented. **Double-Spends** can occur during a blockchain fork, as shown by the bug caused by the Berkeley DB when the bitcoin network was partially between versions. See [BIP\_0050](https://en.bitcoin.it/wiki/BIP_0050) . Learn More About 51% Attacks ---------------------------- Alchemy University offers [free web3 development bootcamps that explain 51% attacks](https://university.alchemy.com/ethereum) and help developers master the fundamentals of web3 technology. Sign up for free, and start building today! Was this page helpful? YesNo --- # Add Alchemy RPC To Any Project using Cursor | Alchemy Docs Copy page Add Alchemy RPC To Any Project using Cursor =========================================== Learn how to add a server-safe Alchemy JSON RPC endpoint to any project using Cursor This guide helps you add a server-safe Alchemy JSON RPC endpoint into almost any repo using a **single** Cursor prompt, or what we are calling: the "one shot prompt". Your Alchemy URL stays in `.env.local` on the server. The client never sees it; this makes sure your Alchemy API key is protected from client-side attacks. * * * Prerequisites ------------- * [Cursor](https://cursor.sh/) is open at your project root * You have an [Alchemy API Key](https://dashboard.alchemy.com/?a=index&utm_source=docs&utm_medium=referral&utm_content=add-alchemy-rpc-to-any-project) ready to paste into `.env.local` * Optional for smoother automation in Cursor: * Enable Auto run for the terminal * Add a small command allowlist like `npm run dev`, `node`, `mkdir`, `touch` * * * One shot Cursor prompt ---------------------- Paste everything below into Cursor chat from your project root: One shot Cursor prompt You are scaffolding a flexible Alchemy JSON-RPC proxy. Apply changes directly in the repo. Do not echo full files unless I ask later. =============================================================================== Step 0 — Detect environment and set "@/..." alias if Next.js =============================================================================== 1) If an /app directory exists → Next.js App Router mode. 2) Else if a /pages directory exists → Next.js Pages Router mode. 3) Else → Fallback Node mode. If in a Next.js mode, open tsconfig.json and ensure: "baseUrl": "." "paths": { "@/*": ["./*"] } Add them if missing while preserving all other options. =============================================================================== Step 1 — Env templates and .gitignore (CREATE BOTH FILES) =============================================================================== 1) Create a file named .env.example with exactly these lines: # Generic default upstream (used if no chain-specific env is set) ALCHEMY_API_URL=https://eth-mainnet.g.alchemy.com/v2/ # Optional chain-specific overrides ALCHEMY_API_URL_ETH_MAINNET=https://eth-mainnet.g.alchemy.com/v2/ ALCHEMY_API_URL_BASE_MAINNET=https://base-mainnet.g.alchemy.com/v2/ ALCHEMY_API_URL_OPTIMISM_MAINNET=https://opt-mainnet.g.alchemy.com/v2/ ALCHEMY_API_URL_ARBITRUM_MAINNET=https://arb-mainnet.g.alchemy.com/v2/ ALCHEMY_API_URL_POLYGON_MAINNET=https://polygon-mainnet.g.alchemy.com/v2/ 2) In the TERMINAL, create .env.local if it does not already exist by copying from .env.example (do not overwrite existing): node -e "const fs=require('fs');if(!fs.existsSync('.env.local')){fs.copyFileSync('.env.example','.env.local');console.log('Created .env.local from .env.example');}else{console.log('.env.local already exists, not modified');}" 3) Open .gitignore. If it does not already include a line for .env.local, append: .env.local =============================================================================== Step 2 — RPC proxy (create ONE implementation based on the detected mode) =============================================================================== --- A) Next.js App Router (app/api/rpc/route.ts, Edge) --- If /app exists, create app/api/rpc/route.ts with this content: ------------------------------------------------------------ import { NextRequest, NextResponse } from "next/server"; export const runtime = "edge"; // Optional per-chain envs, fallback to generic ALCHEMY_API_URL const URLS: Record = { "eth-mainnet": process.env.ALCHEMY_API_URL_ETH_MAINNET, "base-mainnet": process.env.ALCHEMY_API_URL_BASE_MAINNET, "optimism-mainnet": process.env.ALCHEMY_API_URL_OPTIMISM_MAINNET, "arbitrum-mainnet": process.env.ALCHEMY_API_URL_ARBITRUM_MAINNET, "polygon-mainnet": process.env.ALCHEMY_API_URL_POLYGON_MAINNET, }; export async function POST(request: NextRequest) { const chain = request.headers.get("x-chain") || "eth-mainnet"; const upstream = URLS[chain] || process.env.ALCHEMY_API_URL; if (!upstream) { return NextResponse.json( { error: \`Missing upstream for chain "\${chain}". Set ALCHEMY_API_URL or chain-specific env.\` }, { status: 500 } ); } let payload: unknown; try { payload = await request.json(); } catch { return NextResponse.json({ error: "Invalid JSON body" }, { status: 400 }); } const res = await fetch(upstream, { method: "POST", headers: { "content-type": "application/json" }, // do not forward cookies or browser headers body: JSON.stringify(payload), cache: "no-store", }); let json: any; try { json = await res.json(); } catch { return NextResponse.json( { error: "Upstream returned non-JSON", status: res.status }, { status: 502 } ); } return NextResponse.json(json, { status: res.ok ? 200 : res.status || 502, headers: { "cache-control": "no-store" }, }); } ------------------------------------------------------------ --- B) Next.js Pages Router (pages/api/rpc.ts) --- Else if /pages exists, create pages/api/rpc.ts with this content: ------------------------------------------------------------ import type { NextApiRequest, NextApiResponse } from "next"; const URLS: Record = { "eth-mainnet": process.env.ALCHEMY_API_URL_ETH_MAINNET, "base-mainnet": process.env.ALCHEMY_API_URL_BASE_MAINNET, "optimism-mainnet": process.env.ALCHEMY_API_URL_OPTIMISM_MAINNET, "arbitrum-mainnet": process.env.ALCHEMY_API_URL_ARBITRUM_MAINNET, "polygon-mainnet": process.env.ALCHEMY_API_URL_POLYGON_MAINNET, }; export default async function handler(req: NextApiRequest, res: NextApiResponse) { if (req.method !== "POST") { res.setHeader("Allow", "POST"); return res.status(405).json({ error: "Method not allowed" }); } const chain = (req.headers["x-chain"] as string) || "eth-mainnet"; const upstream = URLS[chain] || process.env.ALCHEMY_API_URL; if (!upstream) { return res .status(500) .json({ error: \`Missing upstream for chain "\${chain}". Set ALCHEMY_API_URL or chain-specific env.\` }); } const payload = req.body ?? {}; const upstreamRes = await fetch(upstream, { method: "POST", headers: { "content-type": "application/json" }, body: typeof payload === "string" ? payload : JSON.stringify(payload), cache: "no-store", }); let data: any = null; try { data = await upstreamRes.json(); } catch { return res.status(502).json({ error: "Upstream returned non-JSON", status: upstreamRes.status }); } res.setHeader("cache-control", "no-store"); return res.status(upstreamRes.ok ? 200 : upstreamRes.status || 502).json(data); } ------------------------------------------------------------ --- C) Fallback Node mode (server/rpc-proxy.mjs + npm script) --- Else (no /app and no /pages), create server/rpc-proxy.mjs with this content: ------------------------------------------------------------ import http from "node:http"; import { readFileSync, existsSync } from "node:fs"; import { resolve } from "node:path"; // Minimal dotenv loader for .env.local or .env function loadDotEnv() { const files = [".env.local", ".env"]; for (const f of files) { const p = resolve(process.cwd(), f); if (existsSync(p)) { const text = readFileSync(p, "utf8"); for (const line of text.split(/\\r?\\n/)) { const m = line.match(/^\\s*([A-Z0-9_]+)\\s*=\\s*(.*)\\s*$/); if (!m) continue; const [, k, raw] = m; if (process.env[k]) continue; const v = raw.replace(/^"(.*)"$/, "$1").replace(/^'(.*)'$/, "$1"); process.env[k] = v; } } } } loadDotEnv(); // Chain map with optional overrides, fallback to generic ALCHEMY_API_URL const URLS = { "eth-mainnet": process.env.ALCHEMY_API_URL_ETH_MAINNET, "base-mainnet": process.env.ALCHEMY_API_URL_BASE_MAINNET, "optimism-mainnet": process.env.ALCHEMY_API_URL_OPTIMISM_MAINNET, "arbitrum-mainnet": process.env.ALCHEMY_API_URL_ARBITRUM_MAINNET, "polygon-mainnet": process.env.ALCHEMY_API_URL_POLYGON_MAINNET, }; const PORT = process.env.PORT ? Number(process.env.PORT) : 8787; const server = http.createServer(async (req, res) => { // CORS for local dev res.setHeader("Access-Control-Allow-Origin", "*"); res.setHeader("Access-Control-Allow-Methods", "POST, OPTIONS"); res.setHeader("Access-Control-Allow-Headers", "Content-Type, x-chain"); if (req.method === "OPTIONS") { res.statusCode = 204; res.end(); return; } if (req.url !== "/rpc" || req.method !== "POST") { res.statusCode = 404; res.setHeader("content-type", "application/json"); res.end(JSON.stringify({ error: "Not found" })); return; } const chain = req.headers["x-chain"]?.toString() || "eth-mainnet"; const upstream = URLS[chain] || process.env.ALCHEMY_API_URL; if (!upstream) { res.statusCode = 500; res.setHeader("content-type", "application/json"); res.end(JSON.stringify({ error: \`Missing upstream for chain "\${chain}". Set ALCHEMY_API_URL or chain-specific env.\` })); return; } let body = ""; for await (const chunk of req) body += chunk; const payload = body || "{}"; try { const upstreamRes = await fetch(upstream, { method: "POST", headers: { "content-type": "application/json" }, body: payload, cache: "no-store", }); const text = await upstreamRes.text(); res.statusCode = upstreamRes.ok ? 200 : upstreamRes.status || 502; res.setHeader("content-type", "application/json"); res.setHeader("cache-control", "no-store"); res.end(text); } catch (e) { res.statusCode = 502; res.setHeader("content-type", "application/json"); res.end(JSON.stringify({ error: "Upstream fetch failed", detail: String(e) })); } }); server.listen(PORT, () => { console.log(\`[rpc-proxy] listening on http://localhost:\${PORT}/rpc\`); }); ------------------------------------------------------------ Also, if in Fallback Node mode, update package.json to include this script (add or merge without removing existing scripts): "rpc-proxy": "node server/rpc-proxy.mjs" =============================================================================== Step 3 — Optional tiny helper and self-test (Next.js modes only) =============================================================================== If in a Next.js mode, create lib/rpc.ts with this content: ------------------------------------------------------------ type JsonRpcError = { code: number; message: string; data?: unknown }; type JsonRpcResponse = { jsonrpc: "2.0"; id: number | string; result?: T; error?: JsonRpcError }; export async function rpc( method: string, params: unknown[] = [], chain: "eth-mainnet" | "base-mainnet" | "optimism-mainnet" | "arbitrum-mainnet" | "polygon-mainnet" = "eth-mainnet" ): Promise { const res = await fetch("/api/rpc", { method: "POST", headers: { "content-type": "application/json", "x-chain": chain }, body: JSON.stringify({ jsonrpc: "2.0", id: Date.now(), method, params }), cache: "no-store", }); if (!res.ok) { const text = await res.text().catch(() => ""); throw new Error(\`RPC HTTP \${res.status}\${text ? \`: \${text}\` : ""}\`); } const data = (await res.json()) as JsonRpcResponse; if (data.error) throw new Error(data.error.message || "RPC error"); return data.result as T; } ------------------------------------------------------------ If in App Router mode, create a dev-only page at app/rpc-selftest/page.tsx with this content: ------------------------------------------------------------ "use client"; import { useEffect, useState } from "react"; import { rpc } from "@/lib/rpc"; function hexToInt(h: string) { try { return parseInt(h, 16); } catch { return NaN; } } export default function SelfTest() { const [ethBlock, setEthBlock] = useState(null); const [baseBlock, setBaseBlock] = useState(null); const [err, setErr] = useState(null); useEffect(() => { (async () => { try { const ethHex = await rpc("eth_blockNumber", [], "eth-mainnet"); const baseHex = await rpc("eth_blockNumber", [], "base-mainnet"); setEthBlock(hexToInt(ethHex)); setBaseBlock(hexToInt(baseHex)); } catch (e: any) { setErr(e?.message ?? "Unknown error"); } })(); }, []); return (

RPC proxy self test

Calls /api/rpc with x-chain header.

{err ? (

Error: {err}

) : (
eth-mainnet block: {ethBlock ?? "…"}
base-mainnet block: {baseBlock ?? "…"}
)}
); } ------------------------------------------------------------ If in Pages Router mode, create docs/RPC-TEST.md with these contents (no code fences needed): # RPC proxy test With the dev server running: curl -s -X POST http://localhost:3000/api/rpc \ -H 'content-type: application/json' \ -H 'x-chain: eth-mainnet' \ -d '{"jsonrpc":"2.0","id":1,"method":"eth_chainId","params":[]}' curl -s -X POST http://localhost:3000/api/rpc \ -H 'content-type: application/json' \ -H 'x-chain: base-mainnet' \ -d '{"jsonrpc":"2.0","id":1,"method":"eth_chainId","params":[]}' ------------------------------------------------------------ =============================================================================== Step 4 — Final instructions for the developer (print in chat) =============================================================================== Tell me: - Which mode was detected (App Router, Pages Router, or Fallback Node). - Which files you created or updated. - Next steps: - Open .env.local and replace with your real Alchemy keys (or set per-chain URLs). - If Next.js: run npm run dev. - App Router: visit http://localhost:3000/rpc-selftest - Pages Router: use the curl examples in docs/RPC-TEST.md - If Fallback Node: run npm run rpc-proxy and POST JSON-RPC to http://localhost:8787/rpc with optional header x-chain. How to call the proxy --------------------- Send JSON RPC 2.0 to `/api/rpc` in Next.js, or to `http://localhost:8787/rpc` in the fallback Node server. Choose the network with `x-chain`. If you omit it, the proxy uses the generic `ALCHEMY_API_URL`. **curl example** curl -s -X POST http://localhost:3000/api/rpc \ -H 'content-type: application/json' \ -H 'x-chain: base-mainnet' \ -d '{"jsonrpc":"2.0","id":1,"method":"eth_chainId","params":[]}' **fetch example** await fetch("/api/rpc", { method: "POST", headers: { "content-type": "application/json", "x-chain": "eth-mainnet", }, body: JSON.stringify({ jsonrpc: "2.0", id: Date.now(), method: "eth_getBalance", params: ["0xYourAddress", "latest"], }), }); Quick verification checklist ---------------------------- * `.env.example` and `.env.local` both exist * One of `ALCHEMY_API_URL` or a chain specific URL is set in `.env.local` * App Router projects open `http://localhost:3000/rpc-selftest` and show block numbers for two chains * Pages Router projects can run the curl commands in `docs/RPC-TEST.md` without errors Was this page helpful? YesNo --- # Best Practices for Key Security and Management | Alchemy Docs Copy page Best Practices for Key Security and Management ============================================== Learn about the best practices for security and management of your keys. This guide is dedicated to key security and management while working with APIs. We'll discuss the different methods to authenticate your API requests, their levels of security and ease of use, and provide some best practice recommendations. API Key Authentication Methods ------------------------------ ![](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764180206%2Fdocs%2Ftutorials%2Fgetting-started%2Fapi-security-and-authentication%2Fec60f77-visual.png&w=3840&q=75) There are three different methods to authenticate your API requests using Alchemy: 1. **Using API Key in URL (Path Parameter)**: This is the easiest method to use, but it is also the least secure. The API key is directly included in the request URL, which makes it vulnerable to exposure in server logs, browser history and cached data. An example of URL based request is: cURL curl -X POST https://eth-mainnet.g.alchemy.com/v2/demo \ -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' 2. **[Using API Key in Request Header](https://www.alchemy.com/docs/how-to-use-api-keys-in-http-headers) **: This method offers enhanced security compared to including the API key in the URL. The API key is embedded within HTTP `Authorization` header as a bearer token, it reduces the security risk as most logging libraries strip the `Authorization` header and browsers do not log headers to history. To learn more about how this approach works and how to implement it, check out our guide on [sending header-based API requests](https://www.alchemy.com/docs/how-to-use-api-keys-in-http-headers) . Below is an example request using this method: cURL curl -X POST https://eth-mainnet.g.alchemy.com/v2/ \ -H "Content-Type: application/json" \ -H "Authorization: Bearer demo" \ -d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' 3. **[Using JWT Tokens](https://www.alchemy.com/docs/how-to-use-jwts-for-api-requests) **: JSON Web Tokens (JWTs) are a more secure and flexible method for authorizing API requests. They provide the ability to generate an unlimited number of keys and set custom expiration periods. However, they are also the most difficult to implement and require running your own backend server. To learn about how this approach works and how to implement it, check out our guide on [using JWT tokens for API requests](https://www.alchemy.com/docs/how-to-use-jwts-for-api-requests) . Below you can find an example request using JWT: cURL curl -X POST https://eth-mainnet.g.alchemy.com/v2/ \ -H "Content-Type: application/json" \ -H "Authorization: Bearer " \ -d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' * * * Best Option Based on Situation ------------------------------ Different situations call for different methods of API key use: * **Frontend Exposure (e.g., DApp UI)**: If you are exposing keys to the frontend, it's better to use JWTs with very short expiration periods. JWTs reduce the lifetime of validity in the frontend by enabling backends to push new keys regularly. This means that even if a key is stolen, it will expire quickly. * **Backend Service Use**: If you are using the key in a backend service where it won't be exposed, the minimum security recommendation is to use API keys in the request headers. Headers offer better security than URLs, as many servers log URLs by default but do not log headers. * * * Key Rotation ------------ Key rotation is an important part of secure key management: **JWTs**: When using JWTs, you need to rotate the tokens before they expire. If you don't, your project will stop working when the token expires. **API Keys**: With API keys, if you suspect that your key has been leaked, you should immediately generate a new one. Regardless of leakage suspicion, it is recommended to rotate the API key annually as a best practice. * * * JWT Expiration Times -------------------- The expiration time of JWTs depends on the project and the desired level of security. In general, shorter expiration times increase the security of your JWTs. This is because even if a token is stolen, it will become useless after a short period of time. However, shorter expiration times also mean you will need to manage frequent token rotations. * * * Using Proper Permissions ------------------------ When creating an API key through the security console, it's important that you assign proper permissions and an expiry date for your API key. For example, if you are creating an API key that will only be used for making JSON-RPC & NFT API requests, only select that particular permission, so it cannot be used for any other activity. It's also recommended to set an expiry date which will force you to rotate the key after the expiration period. ![](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764180207%2Fdocs%2Ftutorials%2Fgetting-started%2Fapi-security-and-authentication%2Fa452d0e-image.png&w=3840&q=75) By understanding these best practices for key security and management, you can make better decisions about how to secure your API keys and manage them effectively. Remember, the goal is to choose the right balance between convenience and security that suits your specific needs. Was this page helpful? YesNo --- # Best Practices for Deploying a Smart Contract on EVM Mainnets | Alchemy Docs Copy page Best Practices for Deploying a Smart Contract on EVM Mainnets ============================================================= Best practices to follow when deploying your contracts to the mainnet. Don’t have an API key? Sign up or upgrade your plan for access. [Get started for free](https://dashboard.alchemy.com/signup?utm_source=docs&utm_medium=referral&utm_content=best-practices-for-deploying-a-smart-contract-on-evm-mainnets-1) Introduction ============ So you have deployed your smart contract on a testnet, it's working fine and now you want to deploy it to the mainnet. Before you deploy it to the mainnet, there are a few things you should take into consideration. This guide will go through some of those considerations, such as gas optimizations, auditing and security, verifying source code and managing keys securely. ![651](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764192928%2Fdocs%2Ftutorials%2Fgetting-started%2Fdeveloper-best-practices%2F2130289-mainnet-deployment-meme.jpg&w=3840&q=75 "mainnet-deployment-meme.jpeg") Gas Optimizations ================= Review your smart contract to see if there are any [gas optimizations](https://www.alchemy.com/overviews/solidity-gas-optimization) that can be made. Gas optimization is important in smart contracts because it allows for more efficient execution of code. By optimizing the gas usage, smart contracts can run more quickly and efficiently. This can lead to lower costs and faster execution times. Gas optimizations can save millions of dollars in user funds as they lower the gas fees required to interact with the smart contract. This ultimately leads to a better user experience. Check out Alchemy's guide on [Gas Optimization Techniques](https://www.alchemy.com/overviews/solidity-gas-optimization) and see if you can implement any of these techniques in your smart contract. Auditing ======== When deploying a smart contract to the mainnet, it is a good idea to audit the contract first to ensure that it is secure and does not contain any vulnerabilities. This is because once a contract is deployed, it is very difficult to change or update it, so it is important to make sure that it is correct before deploying it. Review [smart contract security best practices](https://www.alchemy.com/overviews/smart-contract-security-best-practices) and make sure that your smart contract adheres to these best practices. If you have enough funds, you can also request a security audit from security audit firms like Quantstamp, Trail of Bits or Openzeppelin, if not, always ask another developer to review your smart contract. Keep in mind that audits do not guarantee that there are no bugs, but having several experienced security researchers go through your code can certainly help. Also check out [A Developer's Guide To Securing Ethereum Smart Contracts](https://alchemy.com/blog/a-developers-guide-to-securing-ethereum-smart-contracts) by Alchemy. Key Management ============== You need to be extra careful when securing your private keys while working on mainnet. The accounts you use to deploy and interact with your contracts will contain actual Ether, which has real value and is an appealing target for hackers. Do everything you can to protect your keys, and consider using a hardware wallet if necessary. Additionally, you may define certain accounts to have special privileges in your system - and you should take extra care to secure them. These accounts are called Admin accounts. An administrator account is one that has more privileges than a regular account. For example, an administrator may have the power to pause a contract. If such an account were to fall into the hands of a malicious user, they could wreak havoc in your system. A good option for securing administrator accounts is to use a special contract, such as a multisig, instead of a regular externally owned account. A multisig is a contract that can execute any action, as long as a predefined number of trusted members agree upon it. Gnosis Safe is a good multisig to use. Verifying Your Source Code ========================== It's important to verify the source code of your contracts after you deploy them to the mainnet. This process involves submitting the Solidity code to a third-party, such as Etherscan or Etherchain, who will compile it and verify that it matches the deployed assembly. This allows any user to view your contract code in a block explorer, and know that it corresponds to the assembly actually running at that address. It builds trust for the project among users as they can verify exactly what they are interacting with. You can verify your contracts manually on the [Etherscan](https://etherscan.io/verifyContract) website or if you want to verifty the contracts programatically, you can use the [Hardhat Etherscan](https://hardhat.org/hardhat-runner/plugins/nomiclabs-hardhat-etherscan) plugin. Conclusion ========== Congratulations! You have now learned the best practices to use when deploying your contract on the mainnet. If you follow these steps, you will have a safe and successful deployment. Was this page helpful? YesNo --- # Asset Changes - Explained | Alchemy Docs Copy page Asset Changes - Explained ========================= Dive into the Asset Changes API with this detailed example of simulating a transaction to swap 1 USDC for UNI using Uniswap V2. The beauty of simulation is that we can use any `from` address! Let's simulate a transaction using the Asset Changes API and explain the results. We will swap 1 USDC for UNI using Uniswap V2 as our example. curl curl --location --request POST 'https://eth-mainnet.g.alchemy.com/v2/YOUR_KEY' \ --header 'Content-Type: application/json' \ --data-raw '{ "jsonrpc": "2.0", "method": "alchemy_simulateAssetChanges", "id": 1, "params": [\ {\ "from": "0x07Eee3bfdfA311f6f06D419C8cCcA08a6EfDD162",\ "to": "0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D",\ "value": "0x0",\ "data": "0x38ed173900000000000000000000000000000000000000000000000000000000000f4240000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000007eee3bfdfa311f6f06d419c8ccca08a6efdd162000000000000000000000000000000000000000000000000000000006b49d2000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000001f9840a85d5af5bf1d1762f925bdaddc4201f984"\ }\ ] }' Response { "jsonrpc": "2.0", "id": 1, "result": { "changes": [\ {\ "assetType": "ERC20",\ "changeType": "TRANSFER",\ "from": "0x07eee3bfdfa311f6f06d419c8ccca08a6efdd162",\ "to": "0xebfb684dd2b01e698ca6c14f10e4f289934a54d6",\ "rawAmount": "1000000",\ "contractAddress": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",\ "tokenId": null,\ "decimals": 6,\ "symbol": "USDC",\ "name": "USD Coin",\ "logo": "https://alchemyapi-res.cloudinary.com/image/upload/v1764179958/docs/api-reference/alchemy-transact/transaction-simulation/3408.png",\ "amount": "1"\ },\ {\ "assetType": "ERC20",\ "changeType": "TRANSFER",\ "from": "0xebfb684dd2b01e698ca6c14f10e4f289934a54d6",\ "to": "0x07eee3bfdfa311f6f06d419c8ccca08a6efdd162",\ "rawAmount": "186275962091465171",\ "contractAddress": "0x1f9840a85d5af5bf1d1762f925bdaddc4201f984",\ "tokenId": null,\ "decimals": 18,\ "symbol": "UNI",\ "name": "Uniswap",\ "logo": "https://alchemyapi-res.cloudinary.com/image/upload/v1764180255/docs/tutorials/transactions/transaction-simulation/7083.png",\ "amount": "0.186275962091465171"\ }\ ], "error": null } } User address - `0x07eee3bfdfa311f6f06d419c8ccca08a6efdd162` USDC contract - `0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48` USDC / UNI pool - `0xEBFb684dD2b01E698ca6c14F10e4f289934a54D6` Uniswap RouterV2 - `0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D` UNI contract - `0x1f9840a85d5af5bf1d1762f925bdaddc4201f984` 1. User (`from`) sends 1 USDC (`contractAddress`) to the Uniswap USDC / UNI pool (`to`). json { "assetType": "ERC20", "changeType": "TRANSFER", "from": "0x07eee3bfdfa311f6f06d419c8ccca08a6efdd162", "to": "0xebfb684dd2b01e698ca6c14f10e4f289934a54d6", "contractAddress": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", "symbol": "USDC", "amount": "1" ... }, 2. The USDC / UNI pool (`from`) sends 0.186 UNI (`contractAddress`) to the user (`to`). json { "assetType": "ERC20", "changeType": "TRANSFER", "from": "0xebfb684dd2b01e698ca6c14f10e4f289934a54d6", "to": "0x07eee3bfdfa311f6f06d419c8ccca08a6efdd162", "contractAddress": "0x1f9840a85d5af5bf1d1762f925bdaddc4201f984", "symbol": "UNI", "amount": "0.186275962091465171" ... } 3. 1 USDC was swapped for 0.186 UNI 🎉 Was this page helpful? YesNo --- # Building a MetaMask Snap from scratch | Alchemy Docs Copy page Building a MetaMask Snap from scratch ===================================== Explore the process of building a MetaMask Snap from scratch that showcases the power of Alchemy's Transaction Simulation APIs. We built a MetaMask Snap to showcase the power of Transaction Simulation. We added an extra tab _Alchemy Insights_ to MetaMask to let users know the exact impact of their transaction **before** they hit the blockchain. Check out a quick demo [here](https://www.loom.com/share/719db9c1345648ab83169cc0f7eb7ed2) . Github repo [here](https://github.com/bmoyroud/alchemy-snap) . In this tutorial, we'll show you how to build your own. Coming soon 👀 Was this page helpful? YesNo --- # What is the Bitcoin genesis block? | Alchemy Docs Copy page What is the Bitcoin genesis block? ================================== The Bitcoin genesis block is the very first \\block\\ of transactions ever confirmed on the Bitcoin blockchain after launching. It's a good time to check out the [Genesis Block](https://blockchain.info/block/000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f) of Bitcoin. 👆🏼 How many properties do you recognize at this point? The number of **confirmations** is the number of blocks since the genesis block. Since the genesis block is the first block, this is also the **block height** of the blockchain! It's interesting that if you look at the nonce of the genesis block, it's **2,083,236,893**. If you take a look at a more recent block, [632900](https://www.blockchain.com/btc/block/632900) for example, you'll see that the nonce is actually **much lower**. Why is that? Isn't the difficulty supposed to be getting harder as the network grows? 🤔 It turns out that the block [nonce](https://en.bitcoin.it/wiki/Nonce) is actually a 32-bit field, and `2 ** 32` is **4,294,967,296**, so that is the max size of a nonce. What happens when the miner reaches this point? They can change anything else in the block header to also increase the randomness. Other properties include: * **Software Version** - Tracks Bitcoin software upgrades * **Previous Block Hash** - Hash of the block before this one * **Merkle Root** - We haven't gone over this yet, its a hash that represent all the transactions! * **Timestamp** - Approximate time (less than two hours in the future according to consensus rules) * **Target** - Difficulty Target that dictates how small the Proof Of Work must be 👆🏼 As you can imagine by looking at these properties, it was initially the **timestamp** that the miners fiddled with when they needed to restart their search for a valid [Proof-of-Work](https://www.alchemy.com/docs/proof-of-work) . Beyond that, they can start to change the script of the **coinbase transaction** which gives them additional nonce space. Learn More About Bitcoin ------------------------ Alchemy University offers [free web3 development bootcamps that explain more about Bitcoin](https://university.alchemy.com/ethereum) and help developers master the fundamentals of web3 technology. Sign up for free, and start building today! Was this page helpful? YesNo --- # Blockchain Basics | Alchemy Docs Copy page Blockchain Basics ================= Blockchain basics include understanding blockchains, blockchain networks, consensus mechanisms including Proof-of-Work, and the differences between UTXO and Account Models. Blockchains may seem like an overwhelming subject, but learning the basics is not as bad as you think. Understanding Bitcoin and Ethereum, the two most important blockchains, will provide the necessary background to start your web3 education. This guide will teach you about the origins of blockchain technology starting with an understanding of Bitcoin: the breakthrough blockchain-based digital currency created in 2009 by Satoshi Nakamoto. **We'll cover:** 1. [What is a blockchain?](https://www.alchemy.com/docs/what-is-a-blockchain) 2. [What is Proof-of-Work?](https://www.alchemy.com/docs/proof-of-work) 3. [Blockchain Consensus Mechanisms](https://www.alchemy.com/docs/what-are-blockchain-consensus-mechanisms) 4. [What are blockchain networks?](https://www.alchemy.com/docs/what-are-blockchain-networks) 5. [What is a 51% attack?](https://www.alchemy.com/docs/51-percent-attack) 6. [The History of Bitcoin](https://www.alchemy.com/docs/bitcoin-genesis-block) 7. [UTXO vs. Account Models](https://www.alchemy.com/docs/utxo-vs-account-model) After you learn about blockchain basics, you can learn about more advanced modules like cryptography, Ethereum, Solidity, and smart contracts! Learn More About Blockchains ---------------------------- This content is from Alchemy University's free, 7-week web3 developer bootcamp. To [learn more about blockchains](https://university.alchemy.com/ethereum) and to earn your web3 developer certification, sign up today! Let's dive in! Was this page helpful? YesNo --- # Best Practices When Using Alchemy | Alchemy Docs Copy page Best Practices When Using Alchemy ================================= Here is a list of best practices to reduce [compute unit usage costs](https://www.alchemy.com/docs/reference/compute-units) to make sure you’re getting the most out of Alchemy’s platform! 1\. Send Requests Concurrently ------------------------------ Depending on your background with blockchain nodes, you might expect that requests need to be sent sequentially to function properly. That’s not the case! **Don’t treat Alchemy like a single node or a group of nodes** - treat it like an automated, scalable service that can handle concurrent request patterns. You don’t need to be concerned about overloading Alchemy with concurrent requests at scale. Alchemy is built specifically to process high rates of concurrent requests for [all of our web3 customers](https://www.alchemy.com/all-case-studies) . 2\. Avoid High Batch Cardinality -------------------------------- When sending batch requests, **aim for batches under 50 requests per call**. If you need hundreds or thousands of responses quickly, send more batched requests concurrently rather than placing all your requests in a single call. Blockchain responses tend to be heavy, which means that responses for certain requests sent to the nodes (like [eth\_getLogs](https://www.alchemy.com/docs/deep-dive-into-eth_getlogs) can have an unbounded size or time to execute. By batching smaller sets of requests, you can minimize time-outs as the result of unbounded response sizes, and indefinite execution times, and guarantee higher throughputs. Additionally, it’ll be easier to identify and solve requests that are failing. Instead of having to retry a batch with 100+ requests, you can quickly retry a subset of requests without the failing query. 3\. Retry (w/ Exponential Backoff) on Failures, Not On Client-Side Timeouts --------------------------------------------------------------------------- Many types of common node requests require long processing times or unbounded response sizes, leading to slower response times (oftentimes from 1 - 10+ seconds). If you’re canceling and re-sending requests on client-side timeouts that are too short, you could end up never receiving the response you’re looking for and spamming the node infrastructure with expensive requests that waste your compute units. Instead, **retry your requests with exponential backoff on response failures**, which will reduce your compute unit costs, increase the success rate of your requests, and allow you to handle failures properly based on their respective error messages. If you need to handle timeouts, you can also retry your requests on Alchemy-based timeouts, which will prevent you from accidentally retrying requests before nodes have finished processing them. Alternatively, increase your client-side timeouts to see if your request success rate improves. Implementing exponential backoff retry logic in your application will help handle temporary API issues automatically. 4\. Send Requests over HTTPS, not WebSockets -------------------------------------------- Though it may be tempting to use WebSockets for all node requests because it’s a newer technology, the [industry best practice for using WebSockets](https://www.alchemy.com/docs/reference/best-practices-for-using-websockets-in-web3) is still primarily for push-based notifications. In the case of EVM chains, `eth_subscribe` and `eth_unsubscribe` to certain events. HTTPS is a better option for standard JSON-RPC node requests for several reasons: * **Silent failures**: WebSockets client-side handling has many tricky edge cases and silent failure modes. * **Load balancing**: When making requests to distributed systems such as Alchemy, individual HTTP requests are load-balanced to the fastest possible server, whereas with WebSockets you incur additional latency by sending JSON-RPC requests only to a single node. * **Retries**: In most common request frameworks, support for retrying failed HTTP requests comes automatically, and can be configured easily. Conversely, in WebSockets retrying failed requests typically requires custom JSON-RPC id-based tracking. * **HTTP status codes**: When web3 developers use WebSockets they won't receive HTTP status codes in WebSockets responses, which can be useful for debugging or sorting responses. 5\. Avoid Large Request / Response Sizes ---------------------------------------- We recommend keeping the vast majority of requests to be under 100 KB and avoiding response sizes above 10 MB. Though we permit sending large requests (currently up to 2.5 MB) and receiving large responses (currently up to 150 MB), we strongly suggest avoiding these limits as much as possible. This is for several reasons: Larger requests and responses are more likely to hit our size limits, which will result in failing API calls that you’ll have to retry. Heavy API calls have higher likelihood of timing out, failing while in flight, and causing nodes to become unstable. Smaller API calls are easier to debug and identify issues that arise. By keeping your API calls an order of magnitude smaller than our hard limits, your infrastructure will become more reliable, responsive, and you’ll spend less time debugging your dApp. 6\. Use gZip Compression to Speed Up Large Requests --------------------------------------------------- At Alchemy, many of our developers have brought up slow response times as a major blocker to providing their customers with a good web3 user experience. To provide users with better product experiences, we updated our internal infrastructure to offer Alchemy developers **support for gzip compression on all responses larger than 1kb in size.** In practice, we’ve seen roughly a **75% improvement in the total latency of typical JSON-RPC replayTransaction calls.** Go to this article to learn how to implement gZip compression: [How to Enable Compression to Speed Up JSON-RPC Blockchain Requests](https://www.alchemy.com/docs/alchemy/guides/how-to-enable-compression-to-speed-up-json-rpc-blockchain-requests) 7\. Contact Us When Multiplying Your Capacity --------------------------------------------- Are you planning on launching the next big NFT project? Planning a major indexing project to backfill your databases with custom node data? Please reach out to us if you’re expecting a massive capacity increase in the order of 3x or more of your current usage! There are a few reasons for this: **1\. We can save you money** By letting us know ahead of time, we can help you optimize your request patterns to lower compute unit costs, decrease the load on our system, and ensure your launch goes smoothly. **2\. We can spin up additional infrastructure** New full blockchain nodes that can serve historical data take days or weeks to bring up in the past, leading to significant scalability issues. At Alchemy, we’ve solved most of these issues, but the more advanced warning you can give us for specific high-load request patterns, the better. **3\. We can provide hands-on support.** For large projects, we provide white-glove support and direct access to our engineers; one of the reasons our customers love us so much. We’re available and willing to help with your infrastructure needs - just let us know! 8\. Protecting your API Keys ---------------------------- There might be instances where you want to embed your API key somewhere public, like frontend-only applications. To avoid unintended use of the API Key, you can setup an allowlist within your Alchemy dashboard, specifying what domains, contract addresses, wallet addresses, or IP addresses are able to send requests. To do this, visit your unique app page in the dashboard, and click on "Security" in the top right. ![1280](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764191628%2Fdocs%2Ftutorials%2Fgetting-started%2Fdeveloper-best-practices%2Fsecurity.png&w=3840&q=75 "security.png") This will bring you to a page that allows you to restrict access to your API key ![1424](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764191629%2Fdocs%2Ftutorials%2Fgetting-started%2Fdeveloper-best-practices%2Frestrict-access.png&w=3840&q=75 "restrict-access.png") Learn more about it [here](https://www.alchemy.com/docs/how-to-add-allowlists-to-your-apps-for-enhanced-security) . 8\. API Authentication ---------------------- Alchemy provides three ways to authenticate API requests: 1. **API Key in URL**: Simple but vulnerable to exposure in server logs and browser histories. 2. **API Key in Request Header**: Safer than URL. Uses the HTTP Authorization header. 3. **JWT Tokens**: Most secure but requires backend server setup. **Recommendations**: * For frontend apps, use short-lived JWTs. * For backend services, prefer API keys in headers. * Rotate keys annually or if a leak is suspected. **Guides**: * [Header-Based Requests](https://www.alchemy.com/docs/how-to-use-api-keys-in-http-headers) * [Using JWTs](https://www.alchemy.com/docs/how-to-use-jwts-for-api-requests) Was this page helpful? YesNo --- # Blockchain 101 | Alchemy Docs Copy page Blockchain 101 ============== Blockchain basics for developer topics. This is Alchemy API's comprehensive guide to getting familiar with blockchain. There are tons of articles out there now, but this is a curated reading list (plus a few videos). We will cover blockchain basics from both technical and contextual perspectives. * * * 1\. Bitcoin ----------- Start with bitcoin since it is the first blockchain and has a succinct white paper. Read the white paper and watch this video. After watching the video, go back and read the white paper again. It should make more sense the second time. 1. [Bitcoin white paper](https://bitcoin.org/bitcoin.pdf) 2. [Bitcoin explained (basic) video](https://www.youtube.com/watch?v=bBC-nXj3Ng4) * * * 2\. Ethereum ------------ Next jump into Ethereum. At a high level, Ethereum is like bitcoin, but instead of just payments, the blocks can store and execute smart-contracts (programmable contracts). Read and watch the following, multiple times if necessary. 1. [Ethereum overview - just read the first page, you can explore the other pages later](http://ethdocs.org/en/latest/introduction/what-is-ethereum.html) 2. [Ethereum creator Vitalik Buterin explains Ethereum](https://www.youtube.com/watch?v=66SaEDzlmP4l) 3. Ethereum history and development - read the parts that are interesting to you 4. [This article covers all bases and introduces some of the largest players/projects in the space](https://medium.com/@mattcondon/getting-up-to-speed-on-ethereum-63ed28821bbe) Ethereum 2.0: As more and more transactions are added to the blockchain, how can Ethereum scale? These articles explore scalability in layer 1 (things like sharding or Proof of Stake rather than Proof of Work) and layer 2 (things like off chains). 1. Ethereum Layer 1 2. [Ethereum Layer 2](https://medium.com/l4-media/making-sense-of-ethereums-layer-2-scaling-solutions-state-channels-plasma-and-truebit-22cb40dcc2f4) * * * 3\. Why is Blockchain Important? -------------------------------- Now that you have a basic understanding of blockchain, read these articles about why blockchain matters, current use cases, and future implications. 1. [Why decentralization matters](https://medium.com/s/story/why-decentralization-matters-5e3f79f7638e) 2. [5 best uses for blockchain](https://medium.com/bitfwd/top-5-most-compelling-use-cases-for-blockchain-technology-d198e500e3d3) 3. [Blockchain's potential uses cases by sector](https://www.cbinsights.com/research/industries-disrupted-blockchain/) or [read this similar summary of blockchain application to different industries](https://lisk.io/academy/blockchain-basics/use-cases) 4. [Current use cases - a bit hodge podge but interesting projects](https://hackernoon.com/20-blockchain-use-cases-for-2018-you-should-know-f7d2919c191d) 5. [Naval Ravikant’s Cryptocurrencies Tweets](https://medium.com/the-naked-founder/naval-ravikants-36-tweets-on-cryptocurrencies-f9b2b64106c1) * * * 4\. Ethereum Block Details -------------------------- For block details and blockchain mechanics, here are a few important concepts to grasp: 1. Ethereum is turing complete while bitcoin is not. In brief, we are used to programming languages that are Turing Complete, and can be programmed to solve any computational problem given enough time and space. Before most computer languages were turing complete, machines were not able to solve multiple computational problems - ie a machine can add, but not multiply. This is the most significant difference between Ethereum and Bitcoin, in that the Ethereum blockchain can be used for smart contracts since it is programmable. 2. Merkle Trees are the data structure of blocks on the blockchain. The key point is that its very fast/efficient to check if a transaction/block is true, although more computationally intensive to write. Read this piece on [Merkle Trees](https://hackernoon.com/merkle-tree-introduction-4c44250e2da7) and watch this [video](https://www.youtube.com/watch?v=WF5dNyFOqEc) 3. [What's in a block?](https://pegasys.tech/ethereum-explained-merkle-trees-world-state-transactions-and-more/) 4. [Read actual Ethereum blocks as they are added](https://etherscan.io/) 5. [Get Logs is the most computationally expensive query](https://codeburst.io/deep-dive-into-ethereum-logs-a8d2047c7371) * * * 5\. Cool Projects in the Space ------------------------------ The blockchain space has seen a lot increasingly more action. We, Alchemy API, act as as blockchain infrastructure provider amongst other things, and work with a lot of cool projects that are built on top of the Ethereum blockchain. Here are some of our [customers](https://alchemy.com/customers) and links to their platforms. We want to keep this as current as possible. Please reach out with suggestions and follow us on Twitter [@Alchemy](https://twitter.com/Alchemy) ! Was this page helpful? YesNo --- # MEV Protection | Alchemy Docs Copy page MEV Protection ============== Alchemy's RPC endpoints now come with built-in MEV protection on supported chains. This feature helps prevent frontrunning, sandwich attacks, and other forms of transaction manipulation with no additional code changes or tooling required. Why it matters -------------- By default, most blockchain transactions are broadcast to the public mempool. This exposes them to MEV (Maximal Extractable Value) risks, where bots insert transactions to extract profit at the user’s expense. MEV protection mitigates this risk by routing transactions through private infrastructure. This improves transaction privacy, protects ordering, and reduces block inclusion time. How MEV protection works ------------------------ Transactions sent through Alchemy’s MEV-protected RPC endpoints are: * Routed through private mempools — not broadcast publicly. * Hidden until block inclusion — keeping sensitive trade details private. * Ordered fairly — processed in the original sequence without manipulation. * Shielded from frontrunning and sandwiching — keeping transaction intent intact. This protection is powered through trusted Order Flow Auction (OFA) partners like Merkle and Blink. Supported networks ------------------ MEV protection is automatically enabled on: * [Ethereum](https://www.alchemy.com/docs/reference/ethereum-api-endpoints) * [Arbitrum](https://www.alchemy.com/docs/reference/arbitrum-api-endpoints) * [BNB Smart Chain (BSC)](https://www.alchemy.com/docs/node/bnb-smart-chain/bnb-smart-chain-endpoints) * [Base](https://www.alchemy.com/docs/node/base/base-api-endpoints) * [Solana](https://www.alchemy.com/docs/reference/solana-api-endpoints) No configuration changes are required. Just send transactions to the standard RPC endpoint. Key benefits ------------ ✅ Automatically protects transactions from MEV ✅ Faster block inclusion through private routing ✅ No changes required in dApp logic ✅ Included at no additional cost Was this page helpful? YesNo --- # Compute Units | Alchemy Docs Copy page Compute Units ============= The explanation for what Compute Units are and how we use them. _Check out [Compute Unit Costs](https://www.alchemy.com/docs/reference/compute-unit-costs) for a breakdown of costs for each method._ What are Compute Units? ======================= Compute units are a measure of the total computational resources your apps are using on Alchemy. You can think of this as how you would pay Amazon for compute usage on AWS. Some queries are lightweight and fast to run (e.g., eth\_blockNumber) and others can be more intense (e.g., large eth\_getLogs queries). Each method is assigned a quantity of compute units, derived from global average durations of each method. Why use Compute Units? ====================== We're obsessed with providing the most developer-friendly experience across our platform, and this doesn't stop at pricing. Pricing on compute units allows us to provide developers with the most fair and transparent pricing possible. No more over-paying for simple requests, you only pay for what you use, period. What are CUPS (Compute Units Per Second)? ========================================= Each application has reserved dedicated [Throughput](https://www.alchemy.com/docs/reference/throughput) , measured in Compute Units per Second. Applications can greatly exceed their dedicated throughputs based off of elastic demand in our system. Since each request is weighted differently, we base this on the total compute units used rather than the number of requests. For example, if you send one eth\_blockNumber (10 CUs), two eth\_getLogs (75 CUs), and two eth\_call(26 CUs) requests in the same second, you will have a total of 212 CUPS. Note that even if your application limit is 200 CUPS, this throughput will likely be allowed still by the system. If you are experiencing throughput errors, or want create a more robust and reliable experience for your users, we recommend [implementing retries](https://www.alchemy.com/docs/reference/throughput) . What are Throughput Compute Units? ================================== Throughput Compute Units define how often you can run the request within your throughput limits. For example, a 500 CU per second limit would be able to run 50 requests per second that cost 10 throughput CUs. The actual cost of the method is still reflected by the CU amount while the threshold CU allows you to increase the number of requests before you hit your rate limit. If there is no throughput CU listed, it defaults to the actual CU cost. Was this page helpful? YesNo --- # Compute Unit Costs | Alchemy Docs Copy page Compute Unit Costs ================== Don't have an API key? Unlock millions of requests and free archive data on all chains. [Get started for free](https://dashboard.alchemy.com/signup?utm_source=docs&utm_medium=referral&utm_content=reference_compute-unit-costs) What are Compute Units and Throughput Compute Units? ---------------------------------------------------- For more details, please check out the [Compute Units](https://www.alchemy.com/docs/reference/compute-units#what-are-compute-units) section and the [Throughput Compute Units](https://www.alchemy.com/docs/reference/compute-units#what-are-throughput-compute-units) section. EVM: Standard JSON-RPC Methods ============================== | Method | CU | Throughput CU | | --- | --- | --- | | net\_version | 0 | | | eth\_chainId | 0 | | | eth\_syncing | 0 | | | eth\_protocolVersion | 0 | | | net\_listening | 0 | | | eth\_uninstallFilter | 10 | | | eth\_accounts | 10 | | | eth\_blockNumber | 10 | | | eth\_subscribe | 10 | | | eth\_unsubscribe | 10 | | | eth\_feeHistory | 10 | | | eth\_maxPriorityFeePerGas | 10 | | | eth\_blobBaseFee | 10 | | | eth\_createAccessList | 10 | | | eth\_getTransactionReceipt | 20 | | | eth\_getUncleByBlockHashAndIndex | 20 | | | eth\_getUncleByBlockNumberAndIndex | 20 | | | eth\_getTransactionByBlockHashAndIndex | 20 | | | eth\_getTransactionByBlockNumberAndIndex | 20 | | | eth\_getUncleCountByBlockHash | 20 | | | eth\_getUncleCountByBlockNumber | 20 | | | web3\_clientVersion | 20 | | | web3\_sha3 | 20 | | | eth\_getBlockByNumber | 20 | | | eth\_getStorageAt | 20 | | | eth\_getTransactionByHash | 20 | | | eth\_gasPrice | 20 | | | eth\_getBalance | 20 | | | eth\_getCode | 20 | | | eth\_getFilterChanges | 20 | | | eth\_newBlockFilter | 20 | | | eth\_newFilter | 20 | | | eth\_simulateV1 | 40 | | | eth\_newPendingTransactionFilter | 20 | | | eth\_getBlockTransactionCountByHash | 20 | | | eth\_getBlockTransactionCountByNumber | 20 | | | eth\_getProof | 20 | | | eth\_getBlockByHash | 20 | | | eth\_getAccount | 20 | | | erigon\_forks | 20 | | | erigon\_getHeaderByHash | 20 | | | erigon\_getHeaderByNumber | 20 | | | erigon\_getLogsByHash | 20 | | | erigon\_issuance | 20 | | | eth\_getTransactionCount | 20 | | | eth\_call | 26 | | | eth\_callMany | 20 | | | eth\_getFilterLogs | 60 | | | eth\_getLogs | 60 | | | eth\_estimateGas | 20 | | | eth\_sendRawTransaction | 40 | 250 | | eth\_sendRawTransactionSync | 40 | 250 | | eth\_getBlockReceipts | 20 | 500 | | eth\_submitWork | 20 | | | batch | CU of method # times called | | * To view the batch request breakdown in the dashboard, click on "raw request" Solana: Standard JSON-RPC Methods ================================= | Method | CU | | --- | --- | | getLeaderSchedule | 20 | | requestAirdrop | 20 | | getVoteAccounts | 20 | | getBlockCommitment | 20 | | getBlocksWithLimit | 20 | | getHealth | 20 | | getIdentity | 20 | | getLatestBlockhash | 20 | | getSlot | 20 | | getInflationRate | 20 | | getMaxRetransmitSlot | 20 | | getRecentPerformanceSamples | 20 | | getEpochInfo | 20 | | getTokenAccountBalance | 20 | | getBlockTime | 20 | | getHighestSnapshotSlot | 20 | | sendTransaction | 20 | | getEpochSchedule | 20 | | getStakeActivation | 20 | | getMaxShredInsertSlot | 20 | | getVersion | 20 | | isBlockhashValid | 20 | | getAccountInfo | 10 | | getFeeForMessage | 20 | | getTokenLargestAccounts | 20 | | getInflationGovernor | 20 | | getSlotLeader | 20 | | getMultipleAccounts | 20 | | minimumLedgerSlot | 20 | | getBlockHeight | 20 | | simulateTransaction | 20 | | simulateBundle | 20 | | getSignatureStatuses | 20 | | getBlocks | 10 | | getTokenAccountsByOwner | 10 | | getMinimumBalanceForRentExemption | 10 | | getBalance | 10 | | getGenesisHash | 10 | | getBlockProduction | 10 | | getTokenSupply | 20 | | getTransactionCount | 20 | | getSlotLeaders | 20 | | getClusterNodes | 20 | | getSignaturesForAddress | 40 | | getFirstAvailableBlock | 40 | | getTransaction | 40 | | getBlock | 40 | | getProgramAccounts | 20 | | getInflationReward | 40 | | getSupply | 160 | | getLargestAccounts | 3000 | | batch\* | CU of method # times called | * To view the batch request breakdown in the dashboard, click on "raw request" Solana: DAS APIs (NFT/Token) ============================ | Method | CU | Throughput CU | | --- | --- | --- | | getAsset | 80 | 200 | | getAssets | 480 | 200 | | getAssetProof | 160 | 200 | | getAssetProofs | 480 | 200 | | getAssetsByAuthority | 480 | 200 | | getAssetsByOwner | 480 | 200 | | getAssetsByGroup | 480 | 200 | | getAssetsByCreator | 480 | 200 | | searchAssets | 480 | 200 | | getAssetSignatures | 160 | 200 | | getNftEditions | 160 | 200 | | getTokenAccounts | 160 | 200 | Solana: Yellowstone gRPC ======================== [Yellowstone gRPC](https://www.alchemy.com/docs/reference/yellowstone-grpc-overview) is a high-performance streaming service for Solana that delivers real-time blockchain data via gRPC. Pricing is based on **bandwidth:** the amount of data delivered as part of the stream. | Bandwidth | CU | | --- | --- | | 1 TB | $80 | * Amount will be pro-rated based on bytes streamed. [Contact us](https://www.alchemy.com/contact-sales) for pre-committed bulk discounts. Debug API ========= | Method | CU | Throughput CU | | --- | --- | --- | | debug\_traceTransaction | 40 | 1000 | | debug\_traceCall | 40 | 1000 | | debug\_traceCallMany | 40 | 1000 | | debug\_traceBlockByHash | 40 | 1000 | | debug\_traceBlockByNumber | 40 | 1000 | | debug\_getBadBlocks | 40 | 1000 | | debug\_getRawHeader | 40 | 1000 | | debug\_storageRangeAt | 40 | 1000 | Embedded Account APIs ===================== Similar to the [NFT API](https://www.alchemy.com/docs/reference/compute-unit-costs#nft-api) , the Embedded Account APIs implement "Throughput CU" to count separately toward your applications' throughput! | Method | CU | Throughput CU | | --- | --- | --- | | /signer/auth | 100 | 50 | | /signer/lookup | 20 | 50 | | /signer/signup | 1000 | 300 | | /signer/sign-payload | 6000 | 300 | | /signer/whoami | 100 | 20 | Gas Manager & Bundler APIs ========================== Similar to the [NFT API](https://www.alchemy.com/docs/reference/compute-unit-costs#nft-api) , the Gas Manager & Bundler APIs implement "Throughput CU" to count separately toward your applications' throughput! | Method | CU | Throughput CU | | --- | --- | --- | | eth\_sendUserOperation | 1000 | 100 | | eth\_estimateUserOperationGas | 500 | 50 | | eth\_getUserOperationByHash | 20 | 17 | | eth\_getUserOperationReceipt | 20 | 15 | | eth\_supportedEntryPoints | 10 | 5 | | rundler\_maxPriorityFeePerGas | 10 | 10 | | alchemy\_simulateUserOperationAssetChanges | 2500 | 2500 | | alchemy\_requestPaymasterAndData | 1000 | 100 | | alchemy\_requestGasAndPaymasterAndData | 1250 | 125 | | alchemy\_requestFeePayer | 1000 | 100 | * When `eth_sendUserOperation` is called with a valid bundler sponsorship header (`x-alchemy-policy-id`), the CU cost is 3000 instead of the standard 1000. NFT API ======= We want builders to be able to use as much of the NFT API as they need without worrying about throughput. Because of that, we have discounted how NFT API requests count towards your applications’ guaranteed throughput by 6-10x. This means you can make more concurrent NFT API requests, and use the “Throughput CU” below to calculate how much you can use! | Method | CU | Throughput CU | | --- | --- | --- | | getNFTMetadata | 80 | 10 | | getContractMetadata | 160 | 10 | | getCollectionMetadata | 240 | 10 | | getNFTsForOwner | 480 | 100 | | getContractsForOwner | 320 | 100 | | getCollectionsForOwner | 360 | 100 | | getNFTsForContract | 600 | 50 | | getOwnersForNFT | 80 | 10 | | getOwnersForContract | 480 | 20 | | getFloorPrice | 80 | 10 | | getNFTSales | 160 | 10 | | computeRarity | 80 | 10 | | summarizeNFTAttributes | 80 | 10 | | isHolderOfContract | 80 | 10 | | searchContractMetadata | 480 | 50 | | getNFTMetadataBatch | 480 | 100 | | getContractMetadataBatch | 480 | 100 | | getSpamContracts | 480 | 10 | | isSpamContract | 80 | 10 | | isAirdropNFT | 80 | 10 | | invalidateContract | 80 | 80 | | refreshNftMetadata | 40 | 10 | | reportSpam | 0 | 10 | Portfolio API ============= | Method | CU | | --- | --- | | assets/nfts/by-address | 1000 | | assets/nfts/contracts/by-address | 600 | | assets/tokens/by-address | 360 | | assets/tokens/balances/by-address | 200 | | /transactions/history/by-address | 1000 | Prices API ========== | Method | CU | | --- | --- | | tokens/by-symbol | 40 | | tokens/by-address | 40 | | tokens/historical | 40 | Token API ========= | Method | CU | | --- | --- | | alchemy\_getTokenBalances | 20 | | alchemy\_getTokenMetadata | 10 | | alchemy\_getTokenAllowance | 20 | Trace API ========= | Method | CU | Throughput CU | | --- | --- | --- | | trace\_get | 20 | 20 | | trace\_block | 20 | 20 | | trace\_transaction | 40 | 40 | | trace\_call | 40 | 40 | | trace\_callMany | 80 | 3000 | | trace\_rawTransaction | 40 | 40 | | trace\_filter | 40 | 40 | | trace\_replayTransaction | 80 | 3000 | | trace\_replayBlockTransactions | 80 | 3000 | Arbitrum Trace API ================== | Method | CU | Throughput CU | | --- | --- | --- | | arbtrace\_get | 20 | 20 | | arbtrace\_block | 20 | 20 | | arbtrace\_transaction | 40 | 40 | | arbtrace\_call | 40 | 40 | | arbtrace\_callMany | 80 | 80 | | arbtrace\_rawTransaction | 40 | 40 | | arbtrace\_filter | 40 | 40 | | arbtrace\_replayTransaction | 80 | 3000 | | arbtrace\_replayBlockTransactions | 80 | 3000 | Transact ======== | Method | CU | | --- | --- | | alchemy\_simulateAssetChanges | 2500 | | alchemy\_simulateExecution | 2500 | Transfers API ============= | Method | CU | | --- | --- | | alchemy\_getAssetTransfers | 120 | Utility API =========== | Method | CU | | --- | --- | | alchemy\_getTransactionReceipts | 250 | Wallet APIs =========== Similar to the [NFT API](https://www.alchemy.com/docs/reference/compute-unit-costs#nft-api) , the Wallet APIs implement "Throughput CU" to count separately toward your applications' throughput! | Method | CU | Throughput CU | | --- | --- | --- | | wallet\_requestAccount | 50 | \- | | wallet\_prepareCalls | 700 | 50 | | wallet\_sendPreparedCalls | 1000 | 100 | | wallet\_createAccount | 50 | \- | | wallet\_createSession | 50 | \- | | wallet\_getCallsStatus | 20 | \- | | wallet\_listAccounts | 10 | \- | | wallet\_formatSign | 15 | \- | | wallet\_getAssets | 200 | \- | | wallet\_getCapabilities | 10 | \- | | wallet\_getCrossChainStatus\_v0 | 40 | \- | | wallet\_prepareSign | 15 | \- | | wallet\_requestQuote\_v0 | 800 | \- | Webhooks and Subscription APIs ============================== [Webhooks](https://www.alchemy.com/docs/reference/notify-api-quickstart) and [WebSocket Subscriptions](https://www.alchemy.com/docs/websocket-subscriptions) on Alchemy are priced based on **bandwidth:** the amount of data delivered as part of the subscription. Each subscription type is priced identically per byte: | Bandwidth | CU | | --- | --- | | 1 byte | .04 | On average, a typical webhook or WebSocket subscription event is about 1000 bytes, so it would consume 40 compute units. Note that this can vary significantly based on the specific event delivered [Subscription API Quickstart](https://www.alchemy.com/docs/reference/subscription-api) Polygon PoS: Specific Methods ============================= | Method | CU | | --- | --- | | bor\_getAuthor | 10 | | bor\_getCurrentProposer | 10 | | bor\_getCurrentValidators | 10 | | bor\_getRootHash | 10 | | bor\_getSignersAtHash | 10 | Polygon zkEVM: Specific Methods =============================== | Method | CU | | --- | --- | | zkevm\_batchNumber | 10 | | zkevm\_batchNumberByBlockNumber | 10 | | zkevm\_consolidatedBlockNumber | 10 | | zkevm\_getBatchByNumber | 10 | | zkevm\_getBroadcastURI | 10 | | zkevm\_isBlockConsolidated | 10 | | zkevm\_isBlockVirtualized | 10 | | zkevm\_verifiedBatchNumber | 10 | | zkevm\_virtualBatchNumber | 10 | | zkevm\_estimateFee | 40 | | zkevm\_estimateGasPrice | 40 | Starknet: Standard JSON-RPC Methods =================================== | Method | CU | | --- | --- | | starknet\_getBlockWithTxHashes | 20 | | starknet\_getBlockWithTxs | 20 | | starknet\_getStateUpdate | 20 | | starknet\_getStorageAt | 20 | | starknet\_getTransactionByHash | 20 | | starknet\_getTransactionByBlockIdAndIndex | 20 | | starknet\_getTransactionReceipt | 20 | | starknet\_getClass | 20 | | starknet\_getClassHashAt | 20 | | starknet\_getClassAt | 20 | | starknet\_getBlockTransactionCount | 20 | | starknet\_call | 20 | | starknet\_blockNumber | 20 | | starknet\_blockHashAndNumber | 20 | | starknet\_chainId | 0 | | starknet\_pendingTransactions | 20 | | starknet\_syncing | 0 | | starknet\_getNonce | 20 | | starknet\_getEvents | 20 | | starknet\_estimateFee | 20 | | starknet\_addInvokeTransaction | 160 | | starknet\_addDeclareTransaction | 160 | | starknet\_addDeployAccountTransaction | 160 | | starknet\_estimateMessageFee | 20 | | starknet\_getBlockWithReceipts | 20 | | starknet\_traceBlockTransactions | 80 | | starknet\_specVersion | 10 | | starknet\_getTransactionStatus | 20 | | starknet\_simulateTransactions | 20 | | starknet\_getCompiledCasm | 20 | | starknet\_getMessagesStatus | 20 | | starknet\_getStorageProof | 20 | | starknet\_traceTransaction | 20 | zkSync Era: Specific Methods ============================ | Method | CU | | --- | --- | | zks\_estimateFee | 10 | | zks\_estimateGasL1ToL2 | 10 | | zks\_gasPerPubdata | 10 | | zks\_getAllAccountBalances | 10 | | zks\_getBaseTokenL1Address | 10 | | zks\_getBlockDetails | 10 | | zks\_getBridgeContracts | 10 | | zks\_getBridgehubContract | 10 | | zks\_getBytecodeByHash | 10 | | zks\_getConfirmedTokens | 10 | | zks\_getFeeParams | 10 | | zks\_getL1BatchBlockRange | 10 | | zks\_getL1BatchDetails | 10 | | zks\_getL1GasPrice | 10 | | zks\_getL2ToL1LogProof | 10 | | zks\_getL2ToL1MsgProof | 10 | | zks\_getMainContract | 10 | | zks\_getProtocolVersion | 10 | | zks\_getRawBlockTransactions | 10 | | zks\_getTestnetPaymaster | 10 | | zks\_getTransactionDetails | 10 | | zks\_L1BatchNumber | 10 | | zks\_L1ChainId | 10 | | zks\_sendRawTransactionWithDetailedOutput | 20 | Ethereum Beacon: Standard HTTP API Methods ========================================== | Method | CU | | --- | --- | | /eth/v2/beacon/blocks/{block\_id}/attestations | 20 | | /eth/v1/beacon/blocks/{block\_id}/root | 20 | | /eth/v1/beacon/blinded\_blocks/{slot} | 20 | | /eth/v1/beacon/blob\_sidecars/{block\_id} | 20 | | /eth/v1/beacon/genesis | 20 | | /eth/v1/beacon/headers | 20 | | /eth/v1/beacon/headers/{block\_id} | 20 | | /eth/v1/beacon/pool/voluntary\_exits | 20 | | /eth/v1/beacon/states/{state\_id}/committees | 20 | | /eth/v1/beacon/states/{state\_id}/finality\_checkpoints | 20 | | /eth/v1/beacon/states/{state\_id}/fork | 20 | | /eth/v1/beacon/states/{state\_id}/pending\_consolidations | 20 | | /eth/v1/beacon/states/{state\_id}/root | 20 | | /eth/v1/beacon/states/{state\_id}/sync\_committees | 20 | | /eth/v1/beacon/states/{state\_id}/validator\_balances | 20 | | /eth/v1/beacon/states/{state\_id}/validators | 20 | | /eth/v1/beacon/states/{state\_id}/validators/{validator\_id} | 20 | | /eth/v1/beacon/rewards/sync\_committee/{block\_id} | 20 | | /eth/v1/beacon/rewards/blocks/{block\_id} | 20 | | /eth/v1/beacon/rewards/attestations/{epoch} | 20 | | /eth/v1/config/deposit\_contract | 20 | | /eth/v1/config/fork\_schedule | 20 | | /eth/v1/config/spec | 20 | | /eth/v1/node/peer\_count | 20 | | /eth/v1/node/peers | 20 | | /eth/v1/node/syncing | 20 | | /eth/v1/node/version | 20 | | /eth/v2/validator/aggregate\_attestation | 20 | | /eth/v1/validator/duties/attester/{epoch} | 20 | | /eth/v1/validator/duties/proposer/{epoch} | 20 | | /eth/v1/validator/duties/sync/{epoch} | 20 | | /eth/v1/validator/sync\_committee\_contribution | 20 | | /eth/v2/beacon/blocks/{block\_id} | 20 | | /eth/v1/beacon/blinded\_blocks/{block\_id} | 20 | | /eth/v1/beacon/blobs/{block\_id} | 20 | | /eth/v1/beacon/states/{state\_id}/pending\_deposits | 20 | | /eth/v1/beacon/states/{state\_id}/proposer\_lookahead | 20 | | /eth/v1/beacon/states/{state\_id}/randao | 20 | | /eth/v1/beacon/states/{state\_id}/validator\_identities | 20 | Aptos: Standard REST API Methods ================================ | Method | CU | | --- | --- | | /v1/ | 20 | | /v1/accounts/{address} | 20 | | /v1/accounts/{address}/events/{creation\_number} | 20 | | /v1/accounts/{address}/events/{event\_handle}/{field\_name} | 20 | | /v1/accounts/{address}/module/{module\_name} | 20 | | /v1/accounts/{address}/modules | 20 | | /v1/accounts/{address}/resource/{resource\_type} | 20 | | /v1/accounts/{address}/resources | 20 | | /v1/accounts/{address}/transactions | 20 | | /v1/blocks/by\_height/{block\_height} | 20 | | /v1/blocks/by\_version/{version} | 20 | | /v1/estimate\_gas\_price | 20 | | /v1/-/healthy | 20 | | /v1/spec | 20 | | /v1/tables/{table\_handle}/item | 20 | | /v1/tables/{table\_handle}/raw\_item | 20 | | /v1/transactions | 20 | | /v1/transactions/batch | 20 | | /v1/transactions/by\_hash/{txn\_hash} | 20 | | /v1/transactions/by\_version/{txn\_version} | 20 | | /v1/transactions/encode\_submission | 20 | | /v1/transactions/simulate | 20 | | /v1/view | 20 | Bitcoin: Standard JSON-RPC Methods ================================== | Method | CU | | --- | --- | | getbestblockhash | 10 | | getblock | 10 | | getblockchaininfo | 10 | | getblockcount | 10 | | getblockhash | 10 | | getblockheader | 10 | | getblockstats | 10 | | getdifficulty | 10 | | getmempoolancestors | 10 | | getmempooldescendants | 10 | | getmempoolinfo | 10 | | getrawmempool | 10 | | gettxout | 10 | | gettxoutproof | 10 | | getchaintips | 10 | | getchaintxstats | 10 | | getblocktemplate | 10 | | submitblock | 10 | | decoderawtransaction | 10 | | decodescript | 10 | | estimatesmartfee | 10 | | getconnectioncount | 10 | | getindexinfo | 10 | | getmemoryinfo | 10 | | validateaddress | 10 | | verifymessage | 10 | | gettxoutsetinfo | 10 | | testmempoolaccept | 10 | | sendrawtransaction | 10 | | submitpackage | 10 | Celestia Bridge: Standard RPC Methods ===================================== | Method | CU | | --- | --- | | blob.Get | 20 | | blob.GetAll | 20 | | blob.Submit | 20 | | blob.GetCommitmentProof | 20 | | blob.GetProof | 20 | | blob.Included | 20 | | state.AccountAddress | 20 | | state.Balance | 20 | | state.BalanceForAddress | 20 | | state.SubmitPayForBlob | 20 | | state.Transfer | 20 | | header.GetByHash | 20 | | header.GetByHeight | 20 | | header.GetRangeByHeight | 20 | | header.LocalHead | 20 | | header.NetworkHead | 20 | | header.SyncState | 20 | | header.SyncWait | 20 | | header.WaitForHeight | 20 | | share.GetEDS | 20 | | share.GetNamespaceData | 20 | | share.GetRange | 20 | | share.GetRow | 20 | | share.GetSamples | 20 | | share.SharesAvailable | 20 | | blobstream.GetDataRootTupleInclusionProof | 20 | | da.Submit | 20 | | da.Get | 20 | | fraud.Get | 20 | Citrea: Specific Methods ======================== | Method | CU | | --- | --- | | citrea\_getL2StatusHeightsByL1Height | 20 | | citrea\_getLastCommittedL2Height | 20 | | citrea\_getLastProvenL2Height | 20 | | citrea\_sendRawDepositTransaction | 20 | | citrea\_syncStatus | 20 | | ledger\_getHeadL2Block | 20 | | ledger\_getHeadL2BlockHeight | 20 | | ledger\_getL2BlockByHash | 20 | | ledger\_getL2BlockByNumber | 20 | | ledger\_getL2BlockRange | 20 | | ledger\_getL2GenesisStateRoot | 20 | | ledger\_getLastScannedL1Height | 20 | | ledger\_getLastVerifiedBatchProof | 20 | | ledger\_getSequencerCommitmentByIndex | 20 | | ledger\_getSequencerCommitmentsOnSlotByHash | 20 | | ledger\_getSequencerCommitmentsOnSlotByNumber | 20 | | ledger\_getVerifiedBatchProofsBySlotHeight | 20 | Linea: Specific Methods ======================= | Method | CU | | --- | --- | | linea\_estimateGas | 20 | | linea\_getProof | 20 | | linea\_getTransactionExclusionStatusV1 | 20 | Sui: Standard Methods ===================== | Method | CU | | --- | --- | | sui\_devInspectTransactionBlock | 20 | | sui\_dryRunTransactionBlock | 20 | | sui\_executeTransactionBlock | 20 | | sui\_getChainIdentifier | 20 | | sui\_getCheckpoint | 20 | | sui\_getCheckpoints | 20 | | sui\_getEvents | 20 | | sui\_getLatestCheckpointSequenceNumber | 20 | | sui\_getMoveFunctionArgTypes | 20 | | sui\_getNormalizedMoveFunction | 20 | | sui\_getNormalizedMoveModule | 20 | | sui\_getNormalizedMoveModulesByPackage | 20 | | sui\_getNormalizedMoveStruct | 20 | | sui\_getObject | 20 | | sui\_getProtocolConfig | 20 | | sui\_getTotalTransactionBlocks | 20 | | sui\_getTransactionBlock | 20 | | sui\_multiGetObjects | 20 | | sui\_multiGetTransactionBlocks | 20 | | sui\_tryGetPastObject | 20 | | sui\_tryMultiGetPastObjects | 20 | | suix\_getAllBalances | 20 | | suix\_getAllCoins | 20 | | suix\_getBalance | 20 | | suix\_getCoinMetadata | 20 | | suix\_getCoins | 20 | | suix\_getCommitteeInfo | 20 | | suix\_getDynamicFieldObject | 20 | | suix\_getDynamicFields | 20 | | suix\_getLatestBridge | 20 | | suix\_getLatestSuiSystemState | 20 | | suix\_getOwnedObjects | 20 | | suix\_getReferenceGasPrice | 20 | | suix\_getStakes | 20 | | suix\_getStakesByIds | 20 | | suix\_getTotalSupply | 20 | | suix\_queryEvents | 20 | | suix\_queryTransactionBlocks | 20 | | suix\_resolveNameServiceAddress | 20 | | unsafe\_batchTransaction | 20 | | unsafe\_mergeCoins | 20 | | unsafe\_moveCall | 20 | | unsafe\_pay | 20 | | unsafe\_payAllSui | 20 | | unsafe\_paySui | 20 | | unsafe\_publish | 20 | | unsafe\_requestAddStake | 20 | | unsafe\_requestWithdrawStake | 20 | | unsafe\_splitCoin | 20 | | unsafe\_splitCoinEqual | 20 | | unsafe\_transferObject | 20 | | unsafe\_transferSui | 20 | Tron: Standard HTTP Methods =========================== | Method | CU | | --- | --- | | /wallet/accountpermissionupdate | 20 | | /wallet/broadcasthex | 20 | | /wallet/broadcasttransaction | 20 | | /wallet/clearabi | 20 | | /wallet/createaccount | 20 | | /wallet/createassetissue | 20 | | /wallet/createtransaction | 20 | | /wallet/deploycontract | 20 | | /wallet/estimateenergy | 20 | | /wallet/freezebalance | 20 | | /wallet/freezebalancev2 | 20 | | /wallet/getaccount | 20 | | /wallet/getaccountbalance | 20 | | /wallet/getaccountnet | 20 | | /wallet/getaccountresource | 20 | | /wallet/getassetissuebyid | 20 | | /wallet/getassetissuebyname | 20 | | /wallet/getblock | 20 | | /wallet/getblockbynum | 20 | | /wallet/getblockbyid | 20 | | /wallet/getblockbylatestnum | 20 | | /wallet/getblockbylimitnext | 20 | | /wallet/getburntrx | 20 | | /wallet/getchainparameters | 20 | | /wallet/getcontract | 20 | | /wallet/getcontractinfo | 20 | | /wallet/getdelegatedresource | 20 | | /wallet/getdelegatedresourceaccountindex | 20 | | /wallet/getdiversifier | 20 | | /wallet/getenergyprices | 20 | | /wallet/getexchangebyid | 20 | | /wallet/getincomingviewingkey | 20 | | /wallet/getnewshieldedaddress | 20 | | /wallet/getnodeinfo | 20 | | /wallet/getnowblock | 20 | | /wallet/getpaginatedassetissuelist | 20 | | /wallet/getproposalbyid | 20 | | /wallet/gettransactionbyid | 20 | | /wallet/gettransactioninfobyid | 20 | | /wallet/gettransactionlistfrompending | 20 | | /wallet/triggersmartcontract | 20 | | /wallet/triggerconstantcontract | 20 | | /wallet/transferasset | 20 | | /wallet/unfreezebalance | 20 | | /wallet/unfreezebalancev2 | 20 | | /wallet/unfreezeasset | 20 | | /wallet/updateaccount | 20 | | /wallet/validateaddress | 20 | | /wallet/createshieldedcontractparameters | 20 | | /wallet/createspendauthsig | 20 | | /wallet/delegateresource | 20 | | /wallet/exchangecreate | 20 | | /wallet/exchangeinject | 20 | | /wallet/exchangetransaction | 20 | | /wallet/exchangewithdraw | 20 | | /wallet/getakfromask | 20 | | /wallet/getassetissuebyaccount | 20 | | /wallet/getassetissuelist | 20 | | /wallet/getassetissuelistbyname | 20 | | /wallet/getavailableunfreezecount | 20 | | /wallet/getbandwidthprices | 20 | | /wallet/getblockbalance | 20 | | /wallet/getcandelegatedmaxsize | 20 | | /wallet/getcanwithdrawunfreezeamount | 20 | | /wallet/getdelegatedresourceaccountindexv2 | 20 | | /wallet/getdelegatedresourcev2 | 20 | | /wallet/getexpandedspendingkey | 20 | | /wallet/getnkfromnsk | 20 | | /wallet/getpendingsize | 20 | | /wallet/getspendingkey | 20 | | /wallet/gettransactionfrompending | 20 | | /wallet/gettransactioninfobyblocknum | 20 | | /wallet/gettriggerinputforshieldedtrc20contract | 20 | | /wallet/getzenpaymentaddress | 20 | | /wallet/isshieldedtrc20contractnotespent | 20 | | /wallet/listexchanges | 20 | | /wallet/listproposals | 20 | | /wallet/participateassetissue | 20 | | /wallet/proposalapprove | 20 | | /wallet/proposaldelete | 20 | | /wallet/scanshieldedtrc20notesbyivk | 20 | | /wallet/scanshieldedtrc20notesbyovk | 20 | | /wallet/undelegateresource | 20 | | /wallet/updateasset | 20 | | /wallet/updateenergylimit | 20 | | /wallet/updatesetting | 20 | | /wallet/votewitnessaccount | 20 | | /wallet/withdrawexpireunfreeze | 20 | Tron: Solidity HTTP Methods =========================== | Method | CU | | --- | --- | | /walletsolidity/estimateenergy | 20 | | /walletsolidity/getaccount | 20 | | /walletsolidity/getassetissuebyid | 20 | | /walletsolidity/getassetissuebyname | 20 | | /walletsolidity/getassetissuelist | 20 | | /walletsolidity/getassetissuelistbyname | 20 | | /walletsolidity/getavailableunfreezecount | 20 | | /walletsolidity/getblock | 20 | | /walletsolidity/getblockbyid | 20 | | /walletsolidity/getblockbylatestnum | 20 | | /walletsolidity/getblockbylimitnext | 20 | | /walletsolidity/getblockbynum | 20 | | /walletsolidity/getburntrx | 20 | | /walletsolidity/getcandelegatedmaxsize | 20 | | /walletsolidity/getcanwithdrawunfreezeamount | 20 | | /walletsolidity/getdelegatedresource | 20 | | /walletsolidity/getdelegatedresourceaccountindex | 20 | | /walletsolidity/getdelegatedresourceaccountindexv2 | 20 | | /walletsolidity/getexchangebyid | 20 | | /walletsolidity/getnowblock | 20 | | /walletsolidity/getpaginatedassetissuelist | 20 | | /walletsolidity/gettransactionbyid | 20 | | /walletsolidity/gettransactioncountbyblocknum | 20 | | /walletsolidity/gettransactioninfobyblocknum | 20 | | /walletsolidity/gettransactioninfobyid | 20 | | /walletsolidity/isshieldedtrc20contractnotespent | 20 | | /walletsolidity/listexchanges | 20 | | /walletsolidity/scanshieldedtrc20notesbyivk | 20 | | /walletsolidity/scanshieldedtrc20notesbyovk | 20 | | /walletsolidity/triggerconstantcontract | 20 | Compute unit cost for error codes ================================= | Error | Compute Units | | --- | --- | | Non-existing methods | 0 | | `429, 403` | 0 | | Other `4xx` or `5xx` | CU value of specific endpoint | | `32600: IP Address not on whitelist` | 0 | | `32600: App is inactive` | 0 | | `32600: Unspecified origin not on whitelist` | 0 | Was this page helpful? YesNo --- # Dashboard Roles | Alchemy Docs Copy page Dashboard Roles =============== Guide to explain the roles available on the Alchemy Dashboard Members Roles in the Alchemy Dashboard ====================================== The Alchemy Dashboard provides you a default **Team** to manage your Alchemy apps. Here are the roles available in an Alchemy team, including role powers: 1. **Admin** * Access an app's JWT keys * Access Billing page * Access Access Keys page * Upgrade/Downgrade the team's plan * Manage Gas Policies monthly limit * Edit team name * Make other users admin, remove from team 2. **Non-Admin** * Create applications * Create gas policies * Create wallets policies ![](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1749661905%2Fdocs%2FScreenshot_2025-06-11_at_10.11.39_AM_kfmfhq.png&w=3840&q=75) Was this page helpful? YesNo --- # Dashboard Tools Quickstart | Alchemy Docs Copy page Dashboard Tools Quickstart ========================== Guide to show the tools available on the Alchemy Dashboard What is the Alchemy Dashboard? ============================== Sign in to the Alchemy Dashboard to access reliable and scalable node infrastructure, enhanced APIs, and developer tools. It is the main "hub" to access and manage your applications and analytics on Alchemy. ![](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1749600255%2Fdocs%2FScreenshot_2025-06-10_at_5.04.11_PM_kuvqif.png&w=3840&q=75) What tools are available on the Alchemy Dashboard? ================================================== Select the `Tools` tab in the dashboard to reveal a dropdown menu with the following tools: ![](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1749600126%2Fdocs%2FScreenshot_2025-06-10_at_5.02.01_PM_lpw211.png&w=3840&q=75) Here are quick start guides / direct links for each tool below: 1. [Request Logs](https://www.alchemy.com/docs/alchemy-request-logs) 2. [Dashboard Alerts](https://www.alchemy.com/docs/dashboard-alerts) 3. [Sandbox](https://www.alchemy.com/docs/alchemy-sandbox) 4. [Faucets](https://www.alchemy.com/faucets) 5. [Roles](https://www.alchemy.com/docs/dashboard-roles) Was this page helpful? YesNo --- # Dashboard Alerts | Alchemy Docs Copy page Dashboard Alerts ================ Guide on setting up and managing dashboard alerts to monitor your app behavior and usage What Alerts can I set up? ========================= We offer two types of alerts: * **Error rate alerts**: Receive alerts when your error rates reach a specified threshold across all your apps in a certain time interval. For instance, get an alert if 5% of your requests in the past 10 minutes are errors. * **Usage Alerts**: Monitor your spending and stay within budget by getting alerted when your on-demand usage reaches a specified dollar or CU amount. Alerts are currently not available on the free tier. How to set up alerts ==================== Setting up alerts in the dashboard is easy. All members of your team will have the same alerts configuration and access to the alerts hub. You can manage your alert settings by adding or removing yourself as a subscriber to active team alerts. 1. Visit the [configure alerts page](https://dashboard.alchemy.com/settings/alerts?utm_source=docs&utm_medium=referral&utm_content=dashboard-alerts) in the dashboard ![Untitled](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1749236740%2Fdocs%2FScreenshot_2025-06-06_at_12.03.07_PM_bwy12m.png&w=3840&q=75) 2. Click “Create new alert” ![Untitled](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764180228%2Fdocs%2Ftutorials%2Fgetting-started%2Fdeveloper-best-practices%2F15f783a-create-alert.png&w=3840&q=75) 3. Choose the type of alert you wish to create: Error Rate or Usage Alert. ![](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1749236832%2Fdocs%2FUntitled_gybzma.jpg&w=3840&q=75) 4. Set your alert configurations **For Error Rate Alerts:** * _**Error Threshold**_: The % of errors out of your total requests that you want to be alerted for. We recommend setting this high enough so that it’s not noisy, but low enough to catch abnormalities. This range will change depending on your expected error rates but we typically recommend anywhere from 1-5% depending on your error tolerance. * _**Interval**_: The time interval to measure total requests over. A good rule of thumb here is 5-15mins. * _**Alert Frequency**_: Decide how often you want the alert notifications. Depending on what your threshold is set at, you don’t want this to be spammy. * _**Recipients**_: Define who the alert will be sent to. If there are specific teammates who want to subscribe to these alerts you can add their emails here. Only emails with active alchemy accounts on your team will be able to receive alerts. * _**Alert Name**_: Give your alert a distinct name for easy identification. ![](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1749236966%2Fdocs%2FScreenshot_2025-06-06_at_12.09.10_PM_o1jmnd.png&w=3840&q=75) **For Usage Alerts:** * _**Usage Threshold**_: Input the dollar or CU amount that, when reached, will trigger the alert. * _**Usage Unit**_: Choose USD or CUs based on your preference from the drop-down on the right. * _**Email Recipients**_: Define who the alert will be sent to. If there are specific teammates who want to subscribe to these alerts you can add their emails here. Only emails with active alchemy accounts on your team will be able to receive alerts. * _**Alert Name**_: Give your alert a distinct name for easy identification. ![](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764180230%2Fdocs%2Ftutorials%2Fgetting-started%2Fdeveloper-best-practices%2F92b63dd-image.png&w=3840&q=75) 5. Save your alert Once your alert is saved, you should see it appear in your alerts list. ![Untitled](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764180231%2Fdocs%2Ftutorials%2Fgetting-started%2Fdeveloper-best-practices%2F863a4d7-save.png&w=3840&q=75) 6. When your alert gets triggered, you’ll get an email about it and will also be able to see it in the notification panel and the [Alerts Hub](https://dashboard.alchemy.com/alerts?utm_source=docs&utm_medium=referral&utm_content=dashboard-alerts) ! **Alerts Email:** ![](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764180232%2Fdocs%2Ftutorials%2Fgetting-started%2Fdeveloper-best-practices%2F4578710-2d46d6c-image.png&w=3840&q=75) **Alerts Notification Panel:** ![](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1749237095%2Fdocs%2FScreenshot_2025-06-06_at_12.03.07_PM_evhwlp.png&w=3840&q=75) **Alerts Hub:** ![](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1749237102%2Fdocs%2FScreenshot_2025-06-06_at_12.11.05_PM_fp3f81.png&w=3840&q=75) 7. Dismiss alerts manually or by clicking on the relevant action item. Alerts will automatically be dismissed if you click on them directly. Manually dismiss alerts by clicking on the X button next to the alert or by clicking “Dismiss All” ![Untitled](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764180232%2Fdocs%2Ftutorials%2Fgetting-started%2Fdeveloper-best-practices%2F3898c1d-dismiss.png&w=3840&q=75) 8. Dismissed alerts will be moved into “past alerts” Past alerts are available for you to view at any time, simply scroll down to the bottom in the `Alerts Hub` page. 9. Edit, deactivate, and delete alerts at any time by visiting your [Alert configuration page](https://dashboard.alchemy.com/settings/alerts?utm_source=docs&utm_medium=referral&utm_content=dashboard-alerts) . How do I unsubscribe myself from an Alert? ========================================== You can unsubscribe yourself from an alert by editing the alert and removing your name from the recipient list. Note that deactivating or deleting alerts will do so for your entire team so if you’re just looking to remove yourself, you should edit the alert instead. Editing Alerts ============== You can edit any alert by visiting the [Alerts Configuration page](https://dashboard.alchemy.com/settings/alerts?utm_source=docs&utm_medium=referral&utm_content=dashboard-alerts) . Alert edits will apply to the entire team so make sure to communicate with the alert subscribers or create a new alert if you want to keep multiple versions. Deactivating Alerts =================== Deactivating alerts will disable them from being sent to all the specified subscribers. If you’d like to remove yourself from receiving the alert you can do so by editing the alert instead of deactivating it for everyone. We recommend deactivating alerts if your team no longer wants to receive them but may want to use them again in the future. You can also edit your alert settings to change the thresholds and frequencies. Deleting Alerts =============== Deleting an alert will remove and unsubscribe it for everyone in addition to removing all alert settings. We only recommend deleting alerts if you know you will never want to reactivate them again. How we define “Errors” ====================== To understand how we define error requests, it’s helpful to know what our definition is for successful requests: * **Success:** HTTP status code is `2xx` **and** the `response.error` field is empty (null). * **Failure:** Any condition that does not meet the success criteria. For more details and context on error codes, check out [Error Reference](https://www.alchemy.com/docs/reference/error-reference) . Was this page helpful? YesNo --- # Dashboard SSO | Alchemy Docs Copy page Dashboard SSO ============= Guide to explain the Single Sign-On (SSO) available on the Alchemy Dashboard Single Sign-On (SSO) allows your team to sign in to the Alchemy Dashboard through your Identity Provider (IdP) using a single set of credentials. This improves security and simplifies access management across your organization. We support SAML 2.0-based SSO for Enterprise customers. This feature is currently in beta and requires manual setup. To enable SSO for your team, contact [\[email protected\]](https://www.alchemy.com/cdn-cgi/l/email-protection#b9cacad6f9d8d5dad1dcd4c097dad6d4) . Requirements ------------ To begin setup, you will need: * An Identity Provider (IdP) that supports SAML 2.0 (e.g., Okta, Entra ID, OneLogin) * Ability to configure a new SAML application within your IdP Setup Instructions ------------------ ### 1\. Create a new SAML application in your IdP Use the following values: * **ACS (Assertion Consumer Service) URL**: * **Audience (Entity ID)**: urn:auth0:prod-authchemy: We will provide your unique `` when you initiate setup and reach out to us. ### 2\. Configure Attribute Mappings Your SAML assertion must include: { "email": "email", "name": "firstName", "given_name": "firstName", "family_name": "lastName" } ### 3\. Share Metadata with Us Please send a brief email to [\[email protected\]](https://www.alchemy.com/cdn-cgi/l/email-protection#fe8d8d91be9f929d969b9387d09d9193) letting us know you’re ready to share your IdP metadata. We will reply with a **secure SendSafely link** where you can upload the following: * Identity Provider SSO URL * X.509 Certificate Logging In ---------- Once setup is complete, users can log in at [dashboard.alchemy.com](https://dashboard.alchemy.com/signup?utm_source=docs&utm_medium=referral&utm_content=dashboard-sso) and will be redirected to your Identity Provider. For questions or support, contact [\[email protected\]](https://www.alchemy.com/cdn-cgi/l/email-protection#681b1b072809040b000d0511460b0705) . Was this page helpful? YesNo --- # Unknown Copy page Use AI-powered IDEs & AI Agents =============================== AI Tooling ---------- ### Replit [Replit](https://replit.com/) is a cloud-based coding platform that streamlines the process of setting up, building, sharing, and deploying projects. It allows developers to code in a Google Docs-like environment, and pre-built templates provide a great starting point for building a website, app, or game. Its new AI Agent can assist with the code development process and work with several files at once, making the programming process feel like a one-on-one conversation. ### Cursor [Cursor](https://cursor.com/) is an AI-powered code editor that makes the programming experience feel like magic. Built as a fork of VS Code, it boasts powerful features like AI code completion, natural language editing, and codebase understanding. Cursor Pro is free for the first two weeks after signup, and offers more powerful models. AI Coding Agents ---------------- ### Claude Code [Claude Code](https://www.anthropic.com/claude-code) is an AI-powered coding assistant that integrates into editors like VS Code, Cursor, and JetBrains. It excels at understanding large codebases, generating code, and assisting with debugging through natural conversation. Unlike AI-powered IDEs, it layers on top of your existing setup rather than replacing it. Was this page helpful? YesNo --- # Supported Chains | Alchemy Docs Copy page Supported Chains ================ Use the Node API for low-level access to Alchemy-supported blockchains Supported Chains ---------------- Alchemy supports both EVM and non-EVM chains, view API references below: [![Ethereum logo](https://alchemyapi-res.cloudinary.com/image/upload/v1764179980/docs/api-reference/node-api/api_icon.svg)\ \ Ethereum\ \ View Ethereum API reference.](https://www.alchemy.com/docs/ethereum) [![Polygon logo](https://alchemyapi-res.cloudinary.com/image/upload/v1764179983/docs/api-reference/node-api/api_icon2.svg)\ \ Polygon PoS\ \ View Polygon PoS API reference.](https://www.alchemy.com/docs/reference/polygon-pos-api-quickstart) [![Optimism logo](https://alchemyapi-res.cloudinary.com/image/upload/v1764179985/docs/api-reference/node-api/op-mainnet.svg)\ \ OP Mainnet\ \ View OP Mainnet API reference.](https://www.alchemy.com/docs/reference/op-mainnet-api-quickstart) [![Arbitrum logo](https://alchemyapi-res.cloudinary.com/image/upload/v1764179954/docs/api-reference/alchemy-rollups/api_icon3.svg)\ \ Arbitrum\ \ View Arbitrum API reference.](https://www.alchemy.com/docs/reference/arbitrum-api-quickstart) [![Astar logo](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764179986%2Fdocs%2Fapi-reference%2Fnode-api%2Fastar-logo.png&w=3840&q=75)\ \ Astar\ \ View Astar API reference.](https://www.alchemy.com/docs/reference/astar-api-quickstart) [![Solana logo](https://alchemyapi-res.cloudinary.com/image/upload/v1764179987/docs/api-reference/node-api/api_icon5.svg)\ \ Solana\ \ View Solana API reference.](https://www.alchemy.com/docs/reference/solana-api-quickstart) [![Polygon zkEVM logo](https://alchemyapi-res.cloudinary.com/image/upload/v1764179990/docs/api-reference/node-api/227805834-81551a59-b841-446f-b0ad-e3affc67aa98.svg)\ \ Polygon zkEVM\ \ View Polygon zkEVM API reference.](https://www.alchemy.com/docs/reference/polygon-zkevm-api-quickstart) [![Starknet logo](https://alchemyapi-res.cloudinary.com/image/upload/v1764179992/docs/api-reference/node-api/starknet.svg)\ \ Starknet\ \ View Starknet API reference.](https://www.alchemy.com/docs/reference/starknet-api-quickstart) [![Base logo](https://alchemyapi-res.cloudinary.com/image/upload/v1764179995/docs/api-reference/node-api/f7c7331e-d19f-4ffd-8172-47edfcb9cfd9.svg)\ \ Base\ \ View Base API reference.](https://www.alchemy.com/docs/reference/base-api-quickstart) [![zkSync logo](https://alchemyapi-res.cloudinary.com/image/upload/v1764180005/docs/api-reference/node-api/6990bb3e-c2d2-4086-af31-41d12b4fd741.svg)\ \ zkSync\ \ View zkSync API reference.](https://www.alchemy.com/docs/reference/zksync-api-quickstart) [![ZetaChain logo](https://alchemyapi-res.cloudinary.com/image/upload/v1764180007/docs/api-reference/node-api/zetachain.svg)\ \ ZetaChain\ \ View ZetaChain API reference.](https://www.alchemy.com/docs/reference/zetachain-api-quickstart) [![Blast logo](https://alchemyapi-res.cloudinary.com/image/upload/v1764180010/docs/api-reference/node-api/blast.svg)\ \ Blast\ \ View Blast API reference.](https://www.alchemy.com/docs/reference/blast-chain-api-quickstart) [![Sonic logo](https://alchemyapi-res.cloudinary.com/image/upload/v1764180011/docs/api-reference/node-api/sonic.svg)\ \ Sonic\ \ View Sonic API reference.](https://www.alchemy.com/docs/reference/sonic-api-quickstart) [![Sei logo](https://alchemyapi-res.cloudinary.com/image/upload/v1764180013/docs/api-reference/node-api/Sei_Symbol_Gradient.svg)\ \ Sei\ \ View Sei API reference.](https://www.alchemy.com/docs/reference/sei-api-quickstart) [![Arbitrum Nova logo](https://alchemyapi-res.cloudinary.com/image/upload/v1764180015/docs/api-reference/node-api/arb-nova.svg)\ \ Arbitrum Nova\ \ View Arbitrum Nova API reference.](https://www.alchemy.com/docs/reference/arbitrum-nova-api-quickstart) [![Linea logo](https://alchemyapi-res.cloudinary.com/image/upload/v1764180018/docs/api-reference/node-api/linea.svg)\ \ Linea\ \ View Linea API reference.](https://www.alchemy.com/docs/reference/linea-chain-api-quickstart) [![Mantle logo](https://alchemyapi-res.cloudinary.com/image/upload/v1764180019/docs/api-reference/node-api/mantle.svg)\ \ Mantle\ \ View Mantle API reference.](https://www.alchemy.com/docs/reference/mantle-chain-api-quickstart) [![Monad logo](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764180022%2Fdocs%2Fapi-reference%2Fnode-api%2Fmonad_logo.png&w=3840&q=75)\ \ Monad\ \ View Monad API reference.](https://www.alchemy.com/docs/reference/monad-chain-api-quickstart) [![Celo logo](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764180023%2Fdocs%2Fapi-reference%2Fnode-api%2Fbrand-kit-symbol-image-04.webp&w=3840&q=75)\ \ Celo\ \ View Celo API reference.](https://www.alchemy.com/docs/reference/celo-chain-api-quickstart) [![Berachain logo](https://alchemyapi-res.cloudinary.com/image/upload/v1764180024/docs/api-reference/node-api/berachain.svg)\ \ Berachain\ \ View Berachain API reference.](https://www.alchemy.com/docs/reference/berachain-chain-api-quickstart) [![Flow logo](https://alchemyapi-res.cloudinary.com/image/upload/v1764180026/docs/api-reference/node-api/flow.svg)\ \ Flow\ \ View Flow API reference.](https://www.alchemy.com/docs/reference/flow-chain-api-quickstart) [![CrossFi logo](https://alchemyapi-res.cloudinary.com/image/upload/v1764180028/docs/api-reference/node-api/crossfi.svg)\ \ CrossFi\ \ View CrossFi API reference.](https://www.alchemy.com/docs/reference/crossfi-api-quickstart) [![Scroll logo](https://alchemyapi-res.cloudinary.com/image/upload/v1764180031/docs/api-reference/node-api/scroll.svg)\ \ Scroll\ \ View Scroll API reference.](https://www.alchemy.com/docs/reference/scroll-api-quickstart) [![Soneium logo](https://alchemyapi-res.cloudinary.com/image/upload/v1764180034/docs/api-reference/node-api/soneium.svg)\ \ Soneium\ \ View Soneium API reference.](https://www.alchemy.com/docs/reference/soneium-api-quickstart) [![World Chain logo](https://alchemyapi-res.cloudinary.com/image/upload/v1764180038/docs/api-reference/node-api/worldchain.svg)\ \ World Chain\ \ View World Chain API reference.](https://www.alchemy.com/docs/reference/world-chain-api-quickstart) [![Rootstock logo](https://alchemyapi-res.cloudinary.com/image/upload/v1764180040/docs/api-reference/node-api/rootstock.svg)\ \ Rootstock\ \ View Rootstock API reference.](https://www.alchemy.com/docs/reference/rootstock-api-quickstart) [![Shape logo](https://alchemyapi-res.cloudinary.com/image/upload/v1764180043/docs/api-reference/node-api/shape.svg)\ \ Shape\ \ View Shape API reference.](https://www.alchemy.com/docs/reference/shape-api-quickstart) [![Unichain logo](https://alchemyapi-res.cloudinary.com/image/upload/v1764180045/docs/api-reference/node-api/unichain.svg)\ \ Unichain\ \ View Unichain API reference.](https://www.alchemy.com/docs/reference/unichain-api-quickstart) [![ApeChain logo](https://alchemyapi-res.cloudinary.com/image/upload/v1764180047/docs/api-reference/node-api/apechain.svg)\ \ ApeChain\ \ View ApeChain API reference.](https://www.alchemy.com/docs/reference/apechain-api-quickstart) [![Geist logo](https://alchemyapi-res.cloudinary.com/image/upload/v1764180050/docs/api-reference/node-api/geist.svg)\ \ Geist\ \ View Geist API reference.](https://www.alchemy.com/docs/reference/geist-api-quickstart) [![Lens logo](https://alchemyapi-res.cloudinary.com/image/upload/v1764180052/docs/api-reference/node-api/lens.svg)\ \ Lens\ \ View Lens API reference.](https://www.alchemy.com/docs/reference/lens-api-quickstart) [![Abstract logo](https://alchemyapi-res.cloudinary.com/image/upload/v1764180054/docs/api-reference/node-api/abstract.svg)\ \ Abstract\ \ View Abstract API reference.](https://www.alchemy.com/docs/reference/abstract-api-quickstart) [![Ink logo](https://alchemyapi-res.cloudinary.com/image/upload/v1764180058/docs/api-reference/node-api/ink.svg)\ \ Ink\ \ View Ink API reference.](https://www.alchemy.com/docs/reference/ink-api-quickstart) [![BSC logo](https://alchemyapi-res.cloudinary.com/image/upload/v1764180060/docs/api-reference/node-api/bnb-mainnet.svg)\ \ BSC\ \ View BSC API reference.](https://www.alchemy.com/docs/reference/bnb-smart-chain-api-quickstart) [![Metis logo](https://alchemyapi-res.cloudinary.com/image/upload/v1764180062/docs/api-reference/node-api/metis.svg)\ \ Metis\ \ View Metis API reference.](https://www.alchemy.com/docs/reference/metis-chain-api-quickstart) [![Avalanche logo](https://alchemyapi-res.cloudinary.com/image/upload/v1764180064/docs/api-reference/node-api/avalanche.svg)\ \ Avalanche C-Chain\ \ View Avalanche C-Chain API reference.](https://www.alchemy.com/docs/reference/avalanche-api-quickstart) [![Gnosis logo](https://alchemyapi-res.cloudinary.com/image/upload/v1764180066/docs/api-reference/node-api/gnosis.svg)\ \ Gnosis\ \ View Gnosis API reference.](https://www.alchemy.com/docs/reference/gnosis-api-quickstart) [![opBNB logo](https://alchemyapi-res.cloudinary.com/image/upload/v1764180067/docs/api-reference/node-api/opbnb.svg)\ \ opBNB\ \ View opBNB API reference.](https://www.alchemy.com/docs/reference/opbnb-chain-api-quickstart) [![Bitcoin logo](https://alchemyapi-res.cloudinary.com/image/upload/v1764180070/docs/api-reference/node-api/Bitcoin.svg)\ \ Bitcoin\ \ View Bitcoin API reference.](https://www.alchemy.com/docs/reference/bitcoin-api-quickstart) [![Sui logo](https://alchemyapi-res.cloudinary.com/image/upload/v1764180072/docs/api-reference/node-api/SUI.svg)\ \ Sui\ \ View Sui API reference.](https://www.alchemy.com/docs/reference/sui-api-quickstart) [![Superseed logo](https://alchemyapi-res.cloudinary.com/image/upload/v1764180075/docs/api-reference/node-api/Superseed.svg)\ \ Superseed\ \ View Superseed API reference.](https://www.alchemy.com/docs/reference/superseed-api-quickstart) [![Aptos logo](https://alchemyapi-res.cloudinary.com/image/upload/v1764180077/docs/api-reference/node-api/Aptos.svg)\ \ Aptos\ \ View Aptos API reference.](https://www.alchemy.com/docs/reference/aptos-api-quickstart) [![Story logo](https://alchemyapi-res.cloudinary.com/image/upload/v1764180079/docs/api-reference/node-api/Story.svg)\ \ Story\ \ View Story API reference.](https://www.alchemy.com/docs/reference/story-api-quickstart) [![Anime logo](https://alchemyapi-res.cloudinary.com/image/upload/v1764180081/docs/api-reference/node-api/Anime.svg)\ \ Anime\ \ View Anime API reference.](https://www.alchemy.com/docs/reference/anime-api-quickstart) [![Botanix logo](https://alchemyapi-res.cloudinary.com/image/upload/v1764180083/docs/api-reference/node-api/Botanix.svg)\ \ Botanix\ \ View Botanix API reference.](https://www.alchemy.com/docs/reference/botanix-api-quickstart) [![HyperEVM logo](https://alchemyapi-res.cloudinary.com/image/upload/v1764180085/docs/api-reference/node-api/Hyperliquid.svg)\ \ HyperEVM\ \ View HyperEVM API reference.](https://www.alchemy.com/docs/reference/hyperliquid-api-quickstart) List of HTTP URLs by Supported Network -------------------------------------- | Platform | Network Name | HTTPS URL | | --- | --- | --- | | World Chain | World Chain Mainnet | [https://worldchain-mainnet.g.alchemy.com/v2/API\\\_KEY](https://worldchain-mainnet.g.alchemy.com/v2/API%5C_KEY) | | World Chain | World Chain Sepolia | [https://worldchain-sepolia.g.alchemy.com/v2/API\\\_KEY](https://worldchain-sepolia.g.alchemy.com/v2/API%5C_KEY) | | Shape | Shape Mainnet | [https://shape-mainnet.g.alchemy.com/v2/API\\\_KEY](https://shape-mainnet.g.alchemy.com/v2/API%5C_KEY) | | Shape | Shape Sepolia | [https://shape-sepolia.g.alchemy.com/v2/API\\\_KEY](https://shape-sepolia.g.alchemy.com/v2/API%5C_KEY) | | Ethereum | Ethereum Mainnet | [https://eth-mainnet.g.alchemy.com/v2/API\\\_KEY](https://eth-mainnet.g.alchemy.com/v2/API%5C_KEY) | | Ethereum | Ethereum Sepolia | [https://eth-sepolia.g.alchemy.com/v2/API\\\_KEY](https://eth-sepolia.g.alchemy.com/v2/API%5C_KEY) | | Ethereum | Ethereum Holešky | [https://eth-holesky.g.alchemy.com/v2/API\\\_KEY](https://eth-holesky.g.alchemy.com/v2/API%5C_KEY) | | Ethereum | Ethereum Hoodi | [https://eth-hoodi.g.alchemy.com/v2/API\\\_KEY](https://eth-hoodi.g.alchemy.com/v2/API%5C_KEY) | | Ethereum | Ethereum Mainnet Beacon | [https://eth-mainnetbeacon.g.alchemy.com/v2/API\\\_KEY](https://eth-mainnetbeacon.g.alchemy.com/v2/API%5C_KEY) | | Ethereum | Ethereum Sepolia Beacon | [https://eth-sepoliabeacon.g.alchemy.com/v2/API\\\_KEY](https://eth-sepoliabeacon.g.alchemy.com/v2/API%5C_KEY) | | Ethereum | Ethereum Holešky Beacon | [https://eth-holeskybeacon.g.alchemy.com/v2/API\\\_KEY](https://eth-holeskybeacon.g.alchemy.com/v2/API%5C_KEY) | | Ethereum | Ethereum Hoodi Beacon | [https://eth-hoodibeacon.g.alchemy.com/v2/API\\\_KEY](https://eth-hoodibeacon.g.alchemy.com/v2/API%5C_KEY) | | ZKsync | ZKsync Mainnet | [https://zksync-mainnet.g.alchemy.com/v2/API\\\_KEY](https://zksync-mainnet.g.alchemy.com/v2/API%5C_KEY) | | ZKsync | ZKsync Sepolia | [https://zksync-sepolia.g.alchemy.com/v2/API\\\_KEY](https://zksync-sepolia.g.alchemy.com/v2/API%5C_KEY) | | OP Mainnet | OP Mainnet Mainnet | [https://opt-mainnet.g.alchemy.com/v2/API\\\_KEY](https://opt-mainnet.g.alchemy.com/v2/API%5C_KEY) | | OP Mainnet | OP Mainnet Sepolia | [https://opt-sepolia.g.alchemy.com/v2/API\\\_KEY](https://opt-sepolia.g.alchemy.com/v2/API%5C_KEY) | | Polygon PoS | Polygon Mainnet | [https://polygon-mainnet.g.alchemy.com/v2/API\\\_KEY](https://polygon-mainnet.g.alchemy.com/v2/API%5C_KEY) | | Polygon PoS | Polygon Amoy | [https://polygon-amoy.g.alchemy.com/v2/API\\\_KEY](https://polygon-amoy.g.alchemy.com/v2/API%5C_KEY) | | Arbitrum | Arbitrum Mainnet | [https://arb-mainnet.g.alchemy.com/v2/API\\\_KEY](https://arb-mainnet.g.alchemy.com/v2/API%5C_KEY) | | Arbitrum | Arbitrum Sepolia | [https://arb-sepolia.g.alchemy.com/v2/API\\\_KEY](https://arb-sepolia.g.alchemy.com/v2/API%5C_KEY) | | Starknet | Starknet Mainnet | [https://starknet-mainnet.g.alchemy.com/starknet/version/rpc/v0\\\_10/API\\\_KEY](https://starknet-mainnet.g.alchemy.com/starknet/version/rpc/v0%5C_10/API%5C_KEY) | | Starknet | Starknet Sepolia | [https://starknet-sepolia.g.alchemy.com/starknet/version/rpc/v0\\\_10/API\\\_KEY](https://starknet-sepolia.g.alchemy.com/starknet/version/rpc/v0%5C_10/API%5C_KEY) | | Arbitrum Nova | Arbitrum Nova Mainnet | [https://arbnova-mainnet.g.alchemy.com/v2/API\\\_KEY](https://arbnova-mainnet.g.alchemy.com/v2/API%5C_KEY) | | Astar | Astar Mainnet | [https://astar-mainnet.g.alchemy.com/v2/API\\\_KEY](https://astar-mainnet.g.alchemy.com/v2/API%5C_KEY) | | Polygon zkEVM | Polygon zkEVM Mainnet | [https://polygonzkevm-mainnet.g.alchemy.com/v2/API\\\_KEY](https://polygonzkevm-mainnet.g.alchemy.com/v2/API%5C_KEY) | | Polygon zkEVM | Polygon zkEVM Cardona | [https://polygonzkevm-cardona.g.alchemy.com/v2/API\\\_KEY](https://polygonzkevm-cardona.g.alchemy.com/v2/API%5C_KEY) | | ZetaChain | ZetaChain Mainnet | [https://zetachain-mainnet.g.alchemy.com/v2/API\\\_KEY](https://zetachain-mainnet.g.alchemy.com/v2/API%5C_KEY) | | ZetaChain | ZetaChain Testnet | [https://zetachain-testnet.g.alchemy.com/v2/API\\\_KEY](https://zetachain-testnet.g.alchemy.com/v2/API%5C_KEY) | | Mantle | Mantle Mainnet | [https://mantle-mainnet.g.alchemy.com/v2/API\\\_KEY](https://mantle-mainnet.g.alchemy.com/v2/API%5C_KEY) | | Mantle | Mantle Sepolia | [https://mantle-sepolia.g.alchemy.com/v2/API\\\_KEY](https://mantle-sepolia.g.alchemy.com/v2/API%5C_KEY) | | Berachain | Berachain Mainnet | [https://berachain-mainnet.g.alchemy.com/v2/API\\\_KEY](https://berachain-mainnet.g.alchemy.com/v2/API%5C_KEY) | | Berachain | Berachain Bepolia | [https://berachain-bepolia.g.alchemy.com/v2/API\\\_KEY](https://berachain-bepolia.g.alchemy.com/v2/API%5C_KEY) | | Blast | Blast Mainnet | [https://blast-mainnet.g.alchemy.com/v2/API\\\_KEY](https://blast-mainnet.g.alchemy.com/v2/API%5C_KEY) | | Blast | Blast Sepolia | [https://blast-sepolia.g.alchemy.com/v2/API\\\_KEY](https://blast-sepolia.g.alchemy.com/v2/API%5C_KEY) | | Linea | Linea Mainnet | [https://linea-mainnet.g.alchemy.com/v2/API\\\_KEY](https://linea-mainnet.g.alchemy.com/v2/API%5C_KEY) | | Linea | Linea Sepolia | [https://linea-sepolia.g.alchemy.com/v2/API\\\_KEY](https://linea-sepolia.g.alchemy.com/v2/API%5C_KEY) | | Zora | Zora Mainnet | [https://zora-mainnet.g.alchemy.com/v2/API\\\_KEY](https://zora-mainnet.g.alchemy.com/v2/API%5C_KEY) | | Zora | Zora Sepolia | [https://zora-sepolia.g.alchemy.com/v2/API\\\_KEY](https://zora-sepolia.g.alchemy.com/v2/API%5C_KEY) | | Ronin | Ronin Mainnet | [https://ronin-mainnet.g.alchemy.com/v2/API\\\_KEY](https://ronin-mainnet.g.alchemy.com/v2/API%5C_KEY) | | Ronin | Ronin Saigon | [https://ronin-saigon.g.alchemy.com/v2/API\\\_KEY](https://ronin-saigon.g.alchemy.com/v2/API%5C_KEY) | | Plasma | Plasma Mainnet | [https://plasma-mainnet.g.alchemy.com/v2/API\\\_KEY](https://plasma-mainnet.g.alchemy.com/v2/API%5C_KEY) | | Plasma | Plasma Testnet | [https://plasma-testnet.g.alchemy.com/v2/API\\\_KEY](https://plasma-testnet.g.alchemy.com/v2/API%5C_KEY) | | Standard | Standard Mainnet | [https://standard-mainnet.g.alchemy.com/v2/API\\\_KEY](https://standard-mainnet.g.alchemy.com/v2/API%5C_KEY) | | Commons | Commons Mainnet | [https://commons-mainnet.g.alchemy.com/v2/API\\\_KEY](https://commons-mainnet.g.alchemy.com/v2/API%5C_KEY) | | Mythos | Mythos Mainnet | [https://mythos-mainnet.g.alchemy.com/v2/API\\\_KEY](https://mythos-mainnet.g.alchemy.com/v2/API%5C_KEY) | | Settlus | Settlus Mainnet | [https://settlus-mainnet.g.alchemy.com/v2/API\\\_KEY](https://settlus-mainnet.g.alchemy.com/v2/API%5C_KEY) | | Settlus | Settlus Sepolia | [https://settlus-septestnet.g.alchemy.com/v2/API\\\_KEY](https://settlus-septestnet.g.alchemy.com/v2/API%5C_KEY) | | Earnm | Earnm Sepolia | [https://earnm-sepolia.g.alchemy.com/v2/API\\\_KEY](https://earnm-sepolia.g.alchemy.com/v2/API%5C_KEY) | | Earnm | Earnm Mainnet | [https://earnm-mainnet.g.alchemy.com/v2/API\\\_KEY](https://earnm-mainnet.g.alchemy.com/v2/API%5C_KEY) | | X Protocol | X Protocol Mainnet | [https://xprotocol-mainnet.g.alchemy.com/v2/API\\\_KEY](https://xprotocol-mainnet.g.alchemy.com/v2/API%5C_KEY) | | BOB | BOB Mainnet | [https://bob-mainnet.g.alchemy.com/v2/API\\\_KEY](https://bob-mainnet.g.alchemy.com/v2/API%5C_KEY) | | BOB | BOB Sepolia | [https://bob-sepolia.g.alchemy.com/v2/API\\\_KEY](https://bob-sepolia.g.alchemy.com/v2/API%5C_KEY) | | MegaETH | MegaETH Mainnet | [https://megaeth-mainnet.g.alchemy.com/v2/API\\\_KEY](https://megaeth-mainnet.g.alchemy.com/v2/API%5C_KEY) | | MegaETH | MegaETH Testnet | [https://megaeth-testnet.g.alchemy.com/v2/API\\\_KEY](https://megaeth-testnet.g.alchemy.com/v2/API%5C_KEY) | | Rootstock | Rootstock Mainnet | [https://rootstock-mainnet.g.alchemy.com/v2/API\\\_KEY](https://rootstock-mainnet.g.alchemy.com/v2/API%5C_KEY) | | Rootstock | Rootstock Testnet | [https://rootstock-testnet.g.alchemy.com/v2/API\\\_KEY](https://rootstock-testnet.g.alchemy.com/v2/API%5C_KEY) | | Worldl3 | WorldL3 Devnet | [https://worldl3-devnet.g.alchemy.com/v2/API\\\_KEY](https://worldl3-devnet.g.alchemy.com/v2/API%5C_KEY) | | Citrea | Citrea Testnet | [https://citrea-testnet.g.alchemy.com/v2/API\\\_KEY](https://citrea-testnet.g.alchemy.com/v2/API%5C_KEY) | | Citrea | Citrea Mainnet | [https://citrea-mainnet.g.alchemy.com/v2/API\\\_KEY](https://citrea-mainnet.g.alchemy.com/v2/API%5C_KEY) | | Tea | Tea Sepolia | [https://tea-sepolia.g.alchemy.com/v2/API\\\_KEY](https://tea-sepolia.g.alchemy.com/v2/API%5C_KEY) | | Solana | Solana Mainnet | [https://solana-mainnet.g.alchemy.com/v2/API\\\_KEY](https://solana-mainnet.g.alchemy.com/v2/API%5C_KEY) | | Solana | Solana Devnet | [https://solana-devnet.g.alchemy.com/v2/API\\\_KEY](https://solana-devnet.g.alchemy.com/v2/API%5C_KEY) | | Gensyn | Gensyn Testnet | [https://gensyn-testnet.g.alchemy.com/v2/API\\\_KEY](https://gensyn-testnet.g.alchemy.com/v2/API%5C_KEY) | | Gensyn | Gensyn Mainnet | [https://gensyn-mainnet.g.alchemy.com/v2/API\\\_KEY](https://gensyn-mainnet.g.alchemy.com/v2/API%5C_KEY) | | Arc | Arc Testnet | [https://arc-testnet.g.alchemy.com/v2/API\\\_KEY](https://arc-testnet.g.alchemy.com/v2/API%5C_KEY) | | Story | Story Mainnet | [https://story-mainnet.g.alchemy.com/v2/API\\\_KEY](https://story-mainnet.g.alchemy.com/v2/API%5C_KEY) | | Story | Story Aeneid | [https://story-aeneid.g.alchemy.com/v2/API\\\_KEY](https://story-aeneid.g.alchemy.com/v2/API%5C_KEY) | | Clankermon | Clankermon Mainnet | [https://clankermon-mainnet.g.alchemy.com/v2/API\\\_KEY](https://clankermon-mainnet.g.alchemy.com/v2/API%5C_KEY) | | Humanity | Humanity Mainnet | [https://humanity-mainnet.g.alchemy.com/v2/API\\\_KEY](https://humanity-mainnet.g.alchemy.com/v2/API%5C_KEY) | | Humanity | Humanity Testnet | [https://humanity-testnet.g.alchemy.com/v2/API\\\_KEY](https://humanity-testnet.g.alchemy.com/v2/API%5C_KEY) | | Risa | Risa Testnet | [https://risa-testnet.g.alchemy.com/v2/API\\\_KEY](https://risa-testnet.g.alchemy.com/v2/API%5C_KEY) | | Base | Base Mainnet | [https://base-mainnet.g.alchemy.com/v2/API\\\_KEY](https://base-mainnet.g.alchemy.com/v2/API%5C_KEY) | | Base | Base Sepolia | [https://base-sepolia.g.alchemy.com/v2/API\\\_KEY](https://base-sepolia.g.alchemy.com/v2/API%5C_KEY) | | Tempo | Tempo Testnet | [https://tempo-testnet.g.alchemy.com/v2/API\\\_KEY](https://tempo-testnet.g.alchemy.com/v2/API%5C_KEY) | | HyperEVM | Hyperliquid Mainnet | [https://hyperliquid-mainnet.g.alchemy.com/v2/API\\\_KEY](https://hyperliquid-mainnet.g.alchemy.com/v2/API%5C_KEY) | | HyperEVM | Hyperliquid Testnet | [https://hyperliquid-testnet.g.alchemy.com/v2/API\\\_KEY](https://hyperliquid-testnet.g.alchemy.com/v2/API%5C_KEY) | | Galactica | Galactica Mainnet | [https://galactica-mainnet.g.alchemy.com/v2/API\\\_KEY](https://galactica-mainnet.g.alchemy.com/v2/API%5C_KEY) | | Galactica | Galactica Cassiopeia | [https://galactica-cassiopeia.g.alchemy.com/v2/API\\\_KEY](https://galactica-cassiopeia.g.alchemy.com/v2/API%5C_KEY) | | Lens | Lens Mainnet | [https://lens-mainnet.g.alchemy.com/v2/API\\\_KEY](https://lens-mainnet.g.alchemy.com/v2/API%5C_KEY) | | Lens | Lens Sepolia | [https://lens-sepolia.g.alchemy.com/v2/API\\\_KEY](https://lens-sepolia.g.alchemy.com/v2/API%5C_KEY) | | World Mobile Chain | WorldMobileChain Mainnet | [https://worldmobilechain-mainnet.g.alchemy.com/v2/API\\\_KEY](https://worldmobilechain-mainnet.g.alchemy.com/v2/API%5C_KEY) | | Frax | Frax Mainnet | [https://frax-mainnet.g.alchemy.com/v2/API\\\_KEY](https://frax-mainnet.g.alchemy.com/v2/API%5C_KEY) | | Frax | Frax Sepolia | [https://frax-sepolia.g.alchemy.com/v2/API\\\_KEY](https://frax-sepolia.g.alchemy.com/v2/API%5C_KEY) | | Ink | Ink Mainnet | [https://ink-mainnet.g.alchemy.com/v2/API\\\_KEY](https://ink-mainnet.g.alchemy.com/v2/API%5C_KEY) | | Ink | Ink Sepolia | [https://ink-sepolia.g.alchemy.com/v2/API\\\_KEY](https://ink-sepolia.g.alchemy.com/v2/API%5C_KEY) | | Avalanche | Avalanche Mainnet | [https://avax-mainnet.g.alchemy.com/v2/API\\\_KEY](https://avax-mainnet.g.alchemy.com/v2/API%5C_KEY) | | Avalanche | Avalanche Fuji | [https://avax-fuji.g.alchemy.com/v2/API\\\_KEY](https://avax-fuji.g.alchemy.com/v2/API%5C_KEY) | | Botanix | Botanix Mainnet | [https://botanix-mainnet.g.alchemy.com/v2/API\\\_KEY](https://botanix-mainnet.g.alchemy.com/v2/API%5C_KEY) | | Botanix | Botanix Testnet | [https://botanix-testnet.g.alchemy.com/v2/API\\\_KEY](https://botanix-testnet.g.alchemy.com/v2/API%5C_KEY) | | Gnosis | Gnosis Mainnet | [https://gnosis-mainnet.g.alchemy.com/v2/API\\\_KEY](https://gnosis-mainnet.g.alchemy.com/v2/API%5C_KEY) | | Gnosis | Gnosis Chiado | [https://gnosis-chiado.g.alchemy.com/v2/API\\\_KEY](https://gnosis-chiado.g.alchemy.com/v2/API%5C_KEY) | | CelestiaBridge | CelestiaBridge Mainnet | [https://celestiabridge-mainnet.g.alchemy.com/v2/API\\\_KEY](https://celestiabridge-mainnet.g.alchemy.com/v2/API%5C_KEY) | | CelestiaBridge | CelestiaBridge Mocha | [https://celestiabridge-mocha.g.alchemy.com/v2/API\\\_KEY](https://celestiabridge-mocha.g.alchemy.com/v2/API%5C_KEY) | | BNB Smart Chain | BNB Smart Chain Mainnet | [https://bnb-mainnet.g.alchemy.com/v2/API\\\_KEY](https://bnb-mainnet.g.alchemy.com/v2/API%5C_KEY) | | BNB Smart Chain | BNB Smart Chain Testnet | [https://bnb-testnet.g.alchemy.com/v2/API\\\_KEY](https://bnb-testnet.g.alchemy.com/v2/API%5C_KEY) | | Alchemy Arbitrum | Alchemy Arbitrum Fam | [https://alchemyarb-fam.g.alchemy.com/v2/API\\\_KEY](https://alchemyarb-fam.g.alchemy.com/v2/API%5C_KEY) | | Alchemy Arbitrum | Alchemy Arbitrum Sepolia | [https://alchemyarb-sepolia.g.alchemy.com/v2/API\\\_KEY](https://alchemyarb-sepolia.g.alchemy.com/v2/API%5C_KEY) | | Boba | Boba Mainnet | [https://boba-mainnet.g.alchemy.com/v2/API\\\_KEY](https://boba-mainnet.g.alchemy.com/v2/API%5C_KEY) | | Boba | Boba Sepolia | [https://boba-sepolia.g.alchemy.com/v2/API\\\_KEY](https://boba-sepolia.g.alchemy.com/v2/API%5C_KEY) | | SUI | SUI Mainnet | [https://sui-mainnet.g.alchemy.com/v2/API\\\_KEY](https://sui-mainnet.g.alchemy.com/v2/API%5C_KEY) | | SUI | SUI Testnet | [https://sui-testnet.g.alchemy.com/v2/API\\\_KEY](https://sui-testnet.g.alchemy.com/v2/API%5C_KEY) | | Syndicate | Syndicate Manchego | [https://syndicate-manchego.g.alchemy.com/v2/API\\\_KEY](https://syndicate-manchego.g.alchemy.com/v2/API%5C_KEY) | | Unichain | Unichain Mainnet | [https://unichain-mainnet.g.alchemy.com/v2/API\\\_KEY](https://unichain-mainnet.g.alchemy.com/v2/API%5C_KEY) | | Unichain | Unichain Sepolia | [https://unichain-sepolia.g.alchemy.com/v2/API\\\_KEY](https://unichain-sepolia.g.alchemy.com/v2/API%5C_KEY) | | Syndicate | Syndicate Mainnet | [https://synd-mainnet.g.alchemy.com/v2/API\\\_KEY](https://synd-mainnet.g.alchemy.com/v2/API%5C_KEY) | | Superseed | Superseed Mainnet | [https://superseed-mainnet.g.alchemy.com/v2/API\\\_KEY](https://superseed-mainnet.g.alchemy.com/v2/API%5C_KEY) | | Superseed | Superseed Sepolia | [https://superseed-sepolia.g.alchemy.com/v2/API\\\_KEY](https://superseed-sepolia.g.alchemy.com/v2/API%5C_KEY) | | Rise | Rise Testnet | [https://rise-testnet.g.alchemy.com/v2/API\\\_KEY](https://rise-testnet.g.alchemy.com/v2/API%5C_KEY) | | Monad | Monad Testnet | [https://monad-testnet.g.alchemy.com/v2/API\\\_KEY](https://monad-testnet.g.alchemy.com/v2/API%5C_KEY) | | Monad | Monad Mainnet | [https://monad-mainnet.g.alchemy.com/v2/API\\\_KEY](https://monad-mainnet.g.alchemy.com/v2/API%5C_KEY) | | Flow EVM | Flow EVM Mainnet | [https://flow-mainnet.g.alchemy.com/v2/API\\\_KEY](https://flow-mainnet.g.alchemy.com/v2/API%5C_KEY) | | Flow EVM | Flow EVM Testnet | [https://flow-testnet.g.alchemy.com/v2/API\\\_KEY](https://flow-testnet.g.alchemy.com/v2/API%5C_KEY) | | Openloot | Openloot Sepolia | [https://openloot-sepolia.g.alchemy.com/v2/API\\\_KEY](https://openloot-sepolia.g.alchemy.com/v2/API%5C_KEY) | | Worldmobile | WorldMobile Devnet | [https://worldmobile-devnet.g.alchemy.com/v2/API\\\_KEY](https://worldmobile-devnet.g.alchemy.com/v2/API%5C_KEY) | | Worldmobile | WorldMobile Testnet | [https://worldmobile-testnet.g.alchemy.com/v2/API\\\_KEY](https://worldmobile-testnet.g.alchemy.com/v2/API%5C_KEY) | | Tron | Tron Mainnet | [https://tron-mainnet.g.alchemy.com/v2/API\\\_KEY](https://tron-mainnet.g.alchemy.com/v2/API%5C_KEY) | | Tron | Tron Testnet | [https://tron-testnet.g.alchemy.com/v2/API\\\_KEY](https://tron-testnet.g.alchemy.com/v2/API%5C_KEY) | | Unite | Unite Mainnet | [https://unite-mainnet.g.alchemy.com/v2/API\\\_KEY](https://unite-mainnet.g.alchemy.com/v2/API%5C_KEY) | | Unite | Unite Testnet | [https://unite-testnet.g.alchemy.com/v2/API\\\_KEY](https://unite-testnet.g.alchemy.com/v2/API%5C_KEY) | | Degen | Degen Mainnet | [https://degen-mainnet.g.alchemy.com/v2/API\\\_KEY](https://degen-mainnet.g.alchemy.com/v2/API%5C_KEY) | | Degen | Degen Sepolia | [https://degen-sepolia.g.alchemy.com/v2/API\\\_KEY](https://degen-sepolia.g.alchemy.com/v2/API%5C_KEY) | | Bitcoin | Bitcoin Mainnet | [https://bitcoin-mainnet.g.alchemy.com/v2/API\\\_KEY](https://bitcoin-mainnet.g.alchemy.com/v2/API%5C_KEY) | | Bitcoin | Bitcoin Testnet | [https://bitcoin-testnet.g.alchemy.com/v2/API\\\_KEY](https://bitcoin-testnet.g.alchemy.com/v2/API%5C_KEY) | | Bitcoin | Bitcoin Signet | [https://bitcoin-signet.g.alchemy.com/v2/API\\\_KEY](https://bitcoin-signet.g.alchemy.com/v2/API%5C_KEY) | | Polynomial | Polynomial Mainnet | [https://polynomial-mainnet.g.alchemy.com/v2/API\\\_KEY](https://polynomial-mainnet.g.alchemy.com/v2/API%5C_KEY) | | Polynomial | Polynomial Sepolia | [https://polynomial-sepolia.g.alchemy.com/v2/API\\\_KEY](https://polynomial-sepolia.g.alchemy.com/v2/API%5C_KEY) | | Mode | Mode Mainnet | [https://mode-mainnet.g.alchemy.com/v2/API\\\_KEY](https://mode-mainnet.g.alchemy.com/v2/API%5C_KEY) | | Mode | Mode Sepolia | [https://mode-sepolia.g.alchemy.com/v2/API\\\_KEY](https://mode-sepolia.g.alchemy.com/v2/API%5C_KEY) | | Edge | Edge Mainnet | [https://edge-mainnet.g.alchemy.com/v2/API\\\_KEY](https://edge-mainnet.g.alchemy.com/v2/API%5C_KEY) | | Edge | Edge Testnet | [https://edge-testnet.g.alchemy.com/v2/API\\\_KEY](https://edge-testnet.g.alchemy.com/v2/API%5C_KEY) | | Moonbeam | Moonbeam Mainnet | [https://moonbeam-mainnet.g.alchemy.com/v2/API\\\_KEY](https://moonbeam-mainnet.g.alchemy.com/v2/API%5C_KEY) | | Alchemy | Alchemy Sepolia | [https://alchemy-sepolia.g.alchemy.com/v2/API\\\_KEY](https://alchemy-sepolia.g.alchemy.com/v2/API%5C_KEY) | | Alchemy | Alchemy Internal | [https://alchemy-internal.g.alchemy.com/v2/API\\\_KEY](https://alchemy-internal.g.alchemy.com/v2/API%5C_KEY) | | ApeChain | ApeChain Mainnet | [https://apechain-mainnet.g.alchemy.com/v2/API\\\_KEY](https://apechain-mainnet.g.alchemy.com/v2/API%5C_KEY) | | ApeChain | ApeChain Curtis | [https://apechain-curtis.g.alchemy.com/v2/API\\\_KEY](https://apechain-curtis.g.alchemy.com/v2/API%5C_KEY) | | Celo | Celo Mainnet | [https://celo-mainnet.g.alchemy.com/v2/API\\\_KEY](https://celo-mainnet.g.alchemy.com/v2/API%5C_KEY) | | Celo | Celo Sepolia | [https://celo-sepolia.g.alchemy.com/v2/API\\\_KEY](https://celo-sepolia.g.alchemy.com/v2/API%5C_KEY) | | Aptos | Aptos Mainnet | [https://aptos-mainnet.g.alchemy.com/v2/API\\\_KEY](https://aptos-mainnet.g.alchemy.com/v2/API%5C_KEY) | | Aptos | Aptos Testnet | [https://aptos-testnet.g.alchemy.com/v2/API\\\_KEY](https://aptos-testnet.g.alchemy.com/v2/API%5C_KEY) | | Anime | Anime Mainnet | [https://anime-mainnet.g.alchemy.com/v2/API\\\_KEY](https://anime-mainnet.g.alchemy.com/v2/API%5C_KEY) | | Anime | Anime Sepolia | [https://anime-sepolia.g.alchemy.com/v2/API\\\_KEY](https://anime-sepolia.g.alchemy.com/v2/API%5C_KEY) | | Alterscope | Alterscope Mainnet | [https://alterscope-mainnet.g.alchemy.com/v2/API\\\_KEY](https://alterscope-mainnet.g.alchemy.com/v2/API%5C_KEY) | | Metis | Metis Mainnet | [https://metis-mainnet.g.alchemy.com/v2/API\\\_KEY](https://metis-mainnet.g.alchemy.com/v2/API%5C_KEY) | | Sonic | Sonic Mainnet | [https://sonic-mainnet.g.alchemy.com/v2/API\\\_KEY](https://sonic-mainnet.g.alchemy.com/v2/API%5C_KEY) | | Sonic | Sonic Testnet | [https://sonic-testnet.g.alchemy.com/v2/API\\\_KEY](https://sonic-testnet.g.alchemy.com/v2/API%5C_KEY) | | Sonic | Sonic Blaze | [https://sonic-blaze.g.alchemy.com/v2/API\\\_KEY](https://sonic-blaze.g.alchemy.com/v2/API%5C_KEY) | | Sei | Sei Mainnet | [https://sei-mainnet.g.alchemy.com/v2/API\\\_KEY](https://sei-mainnet.g.alchemy.com/v2/API%5C_KEY) | | Sei | Sei Testnet | [https://sei-testnet.g.alchemy.com/v2/API\\\_KEY](https://sei-testnet.g.alchemy.com/v2/API%5C_KEY) | | XMTP | XMTP Ropsten | [https://xmtp-ropsten.g.alchemy.com/v2/API\\\_KEY](https://xmtp-ropsten.g.alchemy.com/v2/API%5C_KEY) | | XMTP | XMTP Mainnet | [https://xmtp-mainnet.g.alchemy.com/v2/API\\\_KEY](https://xmtp-mainnet.g.alchemy.com/v2/API%5C_KEY) | | ADI | ADI Testnet AB | [https://adi-testnet.g.alchemy.com/v2/API\\\_KEY](https://adi-testnet.g.alchemy.com/v2/API%5C_KEY) | | ADI | ADI Mainnet | [https://adi-mainnet.g.alchemy.com/v2/API\\\_KEY](https://adi-mainnet.g.alchemy.com/v2/API%5C_KEY) | | Scroll | Scroll Mainnet | [https://scroll-mainnet.g.alchemy.com/v2/API\\\_KEY](https://scroll-mainnet.g.alchemy.com/v2/API%5C_KEY) | | Scroll | Scroll Sepolia | [https://scroll-sepolia.g.alchemy.com/v2/API\\\_KEY](https://scroll-sepolia.g.alchemy.com/v2/API%5C_KEY) | | opBNB | opBNB Mainnet | [https://opbnb-mainnet.g.alchemy.com/v2/API\\\_KEY](https://opbnb-mainnet.g.alchemy.com/v2/API%5C_KEY) | | opBNB | opBNB Testnet | [https://opbnb-testnet.g.alchemy.com/v2/API\\\_KEY](https://opbnb-testnet.g.alchemy.com/v2/API%5C_KEY) | | Race | Race Mainnet | [https://race-mainnet.g.alchemy.com/v2/API\\\_KEY](https://race-mainnet.g.alchemy.com/v2/API%5C_KEY) | | Race | Race Sepolia | [https://race-sepolia.g.alchemy.com/v2/API\\\_KEY](https://race-sepolia.g.alchemy.com/v2/API%5C_KEY) | | CrossFi | CrossFi Testnet | [https://crossfi-testnet.g.alchemy.com/v2/API\\\_KEY](https://crossfi-testnet.g.alchemy.com/v2/API%5C_KEY) | | CrossFi | CrossFi Mainnet | [https://crossfi-mainnet.g.alchemy.com/v2/API\\\_KEY](https://crossfi-mainnet.g.alchemy.com/v2/API%5C_KEY) | | Abstract | Abstract Mainnet | [https://abstract-mainnet.g.alchemy.com/v2/API\\\_KEY](https://abstract-mainnet.g.alchemy.com/v2/API%5C_KEY) | | Abstract | Abstract Testnet | [https://abstract-testnet.g.alchemy.com/v2/API\\\_KEY](https://abstract-testnet.g.alchemy.com/v2/API%5C_KEY) | | Soneium | Soneium Mainnet | [https://soneium-mainnet.g.alchemy.com/v2/API\\\_KEY](https://soneium-mainnet.g.alchemy.com/v2/API%5C_KEY) | | Soneium | Soneium Minato | [https://soneium-minato.g.alchemy.com/v2/API\\\_KEY](https://soneium-minato.g.alchemy.com/v2/API%5C_KEY) | | Stable | Stable Mainnet | [https://stable-mainnet.g.alchemy.com/v2/API\\\_KEY](https://stable-mainnet.g.alchemy.com/v2/API%5C_KEY) | | Stable | Stable Testnet | [https://stable-testnet.g.alchemy.com/v2/API\\\_KEY](https://stable-testnet.g.alchemy.com/v2/API%5C_KEY) | | V | V Devnet | [https://rpc.devnet.alchemy.com/API\\\_KEY](https://rpc.devnet.alchemy.com/API%5C_KEY) | Was this page helpful? YesNo --- # Feature Support By Chain | Alchemy Docs Copy page Feature Support By Chain ======================== Alchemy's current feature availability for each of its supported chains Check the [Chains](https://dashboard.alchemy.com/chains?utm_source=docs&utm_medium=referral&utm_content=reference_feature-support-by-chain) page for details about product and chain support! ![](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764179964%2Fdocs%2Fapi-reference%2Falchemy-transact%2Ftransaction-simulation%2F523fb8a9a9d899921ee1046d0ff1b389967a9976d1c6112ebbbe071ddd1ef374-image.png&w=3840&q=75) Was this page helpful? YesNo --- # Understanding the Transaction Object on Ethereum | Alchemy Docs Copy page Understanding the Transaction Object on Ethereum ================================================ This guide details each element in the response of the Transaction object returned by eth\_getTransactionByHash This guide details each element in the response of the Transaction object returned by eth\_getTransactionByHash Transaction Object ------------------ The transaction object on Ethereum is made up of the following components: * `blockHash`: `DATA`, 32 Bytes - hash of the block where this transaction was in. null when it is pending. * `blockNumber`: `QUANTITY` - block number where this transaction was in. null when it's pending. * `from`: `DATA`, 20 Bytes - sender's address. * `gas`: `QUANTITY` - gas provided by the sender. * `gasPrice`: `QUANTITY` - gas price provided by the sender in Wei. * `hash`: `DATA`, 32 Bytes - hash of the transaction. * `input`: `DATA` - the data sent along with the transaction. * `nonce`: `QUANTITY` - the number of transactions made by the sender prior to this one. * `to`: `DATA`, 20 Bytes - address of the receiver. null when it's a contract creation transaction. * `transactionIndex`: `QUANTITY` - integer of the transactions index position in the block. null when it's pending. * `value`: `QUANTITY` - value transferred in Wei. * `v`: `QUANTITY` - ECDSA recovery id * `r`: `DATA`, 32 Bytes - ECDSA signature r * `s`: `DATA`, 32 Bytes - ECDSA signature s Below you will find more detailed explanations for each parameter on the transaction object. ### `Hash` Every transaction that has been verified and added to the blockchain will receive an assigned `hash`. This creates a unique identifier for the transaction that can be used to locate and retrieve information about a specific transaction. ### `blockHash` Each block has a corresponding cryptographic hash which includes all the data of that block. The`blockHash` is the hash of the block where this transaction has been included. In the case of a pending transaction that has not been added to a block, you will receive a `null` value in return. ### `blockNumber` Once a block has been added to the blockchain, it is assigned the following available number in sequential order. Using the `blockNumber`, you can tell when the transaction has been added to a block. ### `from` Ethereum transactions have both a sender and receiver. The `from` field is the address of the sender and can be used to find out which address started the transaction. ### `gas` For transactions to be completed and added to a block, the sender must provide an amount of gas in addition to the value of the transaction. Gas is used to cover the computation costs required to complete the transaction. This `gas` field shows you the amount of gas that was provided by the sender. ### `gasPrice` Another way to show the gas price is in wei. Wei is the smallest denomination of ETH and is a better way to work with smaller transactions of ETH. 1 wei is the equivalent of 10^-18 ETH. This `gasPrice` shows the amount of gas provided by the sender in WEI. ### `input` Data can be added to the data field of a transaction whenever a user deploys or makes a call to a function in a smart contract. This data is a message to the smart contract that points to the function that will be executed. The `input` field contains the data that is included in the transaction. If this field is empty, the transaction is a transfer between users and doesn't involve a smart contract. ### `nonce` To prevent any double-spend from a user and to ensure transactions occur in the correct order, each transaction from a given address has an assigned `nonce`. The nonce is the number of transactions from that specific address. The nonce increases by 1 after every transaction. A transaction must but be completed before another one can begin. ### `to` Transactions have both a sender and receiver. The `to` field is the address of the receiver and can be used to find out which address started the transaction. ### `transactionIndex` When a transaction is added to a block, it is assigned a numbered position inside that block. The `transactionIndex` returns the value of the position of the transaction in the block to which it has been added. ### `value` Every transaction has an attached value which is the amount that is being transferred from the sender to the receiver. The `value` returns this quantity and is shown in Wei. ### `r,s` Ethereum uses ECDSA (Elliptic Curve Digital Signature Algorithm) to create digital signatures of a transaction. These signatures are used to verify that they are authentic and coming from the correct sender, much like a real signature. A digital signature can be divided into two numbers - `r` and `s`. These numbers are generated by your private key. By sending `s` through an algorithm, you should get the value of `R` which is used to validate the signature. ### `v` ECDSA uses the `v` value to recover the correct public key when performing validation on the signature of the transactions. It is a combination of: * **recovery\_id** - the position on the curve that is used by ECDSA to generate the keys. * **chain\_id** - the Ethereum Network ID (ex: 1 - Ethereum Mainnet). Was this page helpful? YesNo --- # alchemy_simulateAssetChanges | Alchemy Docs Copy page alchemy\_simulateAssetChanges ============================= POST https://eth-mainnet.g.alchemy.com/v2/{apiKey} Simulates a transaction and returns a list of asset changes. Path Parameters --------------- `apiKey`stringrequireddefaults to `docs-demo` For higher throughput, [create your own API key](https://dashboard.alchemy.com/signup?utm_source=docs&utm_medium=referral&utm_content=data_simulation-apis_transaction-simulation-endpoints_alchemy-simulate-asset-changes) Request ------- `transaction`objectrequired Object describing the transaction to simulate. Show 8 properties Responses --------- ### 200 The asset changes resulting from the transaction simulation. Show 1 properties Was this page helpful? YesNo --- # Choosing a Web3 Network | Alchemy Docs Copy page Choosing a Web3 Network ======================= A detailed guide to choosing which network to deploy on for Ethereum, Layer 2s and Solana. Compares Layer 1 chains vs Layer 2 chains as well as Mainnet vs Testnet environments. Don’t have an API key? Sign up or upgrade your plan for access. [Get started for free](https://dashboard.alchemy.com/signup?utm_source=docs&utm_medium=referral&utm_content=choosing-a-web3-network) Introduction ============ There are many different Web3 networks, each with its own advantages and disadvantages. In this article, we will help you choose the right Web3 network for you. Alchemy currently supports [Ethereum](https://www.alchemy.com/ethereum) , [Polygon](https://www.alchemy.com/polygon) , [Arbitrum](https://www.alchemy.com/arbitrum) , [Optimism](https://www.alchemy.com/optimism) , [Base](https://www.alchemy.com/base) , [Starknet](https://www.alchemy.com/starknet) , [Astar](https://www.alchemy.com/astar) and [Solana](https://www.alchemy.com/solana) networks. Layer 1 vs. Layer 2 =================== Layer 1 blockchain networks are the foundation of the blockchain ecosystem. They are the most secure and decentralized form of blockchain technology. Layer 2 blockchain networks are built on top of layer 1 blockchain networks and provide additional features and functionality often at the cost of security. Layer 1 Networks supported by Alchemy ------------------------------------- * [**Ethereum**](https://www.alchemy.com/ethereum) : Ethereum is a decentralized platform that runs smart contract applications that run exactly as programmed without any possibility of fraud or third-party interference. * [**Solana**](https://www.alchemy.com/solana) : Solana is a high-performance blockchain network designed to support large-scale decentralized applications. The Solana protocol is optimized for performance, security, and scalability, and can process tens of thousands of transactions per second. Layer 2 Networks supported by Alchemy ------------------------------------- * [**Polygon**](https://www.alchemy.com/polygon) : Polygon is a decentralized network that enables fast and secure transactions of Ethereum-based assets. The network is composed of a group of Ethereum smart contracts that work together to provide a scalable, low-cost solution for transactions. * [**Arbitrum**](https://www.alchemy.com/arbitrum) : Arbitrum is a separate chain built on top of Ethereum as a smart contract that supports faster transaction times, higher throughput, lower gas costs, and many more benefits. Activity and transactions are ultimately relayed to the Layer 1 chain from Arbitrum through [optimistic rollups](https://www.alchemy.com/overviews/optimistic-rollups) . * [**Optimism**](https://www.alchemy.com/optimism) : Optimism is an [Optimistic Rollup](https://www.alchemy.com/overviews/optimistic-rollups) built on top of Ethereum, so it is compatible with all existing Ethereum dapps. In addition, Optimism is designed to be scalable, so it can handle a large number of transactions without compromising security or performance. * **[Base](https://www.alchemy.com/base) **: Base is a secure, low-cost, builder-friendly Ethereum Layer 2 (L2) solution designed to bring the next billion users onchain. * **[Starknet](https://www.alchemy.com/starknet) **: Starknet is a decentralized Validity-Rollup (often referred to as ZK-Rollup). It operates as a Layer 2 network over Ethereum, enabling any app to achieve massive scale without compromising Ethereum's composability and security. * [**Astar**](https://www.alchemy.com/astar) : Astar is a parachain that connects the Polkadot blockchain to all major Layer-1 chains, including Ethereum. * **[Frax](https://www.alchemy.com/blog/account-abstraction-on-zora-and-frax) ** (**Only supported for account abstraction products**): Frax is a modular rollup blockchain based on the Ethereum Virtual Machine, utilizing the OP Stack framework for scalability and efficiency within the Frax ecosystem. * **[Zora](https://www.alchemy.com/blog/account-abstraction-on-zora-and-frax) **(**Only supported for account abstraction products**): The Zora Network is a decentralized, Ethereum-based Layer 2 solution optimized for NFTs and digital media, built on the OP Stack framework to enhance transaction efficiency and cost-effectiveness. * * * Mainnet vs. Testnet =================== Every blockchain (including both Layer 1s and Layer 2s) has a mainnet. The mainnet is the blockchain that actually carries out real-world transactions and events for the public. This is different from a testnet, which is used to test out those transactions and events before putting them into production. You can add a network to a self-custody wallet like Metamask if you know its Chain ID & RPC URL. Now, let's take a look at some of the mainnets & testnets that you can add to your self-custody wallet. * * * Networks & their details ======================== * * * Public RPC Endpoints are good for testing purposes but not good for development or production environments. They are publicly known and often go down, so it's better to [`sign up for a free Alchemy developer account`](https://dashboard.alchemy.com/signup?utm_source=docs&utm_medium=referral&utm_content=choosing-a-web3-network) and get your own API keys to interact with the blockchains. Ethereum -------- ### Ethereum Mainnet * Chain ID: 1 * Currency: ETH * Block Explorer: [https://etherscan.io/](https://etherscan.io/) * RPC URL: [https://eth-mainnet.g.alchemy.com/v2/your-alchemy-api-key](https://eth-mainnet.g.alchemy.com/v2/your-alchemy-api-key) * Public RPC Endpoint: [https://eth-mainnet.g.alchemy.com/v2/demo](https://eth-mainnet.g.alchemy.com/v2/demo) ### Sepolia Testnet * Chain ID: 11155111 * Currency: ETH * Block Explorer: [https://sepolia.etherscan.io](https://sepolia.etherscan.io/) * RPC URL: [https://eth-sepolia.g.alchemy.com/v2/your-alchemy-api-key](https://eth-sepolia.g.alchemy.com/v2/your-alchemy-api-key) * Public RPC Endpoint: [https://eth-sepolia.g.alchemy.com/v2/demo](https://eth-sepolia.g.alchemy.com/v2/demo) * Faucet: [https://sepoliafaucet.com/](https://sepoliafaucet.com/) * * * Polygon ------- ### Polygon Mainnet * Chain ID: 137 * Currency: MATIC * Block Explorer: [https://polygonscan.com/](https://polygonscan.com/) * RPC URL: [https://polygon-mainnet.g.alchemy.com/v2/your-alchemy-api-key](https://polygon-mainnet.g.alchemy.com/v2/your-alchemy-api-key) * Public RPC Endpoint: rpc-mainnet.matic.network ### Polygon Amoy Testnet * Chain ID: 80002 * Currency: MATIC * Block Explorer: [https://www.oklink.com/amoy](https://www.oklink.com/amoy) * RPC URL: [](https://polygon-amoy.g.alchemy.com/v2/your-alchemy-api-key) * Public RPC Endpoint: [https://polygon-mumbai.g.alchemy.com/v2/demo](https://polygon-mumbai.g.alchemy.com/v2/demo) * Faucet: [https://www.alchemy.com/faucets/polygon-amoy](https://www.alchemy.com/faucets/polygon-amoy) * * * Optimism -------- ### Optimism Mainnet * Chain ID: 10 * Currency: ETH * Block Explorer: [https://optimistic.etherscan.io/](https://optimistic.etherscan.io/) * RPC URL: [https://opt-mainnet.g.alchemy.com/v2/your-alchemy-api-key](https://opt-mainnet.g.alchemy.com/v2/your-alchemy-api-key) * Public RPC Endpoint: [https://mainnet.optimism.io/](https://mainnet.optimism.io/) ### Optimism Sepolia Testnet * Chain ID: 11155420 * Currency: ETH * Block Explorer: [https://sepolia-optimistic.etherscan.io/](https://sepolia-optimistic.etherscan.io/) * RPC URL: [https://opt-sepolia.g.alchemy.com/v2/your-alchemy-api-key](https://opt-sepolia.g.alchemy.com/v2/your-alchemy-api-key) * Public RPC Endpoint: [https://sepolia.optimism.io](https://sepolia.optimism.io/) * * * Arbitrum -------- ### Arbitrum Mainnet * Chain ID: 42161 * Currency: ETH * Block Explorer: [https://arbiscan.io/](https://arbiscan.io/) * RPC URL: [https://arb-mainnet.g.alchemy.com/v2/your-alchemy-api-key](https://arb-mainnet.g.alchemy.com/v2/your-alchemy-api-key) * Public RPC Endpoint: [https://arb1.arbitrum.io/rpc](https://arb1.arbitrum.io/rpc) ### Arbitrum Sepolia Testnet * Chain ID: 421614 * Currency: ETH * Block Explorer: [https://sepolia.arbiscan.io/](https://sepolia.arbiscan.io/) * RPC URL: [https://arb-sepolia.g.alchemy.com/v2/your-alchemy-api-key](https://arb-sepolia.g.alchemy.com/v2/your-alchemy-api-key) * Faucet: [https://www.alchemy.com/faucets/arbitrum-sepolia](https://www.alchemy.com/faucets/arbitrum-sepolia) * * * Base ---- ### Base Mainnet * Chain ID: 8453 * Currency: ETH * Block Explorer: [https://basescan.org/](https://basescan.org/) * RPC URL: [](https://arb-mainnet.g.alchemy.com/v2/your-alchemy-api-key) * Public RPC Endpoint: [https://mainnet.base.org/](https://mainnet.base.org/) ### Base Sepolia Testnet * Chain ID: 84532 * Currency: ETH * Block Explorer: [https://base-sepolia.blockscout.com/](https://base-sepolia.blockscout.com/) * RPC URL: [](https://arb-sepolia.g.alchemy.com/v2/your-alchemy-api-key) * Faucet: [https://www.alchemy.com/faucets/base-sepolia](https://www.alchemy.com/faucets/base-sepolia) * * * Starknet -------- ### Starknet Mainnet * Chain ID: SN\_MAIN * Currency: ETH * Block Explorer: [https://starkscan.co/](https://starkscan.co/) * RPC URL: [https://starknet-mainnet.g.alchemy.com/v2/your-alchemy-api-key](https://starknet-mainnet.g.alchemy.com/v2/your-alchemy-api-key) * * * Astar ----- ### Astar Mainnet * Chain ID: 592 * Currency: ETH * Block Explorer: [https://blockscout.com/astar](https://blockscout.com/astar) * RPC URL: [https://astar-mainnet.g.alchemy.com/v2/your-alchemy-api-key](https://astar-mainnet.g.alchemy.com/v2/your-alchemy-api-key) * Public RPC Endpoint: [https://evm.astar.network](https://evm.astar.network/) * * * Frax ---- ### Frax Mainnet * Chain ID: 252 * Currency: frxETH * Block Explorer: [https://fraxscan.com/](https://fraxscan.com/) * RPC URL: [https://frax-mainnet.g.alchemy.com/v2/your-alchemy-api-key](https://frax-mainnet.g.alchemy.com/v2/your-alchemy-api-key) * Public RPC Endpoint: [https://rpc.frax.com/](https://rpc.frax.com/) ### Frax Sepolia Testnet * Chain ID: 2522 * Currency: frxETH * Block Explorer: [https://holesky.fraxscan.com/](https://holesky.fraxscan.com/) * RPC URL: [https://frax-sepolia.g.alchemy.com/v2/your-alchemy-api-key](https://frax-sepolia.g.alchemy.com/v2/your-alchemy-api-key) * Public RPC Endpoint: [https://rpc.testnet.frax.com/](https://rpc.testnet.frax.com/) * * * Zora ---- ### Zora Mainnet * Chain ID: 7777777 * Currency: ETH * Block Explorer: [https://explorer.zora.energy/](https://explorer.zora.energy/) * RPC URL: [https://zora-mainnet.g.alchemy.com/v2/your-alchemy-api-key](https://zora-mainnet.g.alchemy.com/v2/your-alchemy-api-key) * Public RPC Endpoint: [https://rpc.zora.energy/](https://rpc.zora.energy/) ### Zora Sepolia Testnet * Chain ID: 999999999 * Currency: ETH * Block Explorer: [https://sepolia.explorer.zora.energy/](https://sepolia.explorer.zora.energy/) * RPC URL: [https://zora-sepolia.g.alchemy.com/v2/your-alchemy-api-key>](https://zora-sepolia.g.alchemy.com/v2/your-alchemy-api-key) * Public RPC Endpoint: [https://sepolia.rpc.zora.energy/](https://sepolia.rpc.zora.energy/) * * * Solana ------ ### Solana Mainnet In order to configure and use Solana, you will require a Solana wallet like Phantom. Once you set-up your wallet you will be ready to use the Solana Mainnet. ### Solana Devnet In order to configure and use Solana Devnet, you will require a Solana wallet like Phantom. To configure the Solana Devnet, create a new Alchemy app and set the chain to _Solana_ and network to _Devnet_. On the app's dashboard page, click on _Add to Wallet_ to add Devnet to your Phantom wallet. The faucet for Solana devnet is [Solfaucet](https://solfaucet.com/) . * * * Which Ethereum Testnet Should I use? ------------------------------------ We recommend using the [Sepolia Testnet](https://www.alchemy.com/docs/choosing-a-web3-network#sepolia-testnet) as all other testnets on Ethereum are deprecated. Should you need to test ETH, here is our free faucets for [Sepolia](https://sepoliafaucet.com/) (recommended). * * * Was this page helpful? YesNo --- # Custom Webhooks GraphQL Examples | Alchemy Docs Copy page Custom Webhooks GraphQL Examples ================================ List of sample GraphQL queries that Alchemy supports To utilize Alchemy's GraphQL webhook playground, feel free to use Alchemy's handy dashboard tool. To help developers understand the type of queries that Alchemy's Custom Webhooks can support, we've included some key examples that you can run on your own quickly! Feel free to use the Alchemy Notify template carousel to get started with queries that you can build off of. ![](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764179978%2Fdocs%2Fapi-reference%2Fdata%2Fwebhooks%2Fcustom-webhooks-quickstart%2F4f58c4b-Screenshot_2023-04-05_at_4.55.28_AM.png&w=3840&q=75) When testing Alchemy's Custom Webhooks on different networks and chains, make sure you change the block hash and associated log/transaction information to match each blockchain's on-chain data! Ethereum Custom Webhook GraphQL Templates: ------------------------------------------ **Mainnet** * **Action:** Bored Ape NFT Activity * _Get all events emitted by the Bored Ape NFT contract_ { block(hash: "0x4a4d98f90439daaf082642dfbdd0f7b9a36749484582fb3d3e03bd4583da337a") { logs(filter: {addresses: ["0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D"], topics: []}) { transaction { hash index from { address } to { address } maxFeePerGas maxPriorityFeePerGas gasUsed cumulativeGasUsed effectiveGasPrice logs { account { address } topics index } type status } } } } * * * **Action:** USDC Approvals * _Get all Approval() events emitted by the USDC contract_ { block(hash: "0xaaf4228db65eab92357c124ff8f8f1c5da72a04da660e147157cd4dfd8eb44d6") { logs(filter: {addresses: ["0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"], topics: ["0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925"]}) { account { address } topics transaction{ hash index to{ address } from { address } status } } } } * * * **Action:** Staked Aave Reward Claiming Events * _Get all RewardsClaimed() events emitted by the Staked Aave (stkAAVE) contract_ { block(hash: "0xaaf4228db65eab92357c124ff8f8f1c5da72a04da660e147157cd4dfd8eb44d6") { logs(filter: {addresses: ["0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"], topics: ["0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925"]}) { account { address } topics transaction{ hash index to{ address } from { address } status } } } } * * * **Action:** Uniswap Swap Events * _Get all swap() events emitted by a UniswapV3Pool_ { block(hash: "0x2f9586f3656c1daf815289d016d928c22fecc86cf04869f0bd9ae48ca9cc44b4") { logs(filter: {addresses: ["0x367e2d443988e4b222fbfdafdb35eeb7dda9fbb7"], topics: ["0xd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d822"]}) { transaction { hash index from { address } to { address } logs { topics } type status } } } } * * * **Action:** Blur Sale Events * _Get all ordersMatched() events emitted by Blur_ { block(hash: "0x0a945bf7ea18e60e03d9cb4b686c1893218a54fcbd2460bef198cd97a6a0f48c") { logs(filter: {addresses: ["0x000000000000ad05ccc4f10045630fb830b95127"], topics: ["0x61cbb2a3dee0b6064c2e681aadd61677fb4ef319f0b547508d495626f5a62f64"]}) { transaction { hash index from { address } to { address } logs { topics } type status } } } } * * * **Georli** * **Action:** MultiFaucet (Paradigm) NFT Activity * _Get all events emitted by the MultiFaucet (Paradigm) NFT Activity on Georli Testnet_ { block(hash: "0x59f86197e5a57ccc03b6962a3de88c9f526fe162a6a930a0cce0e19c1ad5ec38") { logs(filter: {addresses: ["0xf5de760f2e916647fd766B4AD9E85ff943cE3A2b"], topics: []}) { transaction { hash index from { address } to { address } maxFeePerGas maxPriorityFeePerGas gasUsed cumulativeGasUsed effectiveGasPrice logs { account { address } topics index } type status } } } } * * * **Action:** Uniswap Swap Events * _Get all swap() events emitted by a UniswapV3Pool_ { block(hash: "0x9e9c74005fdd5c51ad7af5e9e014b7aa99196ed98286755b6d17ce3aca95e123") { logs(filter: {addresses: ["0x5371f7ab89fb0837e78245fcdc9acbfd336fdbe1"], topics: ["0xc42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca67"]}) { transaction { hash index from { address } to { address } logs { topics } type status } } } } * * * Polygon PoS Custom Webhook GraphQL Templates: --------------------------------------------- **Mainnet** * **Action:** PlanetIX NFT Activity * _Get all events emitted by the PlanetIX NFT_ { block(hash: "0x081539375332c25a37fc3ac688ebba542363ae815cfa24da1ee585b7660bcff9") { logs(filter: {addresses: ["0xb2435253c71fca27be41206eb2793e44e1df6b6d"], topics: []}) { transaction { hash index from { address } to { address } maxFeePerGas maxPriorityFeePerGas gasUsed cumulativeGasUsed effectiveGasPrice logs { account { address } topics index } type status } } } } * * * **Action:** Uniswap Swap Events * _Get all swap() events emitted by a UniswapV3Pool_ { block(hash: "0x7108c7f0a3b37d0c7b7b467832099b49136f5c75360a5cd8c274eb240c9d32b6") { logs(filter: {addresses: ["0x86f1d8390222A3691C28938eC7404A1661E618e0"], topics: ["0xc42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca67"]}) { transaction { hash index from { address } to { address } maxFeePerGas maxPriorityFeePerGas gasUsed cumulativeGasUsed effectiveGasPrice logs { account { address } topics index } type status } } } } * * * **Mumbai** * **Action:** MultiFaucet (Paradigm) NFT Activity * _Get all events emitted by the MultiFaucet (Paradigm) NFT Activity on Mumbai Testnet_ { block(hash: "0x75a00be4712a9aa165d4b100ed58d1207f43acfc4c1bb22a60ed80e1fab06963") { logs(filter: {addresses: ["0xf5de760f2e916647fd766B4AD9E85ff943cE3A2b"], topics: []}) { transaction { hash index from { address } to { address } maxFeePerGas maxPriorityFeePerGas gasUsed cumulativeGasUsed effectiveGasPrice logs { account { address } topics index } type status } } } } * * * **Action:** Uniswap Swap Events * _Get all swap() events emitted by a UniswapV3Pool_ { block(hash: "0xc8dad078774991e18f1c5af2ad94ea94166528d03cf378473286986b5935fa19") { logs(filter: {addresses: ["0x6B3e06FB1a58a06c2Ce59281cAD545dC282FCb78"], topics: ["0xc42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca67"]}) { transaction { hash index from { address } to { address } maxFeePerGas maxPriorityFeePerGas gasUsed cumulativeGasUsed effectiveGasPrice logs { account { address } topics index } type status } } } } * * * Arbitrum Custom Webhook GraphQL Templates: ------------------------------------------ **Mainnet** * **Action:** Arbitrum Odyssey NFT Activity * _Get all events emitted by Arbitrum Odyssey NFTs_ { block(hash: "0x168e3bef3a51fa21926d67b48d1c395492cf780f7cd44709ff67b1fd1214e085") { logs(filter: {addresses: ["0xfAe39eC09730CA0F14262A636D2d7C5539353752"], topics: []}) { transaction { hash index from { address } to { address } maxFeePerGas maxPriorityFeePerGas gasUsed cumulativeGasUsed effectiveGasPrice logs { account { address } topics index } type status } } } } * * * **Action:** Uniswap Swap Events * _Get all swap() events emitted by a UniswapV3Pool_ { block(hash: "0xa0fde9a9acaaae9df58feb3dfa27f106c6ea88aedceff27536a7793d799df103") { logs(filter: {addresses: ["0x81c48d31365e6b526f6bbadc5c9aafd822134863"], topics: []}) { transaction { hash index from { address } to { address } maxFeePerGas maxPriorityFeePerGas gasUsed cumulativeGasUsed effectiveGasPrice logs { account { address } topics index } type status } } } } * * * **Georli** * **Action:** Gravity SmolBrain Testnet NFT Activity * _Get all events emitted by the Gravity SmolBrain Testnet NFT_ { block(hash: "0x586ee2ba2ce913ee7cb2b442d04d779bb5a52415a5e3a4ddbd4c23e70ffdad62") { logs(filter: {addresses: ["0x9C58e1141171bDe21bCa77A31D6C5D858602Dea0"], topics: []}) { transaction { hash index from { address } to { address } maxFeePerGas maxPriorityFeePerGas gasUsed cumulativeGasUsed effectiveGasPrice logs { account { address } topics index } type status } } } } * * * Optimism Custom Webhook GraphQL Templates: ------------------------------------------ **Mainnet** * **Action:** UNI-V3-POS NFT Activity * _Get all events emitted by the UNI-V3-POS NFT_ { block(hash: "0x91d0c0081254a16aadcffd6fc0ddc31750a3052458119b5982da20410428a40a") { logs(filter: {addresses: ["0xC36442b4a4522E871399CD717aBDD847Ab11FE88"], topics: []}) { transaction { hash index from { address } to { address } maxFeePerGas maxPriorityFeePerGas gasUsed cumulativeGasUsed effectiveGasPrice logs { account { address } topics index } type status } } } } * * * **Action:** Uniswap Swap Events * _Get all swap() events emitted by a UniswapV3Pool_ { block(hash: "0xd8868c0babdf1e5192f355716eafe276bc72f08b9cf8cb413fb5d0928c2bb773") { logs(filter: {addresses: ["0xE592427A0AEce92De3Edee1F18E0157C05861564"], topics: []}) { transaction { hash index from { address } to { address } maxFeePerGas maxPriorityFeePerGas gasUsed cumulativeGasUsed effectiveGasPrice logs { account { address } topics index } type status } } } } * * * **Action:** DAI Approvals * _Get all Approval() events emitted by the DAI contract_ { block(hash: "0x822a3b946263678730fb139066725a681b690736af34dd52d49bd02b476a4b65") { logs(filter: {addresses: ["0xda10009cbd5d07dd0cecc66161fc93d7c9000da1"], topics: ["0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925"]}) { account { address } topics transaction{ hash index to{ address } from { address } status } } } } * * * **Mainnet** * **Action:** MultiFaucet (Paradigm) NFT Activity * _Get all events emitted by the MultiFaucet (Paradigm) NFTs_ { block(hash: "0x6117119d0300075df53350db3962bc297215e43a2083d59db05309b0e28eb625") { logs(filter: {addresses: ["0xf5de760f2e916647fd766B4AD9E85ff943cE3A2b"], topics: []}) { transaction { hash index from { address } to { address } maxFeePerGas maxPriorityFeePerGas gasUsed cumulativeGasUsed effectiveGasPrice logs { account { address } topics index } type status } } } } * * * **Action:** DAI Approvals * _Get all Approval() events emitted by the DAI contract_ { block(hash: "0x550a5408ccc985bbbb143db1f14a4ec6335dae39985bef185476aa9733bd59ce") { logs(filter: {addresses: ["0x8ea903081aa1137F11D51F64A1F372EDe67571a9"], topics: ["0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925"]}) { account { address } topics transaction{ hash index to{ address } from { address } status } } } } * * * Was this page helpful? YesNo --- # How to Handle Checksum Addresses | Alchemy Docs Copy page How to Handle Checksum Addresses ================================ Learn what checksum addresses in Ethereum are, why they exist, and how to handle them using the ethers library. One of the more non-user friendly aspects of working with Ethereum and similar web3 environments is the 40-character hexadecimal string that is used to represent a wallet (or an _account_) on the blockchain. The creators of Ethereum had never envisioned using hexadecimal strings to identify entities on the blockchain. Instead, they had hoped that a system like ENS where user-readable names like _vitalik.eth_ would become the norm. Although ENS names are gaining more popularity and support by the day, the fact remains that a vast majority of users continue to use their hexadecimal addresses to conduct transactions on public blockchains. The complexity of remembering and typing out addresses, as well as the irreversible nature of web3 transactions led to the creation of checksum addresses as a moderate fail safe for human errors. In this short tutorial, we will cover what checksum addresses are, how they work, and how to handle them using the ethers library. What are checksum addresses? ---------------------------- As you may already know, Ethereum addresses are represented as 40-character hexadecimal strings. Checksummed addresses are a special version of Ethereum addresses that add an element of case sensitivity. If you check your wallet address on a wallet like MetaMask, you will see that some letters are capitalized whereas some aren't. This is the checksum validation in play, and certain letters are capitalized in this way to prevent user errors from conducting transactions that cannot be reversed. Computing the checksum of an address is fairly simple. 1. Convert the original Ethereum address into lowercase. 2. Compute the SHA-3 hash of the lowercases address. 3. Take the first 40 characters of the hash (which is a 64-character hexadecimal string) and replace the corresponding characters in the original lowercase address. If a character in the hash is a letter (A-F), then the corresponding character in the address should be uppercase. If a character in the hash is a number (0-9), then the corresponding character in the address should be left as lowercase. 4. The final result is the checksummed version of the address. Handling checksum addresses with ethers --------------------------------------- Fortunately for us, we don't need to perform the aforementioned steps by hand. The ethers library gives us a very convenient function to convert an all-lowercase wallet address into its checksummed version. It also allows us to detect addresses that are invalid checksums. Following is a node script demonstrating both the aforementioned functionalities: Checksum const ethers = require('ethers'); // All lowercase address const address = '0xc361fc33b99f88612257ac8cc2d852a5cee0e217' // Convert to checksum version let checksum = ethers.utils.getAddress(address) console.log("Checksum address:", checksum) // Invalid checksum const invalid = "0xc361fc33b99F88612257ac8cc2D852A5CEe0E217" checksum = ethers.utils.getAddress(invalid); Upon running this script, you should see output that looks like this: Checksum address: 0xc361Fc33b99F88612257ac8cC2d852A5CEe0E217 /Users/rounakbanik/alchemy-tut/nft-collection/node_modules/@ethersproject/logger/lib/index.js:247 throw this.makeError(message, code, params); ^ Error: bad address checksum (argument="address", value="0xc361fc33b99F88612257ac8cc2D852A5CEe0E217", code=INVALID_ARGUMENT, version=address/5.7.0) at Logger.makeError (/Users/rounakbanik/alchemy-tut/nft-collection/node_modules/@ethersproject/logger/lib/index.js:238:21) at Logger.throwError (/Users/rounakbanik/alchemy-tut/nft-collection/node_modules/@ethersproject/logger/lib/index.js:247:20) at Logger.throwArgumentError (/Users/rounakbanik/alchemy-tut/nft-collection/node_modules/@ethersproject/logger/lib/index.js:250:21) at Object.getAddress (/Users/rounakbanik/alchemy-tut/nft-collection/node_modules/@ethersproject/address/lib/index.js:80:20) at Object. (/Users/rounakbanik/alchemy-tut/nft-collection/checksum.js:12:25) at Module._compile (internal/modules/cjs/loader.js:1068:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1097:10) at Module.load (internal/modules/cjs/loader.js:933:32) at Function.Module._load (internal/modules/cjs/loader.js:774:14) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12) { reason: 'bad address checksum', code: 'INVALID_ARGUMENT', argument: 'address', value: '0xc361fc33b99F88612257ac8cc2D852A5CEe0E217' } As expected, ethers was able to give us a checksummed version of an all-lowercase address and correctly identify an address that had an invalid checksum. Conclusion ---------- UX revolving around Ethereum wallets and wallet addresses still leave a lot to desire. Although solutions like ENS are catchup quick, the vast majority of transactions that take place on the blockchain do so using hexadecimal addresses. Although it is strongly suggested that you copy-paste wallet addresses, and never type them by hand, solutions like checksum allow us to have a failsafe that prevents irreversible transactions taking place involving wrongly-typed addresses. Was this page helpful? YesNo --- # Gas Limits | Alchemy Docs Copy page Gas Limits ========== A breakdown of the gas cap limits for eth\_call and eth\_estimateGas on Ethereum, Polygon, Arbitrum, and Optimism. A breakdown of the gas cap limits for `eth_call` and `eth_estimateGas` on Ethereum, Polygon, Arbitrum, and Optimism. **NOTE:** The gas limit specified in the table below applies to individual `eth_call` and `eth_estimateGas` requests on both mainnet and testnets. | Chain | Gas Limit | | --- | --- | | Ethereum | 550 million | | Polygon | 550 million | | Optimism | 550 million | | Arbitrum | 550 million | \*Alchemy has the highest gas limits for any provider, if you're interested in increasing these limits even further, reach out to us at [\[email protected\]](https://www.alchemy.com/cdn-cgi/l/email-protection#0f7c7a7f7f607d7b4f6e636c676a6276216c6062) ! Was this page helpful? YesNo --- # How to Implement Retries | Alchemy Docs Copy page How to Implement Retries ======================== Learn how to implement retries in your code to handle errors and improve application reliability. Introduction ============ Alchemy is a powerful platform that provides developers with advanced blockchain tools, such as APIs, monitoring, and analytics, to build their blockchain applications faster and more efficiently. Alchemy's [Elastic Throughput system](https://www.alchemy.com/docs/reference/throughput) guarantees a given [throughput](https://www.alchemy.com/docs/reference/throughput#what-is-throughput) limit measured in [compute units per second](https://www.alchemy.com/docs/reference/throughput#what-are-compute-units-per-second-cups) , but you may still hit your throughput capacity in some cases. In this tutorial, we will explore how to implement retries to handle [Alchemy 429 errors](https://www.alchemy.com/docs/reference/throughput#error-response) . Option 1: Using Viem ==================== Viem is a modern TypeScript library that automatically handles retry logic for you. To use Viem, follow these steps: 1. Create a new node.js project and Install the modern Web3 libraries using npm or yarn: npm yarn mkdir my-project cd my-project npm install viem 2. Import and configure Viem with your API key and choice of network. javascript import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' // Replace with your Alchemy API Key const apiKey = 'demo'; // Creating a client with built-in retry logic const client = createPublicClient({ chain: mainnet, transport: http(`https://eth-mainnet.g.alchemy.com/v2/${apiKey}`, { retryCount: 3, retryDelay: 1000 // 1 second }) }); 3. Start making requests to the blockchain: javascript // getting the current block number and logging to the console const blockNumber = await client.getBlockNumber(); console.log(blockNumber); 4. Here's the complete code: javascript // Importing Viem for modern Web3 development import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' // Replace with your Alchemy API Key const apiKey = 'demo'; // Creating a client with built-in retry logic const client = createPublicClient({ chain: mainnet, transport: http(`https://eth-mainnet.g.alchemy.com/v2/${apiKey}`, { retryCount: 3, retryDelay: 1000 // 1 second }) }); // getting the current block number and logging to the console const blockNumber = await client.getBlockNumber(); console.log(blockNumber); The modern Web3 libraries automatically handles retries for you, so you don't need to worry about implementing retry logic. Option 2: Exponential Backoff ============================= Exponential backoff is a standard error-handling strategy for network applications. It is a similar solution to retries, however, instead of waiting random intervals, an exponential backoff algorithm retries requests exponentially, increasing the waiting time between retries up to a maximum backoff time. Here is an example of an exponential backoff algorithm: 1. Make a request. 2. If the request fails, wait `1 + random_number_milliseconds` seconds and retry the request. 3. If the request fails, wait `2 + random_number_milliseconds` seconds and retry the request. 4. If the request fails, wait `4 + random_number_milliseconds` seconds and retry the request. 5. And so on, up to a maximum\_backoff time... 6. Continue waiting and retrying up to some maximum number of retries, but do not increase the wait period between retries. Where: * The wait time is `min(((2^n)+random_number_milliseconds), maximum_backoff)`, with `n` incremented by 1 for each iteration (request). * `random_number_milliseconds` is a random number of milliseconds less than or equal to 1000. This helps to avoid cases in which many clients are synchronized by some situation and all retry at once, sending requests in synchronized waves. The value of `random_number_milliseconds` is recalculated after each retry request. * `maximum_backoff` is typically 32 or 64 seconds. The appropriate value depends on the use case. * The client can continue retrying after it has reached the `maximum_backoff` time. Retries after this point do not need to continue increasing backoff time. For example, suppose a client uses a `maximum_backoff` time of 64 seconds. After reaching this value, the client can retry every 64 seconds. At some point, clients should be prevented from retrying indefinitely. To implement exponential backoff in your Alchemy application, you can use a library such as [`retry`](https://www.npmjs.com/package/retry) or [`async-retry`](https://www.npmjs.com/package/async-retry) for handling retries in a more structured and scalable way. Here's an example implementation of exponential backoff using the [`async-retry`](https://www.npmjs.com/package/async-retry) library in a Node.js application where we call the `eth_blockNumber` API using Alchemy: javascript // Setup: npm install [email protected] | npm install async-retry // Import required modules const fetch = require("node-fetch"); const retry = require("async-retry"); // Set your API key const apiKey = "demo"; // Replace with your Alchemy API key // Set the endpoint and request options const url = `https://eth-mainnet.g.alchemy.com/v2/${apiKey}`; const options = { method: "POST", headers: { accept: "application/json", "content-type": "application/json" }, body: JSON.stringify({ id: 1, jsonrpc: "2.0", method: "eth_blockNumber" }), }; // Create a function to fetch with retries const fetchWithRetries = async () => { const result = await retry( async () => { // Make the API request const response = await fetch(url, options); // Parse the response JSON let json = await response.json(); // If we receive a 429 error (Too Many Requests), log an error and retry if (json.error && json.error.code === 429) { console.error("HTTP error 429: Too Many Requests, retrying..."); throw new Error("HTTP error 429: Too Many Requests, retrying..."); } // Otherwise, return the response JSON return json; }, { retries: 5, // Number of retries before giving up factor: 2, // Exponential factor minTimeout: 1000, // Minimum wait time before retrying maxTimeout: 60000, // Maximum wait time before retrying randomize: true, // Randomize the wait time } ); // Return the result return result; }; // Call the fetchWithRetries function and log the result, or any errors fetchWithRetries() .then((json) => console.log(json)) .catch((err) => console.error("error:" + err)); In this example, we define a new function called `fetchWithRetries` that uses the `async-retry` library to retry the fetch request with exponential backoff. The retry function takes two arguments: 1. An async function that performs the fetch request and returns a response object or throws an error. 2. An options object that specifies the retry behavior. We set the number of retries to 5, the exponential factor to 2, and the minimum and maximum wait times to 1 second and 60 seconds, respectively. Finally, we call the `fetchWithRetries` function and log the result or the error to the console. Option 3: Simple Retries ======================== If exponential backoff poses a challenge to you, a simple retry solution is to wait a random interval between 1000 and 1250 milliseconds after receiving a 429 response and sending the request again, up to some maximum number of attempts you are willing to wait. Here's an example implementation of simple retries in a node.js application where we call the `eth_blocknumber` API using Alchemy: javascript // Setup: npm install [email protected] // Import required modules const fetch = require("node-fetch"); // Set your API key const apiKey = "demo"; // Replace with your Alchemy API key // Set the endpoint and request options const url = `https://eth-mainnet.g.alchemy.com/v2/${apiKey}`; const options = { method: "POST", headers: { accept: "application/json", "content-type": "application/json" }, body: JSON.stringify({ id: 1, jsonrpc: "2.0", method: "eth_blockNumber" }), }; const maxRetries = 5; // Maximum number of retries before giving up let retries = 0; // Current number of retries // Create a function to make the request function makeRequest() { fetch(url, options) .then((res) => { if (res.status === 429 && retries < maxRetries) { // If we receive a 429 response, wait for a random amount of time and try again const retryAfter = Math.floor(Math.random() * 251) + 1000; // Generate a random wait time between 1000ms and 1250ms console.log(`Received 429 response, retrying after ${retryAfter} ms`); retries++; setTimeout(() => { makeRequest(); // Try the request again after the wait time has elapsed }, retryAfter); } else if (res.ok) { return res.json(); // If the response is successful, return the JSON data } else { throw new Error(`Received ${res.status} status code`); // If the response is not successful, throw an error } }) .then((json) => console.log(json)) // Log the JSON data if there were no errors .catch((err) => { if (retries < maxRetries) { console.error(`Error: ${err.message}, retrying...`); retries++; makeRequest(); // Try the request again } else { console.error(`Max retries reached, exiting: ${err.message}`); } }); } makeRequest(); // Call the function to make the initial request. * In this example, we define a `maxRetries` constant to limit the number of retries we're willing to wait. We also define a `retries` variable to keep track of how many times we've retried so far. * We then define the `makeRequest()` function, which is responsible for making the API request. We use the `fetch` function to send the request with the specified `url` and options. * We then check the response status: if it's a `429 (Too Many Requests)` response and we haven't reached the `maxRetries` limit, we wait a random interval between 1000 and 1250 milliseconds before calling `makeRequest()` again. Otherwise, if the response is `OK`, we parse the JSON response using `res.json()` and log it to the console. If the response status is anything else, we throw an error. * If an error is caught, we check if we've reached the `maxRetries` limit. If we haven't, we log an error message and call `makeRequest()` again after waiting a random interval between 1000 and 1250 milliseconds. If we have reached the `maxRetries` limit, we log an error message and exit the function. Finally, we call makeRequest() to start the process. Option 4: Retry-After ===================== If you're using HTTP instead of WebSockets, you might come across a 'Retry-After' header in the HTTP response. This header serves as the duration you should wait before initiating a subsequent request. Despite the utility of the 'Retry-After' header, we continue to advise the use of exponential backoff. This is because the 'Retry-After' header only provides a fixed delay duration, while exponential backoff offers a more adaptable delay scheme. By adjusting the delay durations, exponential backoff can effectively prevent a server from being swamped with a high volume of requests in a short time frame. Here's an example implementation of "Retry-After" in a node.js application where we call the `eth_blocknumber` API using Alchemy: go // Setup: npm install [email protected] // Import required modules const fetch = require("node-fetch"); // Set your API key const apiKey = "demo"; // Replace with your Alchemy API key // Set the endpoint and request options const url = `https://eth-mainnet.g.alchemy.com/v2/${apiKey}`; const options = { method: "POST", headers: { accept: "application/json", "content-type": "application/json", }, body: JSON.stringify({ id: 1, jsonrpc: "2.0", method: "eth_blockNumber" }), }; const maxRetries = 5; // maximum number of retries let retries = 0; // number of retries // Create a function to fetch with retries function makeRequest() { fetch(url, options) .then((res) => { if (res.status === 429 && retries < maxRetries) { // check for 429 status code and if max retries not reached const retryAfter = res.headers.get("Retry-After"); // get the value of Retry-After header in the response if (retryAfter) { // if Retry-After header is present const retryAfterMs = parseInt(retryAfter) * 1000; // convert Retry-After value to milliseconds console.log( `Received 429 response, retrying after ${retryAfter} seconds` ); retries++; setTimeout(() => { makeRequest(); // call the same function after the delay specified in Retry-After header }, retryAfterMs); } else { // if Retry-After header is not present const retryAfterMs = Math.floor(Math.random() * 251) + 1000; // generate a random delay between 1 and 250 milliseconds console.log( `Received 429 response, retrying after ${retryAfterMs} ms` ); retries++; setTimeout(() => { makeRequest(); // call the same function after the random delay }, retryAfterMs); } } else if (res.ok) { // if response is successful return res.json(); // parse the response as JSON } else { throw new Error(`Received ${res.status} status code`); // throw an error for any other status code } }) .then((json) => console.log(json)) // log the JSON response .catch((err) => { if (retries < maxRetries) { // if max retries not reached console.error(`Error: ${err.message}, retrying...`); retries++; makeRequest(); // call the same function again } else { // if max retries reached console.error(`Max retries reached, exiting: ${err.message}`); } }); } makeRequest(); // call the makeRequest function to start the retry loop * The code starts by defining the API endpoint URL and the request options. It then sets up a function `makeRequest()` that uses `fetch()` to make a POST request to the API. * If the response status code is `429 (Too Many Requests)`, the code checks for a `Retry-After` header in the response. * If the header is present, the code retries the request after the number of seconds specified in the header. * If the header is not present, the code generates a random retry time between 1 and 250ms and retries the request after that time. * If the response status code is not `429` and is not `OK`, the code throws an error. * If the response is `OK`, the code returns the response JSON. If there is an error, the code catches the error and retries the request if the number of retries is less than the maximum number of retries. * If the number of retries is equal to the maximum number of retries, the code logs an error message and exits. Conclusion ========== In conclusion, retries are an important error-handling strategy for network applications that can help improve application reliability and handle errors. In this tutorial, we discussed 4 ways in which we can implement retries namely: Exponential-Backoff, Retry-After, Simple Retries and modern Web3 libraries. By implementing retries in your Alchemy application, you can help ensure that your application can handle errors and continue to function reliably even in the face of unexpected errors and network disruptions. Was this page helpful? YesNo --- # Add and remove webhook addresses | Alchemy Docs Copy page Add and remove webhook addresses ================================ PATCH https://dashboard.alchemy.com/api/update-webhook-addresses Add or remove addresses from a specific webhook. _This webhook endpoint is idempotent, meaning that identical requests can be made once or several times with the same effect._ Headers ------- `X-Alchemy-Token`stringrequired Alchemy Auth token to use the Notify API. Request Body ------------ Show 3 properties Responses --------- ### 200 Returns empty object. ### 400 Bad Request- The server cannot understand the request. Was this page helpful? YesNo --- # Debugging CORS problems for End-Users | Alchemy Docs Copy page Debugging CORS problems for End-Users ===================================== If your users are experiencing CORS issues here's how to debug them Overview -------- CORS issues happen when the browser does not trust the endpoint that it is trying to reach. In order to allow calls from the browser to the Alchemy endpoint to succeed, we include specific CORS headers in our API response. The problem described here occurs when something about the user's internet, browser, extensions, installed applications, etc hinders the proper interpretation of those headers. * * * Examples -------- Here are some samples of what a CORS problem might look like for your users. Always encourage them to send screenshots or copy-paste snippets of their browser console. ![518](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764192930%2Fdocs%2Ftutorials%2Fgetting-started%2Fdeveloper-best-practices%2F2f99400-Image_from_iOS.jpg&w=3840&q=75 "Image from iOS.jpg") ![1280](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764192930%2Fdocs%2Ftutorials%2Fgetting-started%2Fdeveloper-best-practices%2Fb443aa0-Image_from_iOS_1.jpg&w=3840&q=75 "Image from iOS (1).jpg") * * * Some causes and fixes --------------------- As mentioned above, any hindrance in the request lifecycle before reaching Alchemy servers can cause this problem. Here are a few of the root causes we have identified in the past and how to resolve them: ### The user has an antivirus such as Bitdefender installed [Bitdefender](https://www.bitdefender.com/) , [Brave Shields](https://support.brave.com/hc/en-us/articles/360022973471-What-is-Shields-#:~:text=Shields%20protects%20your%20privacy%20as,track%20from%20site%20to%20site.&text=Shields%20blocks%20this%20type%20of,trackers%20that%20come%20with%20them) , and other antivirus softwares can be installed on the OS or as a browser extension. There are multiple ways that an endpoint can be blocked by an antivirus: * The endpoint may be categorized under "banking", which might have additional restrictions configured in the antivirus settings. * The user may have parental controls restricting their web access. * The endpoint may be on a global blacklist (unlikely). In each of these cases, the resolution is to add the blocked endpoint to the exceptions list, or whitelist of the antivirus. The user may need to add multiple endpoints and potentially a wildcard for the entire [https://alchemy.com](https://alchemy.com/) domains. If adding an exclusion doesn't help, then try **turning off the Bitdefender "protection shield"** altogether. If the antivirus is not Bitdefender, then turn off whichever antivirus the user as installed. ### The user's ISP or router is blocking the website Sometimes an ISP or router will block a site based on DNS. First, ask the user to navigate directly to [https://www.alchemy.com/](https://www.alchemy.com/) and [https://www.alchemyapi.com](https://www.alchemyapi.com/) . If they are unable to access the websites then they might be getting DNS blocked. To confirm this is the case, switch the user to a VPN and see if they can access the websites and if the CORS issue persists. A longer-term resolution is to recommend an open DNS provider. ### Your application uses a browser extension (unlikely) Google Chrome released [an update](https://www.chromium.org/Home/chromium-security/extension-content-script-fetches) in September 2020 that makes it much more difficult for Chrome extensions to make cross-domain requests. If your application depends on a Chrome extension then this could be the problem. * * * Submitting a persistent problem ------------------------------- If none of the causes and fixes above are helping, then please contact us at [\[email protected\]](https://www.alchemy.com/cdn-cgi/l/email-protection#eb989e9b9b84999fab8a8788838e8692c5888486) or open a ticket in the dashboard. * User's computer manufacturer. * Operating system and version. * What browser they are using and the version of that browser. * Antivirus software installed if any. * If the user navigates directly to [https://www.alchemy.com/](https://www.alchemy.com/) or [https://www.alchemyapi.com](https://www.alchemyapi.com/) do are they able to view the website? * What country is the user located in? * What mitigations the user may have tried so far. * Using a different browser. * Using a different computer. * Using a different internet connection. * Clearing the browser cache. * Restarting the computer. This information is not required, but it will help us get a better handle on the issue. * * * Setting up a CORS proxy ----------------------- If you are experiencing more widespread problems with CORS, e.g. not just with Alchemy, then you might want to set up a CORS proxy. This means all of your end-users will talk directly to your own domain and therefore CORS issues are impossible. Then in your own back-end, you will call Alchemy endpoints and send the responses back to your end-users. This is a more difficult, but also guaranteed longer-term solution to CORS problems. Was this page helpful? YesNo --- # trace_get | Alchemy Docs Copy page trace\_get ========== POST https://eth-mainnet.g.alchemy.com/v2/{apiKey} Returns the trace at a given position for a transaction. Path Parameters --------------- `apiKey`stringrequireddefaults to `docs-demo` For higher throughput, [create your own API key](https://dashboard.alchemy.com/signup?utm_source=docs&utm_medium=referral&utm_content=node_trace-api_trace-api-endpoints_trace-get) Request ------- `transactionHash`string`format: "^0[xX][0-9A-Fa-f]{64}$"`required Transaction hash. `traceIndexes`string\[\]required Array of trace index positions (in hex) to retrieve from the transaction. Responses --------- ### 200 Returns the trace object corresponding to the provided index(es). Show 9 properties Was this page helpful? YesNo --- # Best Practices for Using WebSockets in Web3 | Alchemy Docs Copy page Best Practices for Using WebSockets in Web3 =========================================== How to use websockets when building on Ethereum, Polygon, Optimism, and Arbitrum. What are WebSockets and how do they differ from HTTP requests? -------------------------------------------------------------- WebSockets is a bidirectional communication protocol that maintains a network connection between two parties, typically a server and a client. Unlike HTTP, with WebSockets clients don't need to continuously make requests when they want information. Instead, in an open WebSocket connection, a server can push network updates to clients by allowing them to subscribe to certain network states, such as new transactions or blocks being added to the blockchain. This dramatically improves the efficiency of certain HTTP “push” network requests - instead of making an HTTP request every second to pull the latest data, the client can simply open a WebSocket connection and wait for the updates to arrive. * * * How can I set up a WebSocket connection? ---------------------------------------- It’s quite simple to set up a new WebSocket connection to Ethereum - try the command below in your terminal. shell wscat -c wss://eth-mainnet.g.alchemy.com/v2/demo If you’d like an endpoint with higher rate limits, sign up for a free Alchemy account, grab a new API key to replace the command above, and get access to over 300 million compute units for free per month. In addition to Ethereum, Alchemy currently supports WebSocket connections to these EVM-compatible blockchains: * [Polygon](https://www.alchemy.com/docs/chains/polygon-pos/polygon-po-s-api-endpoints/eth-subscribe) * [Optimism](https://www.alchemy.com/docs/chains/op-mainnet/op-mainnet-api-endpoints/eth-subscribe) * [Arbitrum](https://www.alchemy.com/docs/chains/arbitrum/arbitrum-api-endpoints/eth-subscribe) * [Astar](https://www.alchemy.com/docs/reference/eth-subscribe-astar) * * * How can I make WebSocket subscriptions for Ethereum blockchain updates? ----------------------------------------------------------------------- Once you’ve run the command above, you’ll have an open WebSocket connection to an Ethereum node. To start/stop receiving push updates on certain state changes in the Ethereum network, you’ll need to send one of the following methods: 1. [eth\_subscribe](https://www.alchemy.com/docs/reference/eth-subscribe) 2. [eth\_unsubscribe](https://www.alchemy.com/docs/reference/eth-unsubscribe) These two requests enable blockchain app developers to create and delete subscriptions. By setting their parameters properly, you’ll get push updates whenever new transactions are sent or new blocks are created. Here’s an example of an `eth_subscribe` request: json // initiate websocket stream first wscat -c wss://eth-mainnet.g.alchemy.com/v2/demo // then call subscription {"jsonrpc":"2.0","id": 2, "method": "eth_subscribe", "params": ["alchemy_minedTransactions"] } Using Alchemy’s [Subscription API](https://www.alchemy.com/docs/reference/subscription-api) , there are five main types of WebSocket subscriptions you can make to receive push updates to an Ethereum node: ​ 1. [alchemy\_minedTransactions](https://www.alchemy.com/docs/reference/alchemy-minedtransactions) : Emits full transaction objects or hashes that are mined on the network based on provided filters and block tags. 2. [alchemy\_pendingTransactions](https://www.alchemy.com/docs/reference/alchemy-pendingtransactions) : Emits full transactions that are sent to the network, marked as "pending", and are sent from or to a certain address. A custom Alchemy subscription. 3. [newPendingTransactions](https://www.alchemy.com/docs/reference/newpendingtransactions) ​: Emits transaction hashes that are sent to the network and marked as "pending". ​ 4. [newHeads](https://www.alchemy.com/docs/reference/newheads) : Emits new blocks that are added to the blockchain. 5. ​[logs](https://www.alchemy.com/docs/reference/logs) : Emits logs attached to a new block that match certain topic filters. How can I make WebSocket subscriptions for transaction-specific updates? ------------------------------------------------------------------------ It's no different from initiating a subscription using the base Ethereum websocket API. You can use the exact same commands as the ones introduced above. To start/stop receiving push updates on certain transaction changes (primarily confirmation of a pending transaction and confirmation that it has been fully mined), you’ll need to send either [eth\_subscribe](https://www.alchemy.com/docs/reference/eth-subscribe) or [eth\_unsubscribe](https://www.alchemy.com/docs/reference/eth-unsubscribe) . Here’s an example of an `eth_subscribe` request for transaction-specific data: NOTE: You can be very expressive with your transaction-specific data subscriptions and can either have unfiltered or highly filtered parameters json // initiate websocket stream first wscat -c wss://eth-mainnet.g.alchemy.com/v2/demo // then call subscription { "jsonrpc": "2.0", "method": "eth_subscribe", "params": [\ "alchemy_minedTransactions",\ {\ "addresses": [\ {\ "to": "0x9f3ce0ad29b767d809642a53c2bccc9a130659d7",\ "from": "0x228f108fd09450d083bb33fe0cc50ae449bc7e11"\ },\ {\ "to": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"\ }\ ],\ "includeRemoved": false,\ "hashesOnly": true\ }\ ], "id": 1 } * * * Reasons to Use HTTPS instead of WebSockets for JSON-RPC Node Requests --------------------------------------------------------------------- In general, the best practice that we recommend is that developers don’t send standard Ethereum JSON-RPC requests over WebSockets, and instead use HTTP(S) requests. Sending JSON-RPC requests over WebSockets may become unsupported in the future. This is for four main reasons: * Silent failures * Load balancing * Retries HTTP * Status codes * gZip compression 1\. Silent failures ------------------- WebSockets client-side handling has many tricky edge cases and silent failure modes, which can make web3 dApp less stable. 2\. Load balancing ------------------ When making requests to distributed systems such as Alchemy, individual HTTP requests are load-balanced to the fastest possible server. When developers open a WebSocket connection, they incur additional latency by sending JSON-RPC requests only to a single node rather than the most available resource. 3\. Retries ----------- In most common request frameworks, support for retrying failed HTTP requests comes automatically and can be configured easily. Conversely, in WebSockets retrying failed requests typically requires custom JSON-RPC id-based tracking. 4\. HTTP status codes --------------------- When web3 developers use WebSockets they won't receive HTTP status codes in WebSockets responses, which can be useful for debugging or sorting responses. 5\. gZip Compression -------------------- To provide users with better product experiences, we updated our infrastructure serving HTTP requests to offer Alchemy developers **support for gzip compression on all responses larger than 1kb in size**. In practice, we’ve seen roughly a **75% improvement in the total latency of typical JSON-RPC replayTransaction calls**. Go to this article to learn how to implement gZip compression: [![How to Enable Compression to Speed Up JSON-RPC Blockchain Requests](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764180090%2Fdocs%2Fapi-reference%2Fwebsockets%2F62db7ae-Screen_Shot_2022-06-24_at_12.46.25_PM.png&w=3840&q=75)](https://www.alchemy.com/docs/how-to-enable-compression-to-speed-up-json-rpc-blockchain-requests) [![alchemy.com/docs](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764180091%2Fdocs%2Fapi-reference%2Fwebsockets%2F0c06bc6-small-alchemy-circle-logo.png&w=3840&q=75)alchemy.com/docs](https://www.alchemy.com/docs/how-to-enable-compression-to-speed-up-json-rpc-blockchain-requests) [How to Enable Compression to Speed Up JSON-RPC Blockchain Requests](https://www.alchemy.com/docs/how-to-enable-compression-to-speed-up-json-rpc-blockchain-requests) * * * Conclusion ---------- If you’re interested in getting pushed updates on the state of the Ethereum network and avoiding HTTP workaround strategies such as [long polling](https://www.educative.io/edpresso/what-is-http-long-polling) , start using [WebSockets today](https://www.alchemy.com/docs/reference/subscription-api) to streamline your request workflow! Was this page helpful? YesNo --- # Best Practices | Alchemy Docs Copy page Best Practices ============== Best Practices ============== This guide covers essential patterns and best practices for building robust, production-ready applications with Yellowstone gRPC. Getting Started --------------- ### Start Simple Begin with slot subscriptions before moving to more complex filters. Slots are lightweight and help you understand the streaming model. ### Use Filters Wisely Only subscribe to the data you need to reduce bandwidth and processing overhead. **Pro tip:** Vote transactions make up about 70% of all Solana transactions. Filter them out with `vote: Some(false)` to significantly reduce bandwidth if you don't need them. SubscribeRequestFilterTransactions { vote: Some(false), // Exclude ~70% of transactions failed: Some(false), // Exclude failed transactions ..Default::default() } Connection Management --------------------- ### Implement Automatic Reconnection Network issues happen - implement automatic reconnection logic to ensure your application stays resilient. Use exponential backoff to avoid hammering the server. ### Handle Ping/Pong Messages Yellowstone gRPC servers send ping messages to check if clients are alive. Always respond with pong, otherwise the server may close your connection. if matches!(update.update_oneof, Some(UpdateOneof::Ping(_))) { subscribe_tx.send(SubscribeRequest { ping: Some(SubscribeRequestPing { id: 1 }), ..Default::default() }).await?; } ### Implement Gap Recovery Use `from_slot` to recover from disconnections without missing data. This may result in duplicate updates, but ensures no data loss. subscribe_request.from_slot = if tracked_slot > 0 { Some(tracked_slot) // can subtract 32 slots to avoid blockchain reorgs } else { None }; Architecture Patterns --------------------- ### Separate Ingress and Processing Use channels to decouple data ingestion from processing: let (tx, rx) = mpsc::channel::(10000); // Ingress task: receives data from gRPC tokio::spawn(async move { while let Some(Ok(update)) = stream.next().await { tx.send(update).await.ok(); } }); // Processing task: handles business logic tokio::spawn(async move { while let Some(update) = rx.recv().await { process_update(update).await; } }); **Benefits:** * Prevents slow processing from blocking ingestion * Enables parallel processing of updates * Provides natural backpressure mechanism ### Use Bounded Channels with Backpressure Choose channel capacity based on your processing speed and tolerance for data loss: * **Smaller capacity** (1K-10K): Lower memory usage, faster recovery from slow processing -- higher chance of dropping updates * **Larger capacity** (50K-100K): Better handling of processing spikes, more memory usage Performance Optimization ------------------------ ### Monitor Processing Latency Track the time between receiving updates and processing them. Log warnings if latency exceeds your thresholds. ### Batch Database Writes Instead of writing every update individually, batch them for better throughput. Flush when batch size reaches a threshold (e.g., 1000 updates) or after a time interval (e.g., 1 second). ### Use Async Processing for I/O Leverage async/await for concurrent processing of updates when doing I/O operations. ### Optimize Memory Usage For high-throughput scenarios, reuse subscription requests instead of creating new hashmaps on every send. ### Offload Compute Intensive Work If processing task is too compute intensive, consider leveraging the async processing capabilities of the tokio runtime to offload the work to a separate / multiple threads. Error Handling -------------- ### Distinguish Error Types Handle different error types appropriately: * **Stream errors**: Network or protocol errors - reconnect immediately * **Processing errors**: Log and continue or implement dead letter queue * **Channel errors**: Handle full channels (drop or block) and closed channels (exit gracefully) ### Implement Exponential Backoff Start with short delays (100ms) and double on each failure up to a maximum (e.g., 60 seconds). Reset backoff on successful connection. ### Log Dropped Updates Monitor when updates are dropped due to slow processing. Track metrics to understand system health. Data Management --------------- ### Handle Duplicate Updates When using `from_slot` for gap recovery, you may receive duplicate updates. Use a time-bounded cache or database unique constraints to handle duplicates efficiently. ### Choose Appropriate Commitment Levels * **Processed**: Real-time dashboards, exploratory data analysis (fastest, may see rolled back data) * **Confirmed**: Most production applications, indexers (good balance of speed and finality) * **Finalized**: Financial applications requiring absolute certainty (slower, guaranteed finality) Testing and Debugging --------------------- ### Test Reconnection Logic Simulate connection failures to verify your reconnection logic works as expected. Test with different failure scenarios. ### Add Structured Logging Use structured logging (e.g., `tracing` crate) to debug subscription issues. Log key events like reconnections, slot tracking, and subscription updates. ### Monitor Stream Health Track metrics like: * Updates received per second * Time since last update * Reconnection count * Processing latency * Dropped updates Alert if the stream appears stalled (e.g., no updates for 30+ seconds). Dynamic Subscription Management ------------------------------- You can update subscriptions at runtime using the bidirectional stream without reconnecting. This is useful for: * Hot-swapping filters based on user actions * Progressive subscription expansion Production Checklist -------------------- Before deploying to production, ensure you have: * ✅ Automatic reconnection with exponential backoff * ✅ Gap recovery using `from_slot` * ✅ Ping/pong handling * ✅ Separate ingress and processing tasks * ✅ Bounded channels with backpressure handling * ✅ Error logging and monitoring * ✅ Processing latency tracking * ✅ Graceful shutdown handling * ✅ Duplicate update handling * ✅ Filter optimization to reduce bandwidth * ✅ Database write batching (if applicable) * ✅ Health check endpoints * ✅ Metrics and alerting Additional Resources -------------------- * [Quickstart Guide](https://www.alchemy.com/docs/reference/yellowstone-grpc-quickstart) - Get started quickly * [Code Examples](https://www.alchemy.com/docs/reference/yellowstone-grpc-examples) - See complete working examples including a full production-grade client * [API Reference](https://www.alchemy.com/docs/reference/yellowstone-grpc-api-overview) - Detailed API documentation Was this page helpful? YesNo --- # Understanding Transactions | Alchemy Docs Copy page Understanding Transactions ========================== Articles about transactions Introduction ============ In this section, you will find a wealth of information and resources for understanding and working with transactions on the blockchain. Transactions are the fundamental building blocks of the blockchain, and are used to transfer value, store data, and execute smart contracts. Articles ======== The following articles are listed under this section: * [Ethereum Transactions - Pending, Mined, Dropped & Replaced](https://www.alchemy.com/docs/ethereum-transactions-pending-mined-dropped-replaced) * [How to Query Transaction Details on Ethereum](https://www.alchemy.com/docs/how-to-get-transaction-details) * [Understanding the Transaction Object on Ethereum](https://www.alchemy.com/docs/understanding-the-transaction-object-on-ethereum) * [What are Internal Transactions?](https://www.alchemy.com/docs/what-are-internal-transactions) Was this page helpful? YesNo --- # alchemy_simulateAssetChangesBundle | Alchemy Docs Copy page alchemy\_simulateAssetChangesBundle =================================== POST https://eth-mainnet.g.alchemy.com/v2/{apiKey} Simulates multiple transactions sequentially and returns a combined list of asset changes. Path Parameters --------------- `apiKey`stringrequireddefaults to `docs-demo` For higher throughput, [create your own API key](https://dashboard.alchemy.com/signup?utm_source=docs&utm_medium=referral&utm_content=data_simulation-apis_transaction-simulation-endpoints_alchemy-simulate-asset-changes-bundle) Request ------- `transactions`object\[\]required An array of 1–2 transaction objects to run in sequence. Show 3 properties Responses --------- ### 200 The asset changes resulting from the sequential simulation. Show 1 properties Was this page helpful? YesNo --- # trace_call | Alchemy Docs Copy page trace\_call =========== POST https://eth-mainnet.g.alchemy.com/v2/{apiKey} Executes a call and returns one or more possible traces. Path Parameters --------------- `apiKey`stringrequireddefaults to `docs-demo` For higher throughput, [create your own API key](https://dashboard.alchemy.com/signup?utm_source=docs&utm_medium=referral&utm_content=node_trace-api_trace-api-endpoints_trace-call) Request ------- `transaction`objectrequired Transaction call object. Contains call parameters such as "from", "to", "gas", "gasPrice", "value", and "data". Show 6 properties `traceTypes`enum\[\]required Array of trace types to return. Valid values include "trace" and "stateDiff". `blockIdentifier`stringoptional Optional block identifier (block number in hex, block hash, or tag like "latest"). Responses --------- ### 200 Returns the trace result for the given call. Show 4 properties Was this page helpful? YesNo --- # alchemy_simulateExecution | Alchemy Docs Copy page alchemy\_simulateExecution ========================== POST https://eth-mainnet.g.alchemy.com/v2/{apiKey} Simulates a single transaction's execution and returns decoded traces/logs. Path Parameters --------------- `apiKey`stringrequireddefaults to `docs-demo` For higher throughput, [create your own API key](https://dashboard.alchemy.com/signup?utm_source=docs&utm_medium=referral&utm_content=data_simulation-apis_transaction-simulation-endpoints_alchemy-simulate-execution) Request ------- `format`enumrequired Specifies whether to return a 'NESTED' or 'FLAT' call structure. Allowed values:NESTEDFLAT `transaction`objectrequired Transaction object to simulate. Show 7 properties `blockTag`enumrequired The block context to use: 'latest', 'safe', 'finalized', or 'earliest'. Allowed values:latestsafefinalizedearliest Responses --------- ### 200 The decoded execution traces and logs produced by simulating the transaction. Show 4 properties Was this page helpful? YesNo --- # How to set usage limits for your account | Alchemy Docs Copy page How to set usage limits for your account ======================================== Learn to manage your Alchemy account wisely by setting usage limits ensuring you never overspend. Managing your Alchemy account wisely is essential to avoid any unexpected costs and to keep your usage in check. With the ability to set limits, you can have peace of mind knowing that you won't accidently overspend. In this guide, we'll walk you through the steps to set usage limits for your Alchemy account. * * * ### 1\. Accessing the Alchemy Dashboard **Step 1:** Open your preferred web browser and navigate to the [Alchemy Dashboard](https://dashboard.alchemy.com/signup?utm_source=docs&utm_medium=referral&utm_content=how-to-set-usage-limits-and-alerts-for-your-account) . ![](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764180233%2Fdocs%2Ftutorials%2Fgetting-started%2Fdeveloper-best-practices%2Fe33c696-image.png&w=3840&q=75) * * * ### 2\. Navigate to the billing section **Step 2:** Once you're on the dashboard, select the "Billing" option under the "Admin" section on the left navigation bar. ![](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764180234%2Fdocs%2Ftutorials%2Fgetting-started%2Fdeveloper-best-practices%2Fe409d00-image.png&w=3840&q=75) * * * ### 3\. Configure auto-scale options **Step 3:** Here you will find an option to activate/deactivate auto-scale and set a max auto-scaling spend limit in dollars or in CUs. ![](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764180235%2Fdocs%2Ftutorials%2Fgetting-started%2Fdeveloper-best-practices%2F24b6259-image.png&w=3840&q=75) Here's a breakdown of the options available: * **Auto-scaling**: This feature allows for unlimited on-demand API access after your prepaid amount is utilized. This is particularly useful if you have varying API needs that might exceed your prepaid amount. If this is not active, your API access will be turned off once your prepaid amount is reached. * **Max auto-scaling spend limit**: This is an optional spend limit when auto-scaling is activated. By setting this limit, your service will automatically stop once this amount is reached, ensuring you don't incur unexpected costs. You can set this limit either in Dollars or Compute Units (CUs).. * * * ### 4\. Setting your preferences **Step 4:** Configure the auto-scale options based on your requirements and you're all set! Check out our guide on setting up [Dashboard Alerts](https://www.alchemy.com/docs/dashboard-alerts) ! * * * Managing your Alchemy account wisely is important for both cost management and efficient usage. By setting appropriate limits, you can ensure that your projects run smoothly without any unexpected costs. Regularly review and adjust these settings as your needs evolve over time. Was this page helpful? YesNo --- # trace_block | Alchemy Docs Copy page trace\_block ============ POST https://eth-mainnet.g.alchemy.com/v2/{apiKey} Returns traces created at a given block. Path Parameters --------------- `apiKey`stringrequireddefaults to `docs-demo` For higher throughput, [create your own API key](https://dashboard.alchemy.com/signup?utm_source=docs&utm_medium=referral&utm_content=node_trace-api_trace-api-endpoints_trace-block) Request ------- `blockIdentifier`stringrequireddefaults to `latest` Block identifier as a hex string block number or one of the tags: "earliest", "latest", "pending", "safe", or "finalized". Responses --------- ### 200 An object containing block trace details. Show 4 properties Was this page helpful? YesNo --- # Error Reference | Alchemy Docs Copy page Error Reference =============== Learn about the standard JSON-RPC error codes and Alchemy's custom error codes. Identifying an Error Request ============================ When using Alchemy (and in general, web3 development), to understand if your JSON-RPC request was successful or encountered an error, follow these steps: 1. Check the **HTTP Status Code** of the response: * If the status code is **not** within the `2xx` range, the request failed. * If the status code is within the `2xx` range, proceed to the next step. 2. Check the **error field** in the JSON response body: * If an `error` field is present, the request encountered an error. * If no `error` field is present, the request was successful. Here are examples of how HTTP responses may look: * **Success** (HTTP status is `2xx` and no error field in the response): json {"jsonrpc":"2.0","id":0,"result":"0x127776c"} * **Failed** (HTTP status is `2xx` but the error field is populated): json {"jsonrpc":"2.0","error":{"code":-32002,"message":"Transaction simulation failed"}} Understanding these responses is important for accurately determining the outcome of your requests. HTTP Status Codes ================= HTTP Status codes are standardized numeric codes that are returned by our servers in response to a client's HTTP requests. In general, there are 3 categories of HTTP codes that you might encounter when using Alchemy: `2xx` , `4xx`, and `5xx`. HTTP error response can have any combination of JSON-RPC error codes (even for `2xx` responses). Below are example HTTP error codes and potential solutions. `200` HTTP response indicates that we were able to receive and respond to the request successfully, but there may have been issues actually executing that request on the nodes or on-chain. For example, if you send an `eth_call` request and the gas is too low, you’d get back a `200` HTTP response but a `3` JSON-RPC error code and an error message indicating `execution reverted` since gas is too low. | Category | HTTP Code | Example JSON-RPC Codes | Example Error Message | Meaning | Example Solution | | --- | --- | --- | --- | --- | --- | | `2xx` | `200` | Any | \- `execution reverted` - `err: intrinsic gas too low (supplied gas 50000000)` - `filter not found` - `already known` | **Success**: the request was received by the client and returned successfully by the server, however, the request may have encountered issues while being processed on chain. | Verify that your request is valid. | | `4xx` | | | | **Client Error**: the client had an issue when sending the request | | | | `400` | `-32700`, `-32602`, `-32600`, `-32521`, `-32500` | \- `Unsupported method` - `Invalid argument` - `Parse error` | **Bad Request**: The request is invalid (e.g incorrect format) | Verify your request body and format is correct. | | | `401` | `-32600` | \- `Must be authenticated!` - `Invalid access key` | **Unauthorized**: You must authenticate your request with an API key. Check out how to [create an Alchemy key](https://www.alchemy.com/docs/alchemy-quickstart-guide#1key-create-an-alchemy-key)
if you do not have one. | Create a new API key | | | `403` | `-32600` | \- `Monthly capacity limit exceeded.` - `App is inactive.` - `Origin not on whitelist.` | **Forbidden**: the server has received the request successfully, but is intentionally refusing to process it due to some missing criteria. | \- Upgrade tiers to increase capacity - Create a new API key - Update allowlist to permit request origin. | | | `413` | | \- `Content Too Large` - `Payload Too Large` | **Request Entity Too Large**: The request payload exceeded the maximum size limit of 2,600,000 bytes (~2.48 MB uncompressed). This applies across all HTTP and WebSocket requests. | Ensure your request body is smaller than 2,600,000 bytes (~2.48 MB). Split large requests into smaller chunks if necessary. | | | `429` | `429` | \- `Your app has exceeded its compute units per second capacity.` | **Too Many Requests**: You've exceeded your concurrent requests capacity or [compute units](https://www.alchemy.com/docs/reference/compute-units)
per second capacity. Check out the [throughput](https://www.alchemy.com/docs/reference/throughput)
page for solutions. | \- Upgrade to increase throughput - Implement [automatic retries](https://www.alchemy.com/docs/how-to-implement-retries) | | `5xx` | | | | **Server Error**: there was an error processing the request on the server side. | Check out the [status page](https://status.alchemy.com/)
for the latest updates. | | | `500` | `-3200` `-32603` | \- `Unable to complete request at this time.` - `Block not processed yet. Please try again.` - `internal server error` | **Server error**: unable to complete the request due to server issues or due to the block not being processed yet | \- See the [status page](https://status.alchemy.com/)
for latest updates - Ensure the requested block is valid, then retry | | | `503` | `-3200` | `Unable to complete request at this time.` | **Server error**: unable to complete the request due to server issues | \- See the [status page](https://status.alchemy.com/)
for latest updates | JSON-RPC Error Codes ==================== For JSON-RPC specific errors, you may receive any of the above HTTP Error codes in addition to the JSON RPC error codes specified below. Error codes range from `-32768` to `-32000`, any code in this range but not defined explicitly is reserved for future use or application-specific errors. For more info on how these are defined check out the [JSON-RPC Error specification docs](https://www.jsonrpc.org/specification#error_object) . | Code | Example Error Message | Meaning | | --- | --- | --- | | `-32700` | `Parse error` | **Parse error**: Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text. | | `-32600` | \- `Must be authenticated!` - `Invalid access key` | **Invalid Request**: The JSON sent is not a valid Request object. | | `-32601` | `Unsupported method: .` | **Method not found**: The method does not exist / is not available. | | `-32602` | `invalid argument:` | **Invalid params**: Invalid method parameter(s). | | `-32603` | `internal server error` | **Internal error**: Internal JSON-RPC error. | | `-32000` to `-32099` | `Unable to complete request at this time.` | **Server error**: Reserved for implementation-defined server-errors. | | Anything from`-32099` to `-32599` **or** `-32603` to `-32699` **or** `-32701` to `-32768` | \- `-32500` :`AA20 account not deployed`, `AA25 invalid account nonce` - `-32501`: `COLLECT_LIMIT_EXCEEDED` , `user operation's call reverted: 0x` | **Any**: Application-defined error or other. | | `3` | `execution reverted` | Generally used for `eth_call`, `eth_estimateGas`, `alchemy_getTokenBalances`. The `data` field in the error response will have more details on the root cause. | | `20` to `63` | `Starknet specific errors` | Errors related to Starknet methods. See [https://docs.starkware.co/starkex/api/spot/error\_codes.htmlfor](https://docs.starkware.co/starkex/api/spot/error_codes.htmlfor)
more details. | Error Messages ============== Below are a few common error messages and how to solve them. | Error Message | Meaning | Solution | | --- | --- | --- | | `already known` | This generally means the transaction already posted and is on the node in a pending state. Sometimes this error occurs when transactions fail at first but are retried when the node already knows of them | Check if you’ve already sent a transaction with the same nonce. | | `Unspecified origin not on whitelist` | Whoever is making the request is not on the allowlist for your API key. | Safely ignore the request or update your app’s allowlist to include the new request origin | | `filter not found` | Filters expire after 5 minutes of inactivity so if it's not found the filter likely expired. | Create a new filter. | | `Request timed out. Client should retry.` | Gateway timeouts (usually from nodes). | Retry the request. | | `transaction underpriced` | Transaction was sent with too low gas. | Retry the transaction with higher gas. | Common Errors ============= How to Solve ENOTFOUND getAddrInfo Errors ----------------------------------------- **ENOTFOUND getAddrInfo** error is a common issue encountered by developers when trying to make network requests to a specific URL that might not exist any longer. To resolve this issue, you need to update the URL from `eth-mainnet.alchemy.io` to `eth-mainnet.g.alchemy.com`. Open your application where you are making requests to the old URL and replace it with the new one. **Before**: JavaScript `const apiUrl = ';` **After**: JavaScript `const apiUrl = ';` Save the changes you made to your application and run it again. The ENOTFOUND getAddrInfo error should no longer occur since you are now using the updated URL. To confirm that the error has been resolved, check your application's output or script, and you should see successful network requests to the new URL without any ENOTFOUND errors. How to solve `ECONNRESET` errors? --------------------------------- `ECONNRESET` errors occur when a TCP connection cannot be established at that time. If you experience `ECONNRESET` errors, please ensure that your client isn not creating a scenario where new connections are unable to be created. Historically, we have only seen client-side issues causing these errors (if the server were rejecting requests indiscriminately, then it would obviously effect multiple clients simultaneously which has never been the case). If you’re hitting a generic `EPROTO` error message, it’s possible you’re facing similar issues. Here are some guidelines to limit client side issues: 1. If you’re using AWS, a NAT gateway can support up to [55,000](https://docs.aws.amazon.com/vpc/latest/userguide/nat-gateway-troubleshooting.html)  simultaneous connections (or approximately 900 connections per second/55,000 connections per minute). Ensure your rate of opening new connections falls within the threshold! 1. If in AWS, check NAT Gateway for port ErrorPortAllocation errors ([guide](https://repost.aws/knowledge-center/vpc-resolve-port-allocation-errors) ) 2. If not in AWS, check to make sure source ports aren’t exhausted 2. For Java, consider implementing a [connection pools](https://www.baeldung.com/httpclient-connection-management) . 3. For node.js, consider using [options.keepAlive](https://nodejs.org/api/http.html#http_new_agent_options)  to keep the TCP connection alive! 4. Consider enabling HTTP Pipeline (in which you can send more than one request per TCP connection) 5. Ensure systems outside of your production environment are are also not creating too many requests! If you have any questions or feedback, please contact us at [\[email protected\]](https://www.alchemy.com/cdn-cgi/l/email-protection#ccbfb9bcbca3beb88cada0afa4a9a1b5e2afa3a1) or open a ticket in the dashboard. How we define “successful” vs. “failed” requests in the dashboard ================================================================= The dashboard includes various charts that indicate the number of successful or failed request across your applications. A few examples of these include: [Daily Request Health Pie on the Homepage](https://dashboard.alchemy.com/signup?utm_source=docs&utm_medium=referral&utm_content=reference_error-reference) ![](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764180088%2Fdocs%2Fapi-reference%2Fpricing-resources%2Fresources%2Fd4a292c-Untitled.png&w=3840&q=75) [Request Health Chart on the Homepage](https://dashboard.alchemy.com/signup?utm_source=docs&utm_medium=referral&utm_content=reference_error-reference) ![](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764180089%2Fdocs%2Fapi-reference%2Fpricing-resources%2Fresources%2F52e9aab-https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764180164%2Fdocs%2Ftutorials%2Falchemy-university%2Fethereum-basics%2FUntitled_1.png&w=3840&q=75) Several other pages including apps list, app details, logs, and more. The definitions used for “success” and “failure” throughout the dashboard are the following: * **Success:** HTTP status code is `2xx` **and** the `response.error` field is empty (null). * **Failure:** Any condition that does not meet the success criteria. These definitions ensure a straightforward approach to interpreting dashboard metrics and aligns with the actual HTTP responses you receive. Was this page helpful? YesNo --- # trace_call vs debug_traceCall | Alchemy Docs Copy page trace\_call vs debug\_traceCall =============================== The differences between the trace\_call method by OpenEthereum and the debug\_traceCall method by Geth Introduction ============ Geth and OpenEthereum are two popular Ethereum clients. In this article, we'll compare and contrast the [trace\_call](https://www.alchemy.com/docs/reference/trace-call) method offered by OpenEthereum with the [debug\_traceCall](https://www.alchemy.com/docs/reference/debug-tracecall) method offered by Geth. Both of these methods are used for transaction tracing. The `trace_call` method was initially supported by the OpenEthereum client but now OpenEthereum has been deprecated and a new client Erigon is supporting the trace methods. Going forward, we will only use the name of the Erigon Ethereum client when associating with the trace methods. Prerequisites ============= Before reading this article you should know about [Ethereum Clients](https://www.alchemy.com/overviews/execution-layer-and-consensus-layer-node-clients) and [EVM Traces](https://www.alchemy.com/docs/reference/what-are-evm-traces) . The trace\_call method ====================== The [trace\_call](https://www.alchemy.com/docs/reference/trace-call) method executes the given call (transaction) and returns a number of possible traces for it. It’s helpful for debugging transactions and analyzing state changes due to a transaction. Under the hood,[trace\_call](https://www.alchemy.com/docs/reference/trace-call) is only supported by OpenEthereum or Erigon clients, but if you’re using an Alchemy API key we’ll automatically route the request for you so you don’t have to worry about the node client. Here are the parameters and response payloads for `trace_call` Parameters ---------- 1. `Object` - Call options. * `from`: `Address` - (optional) - The address the transaction is sent from. * `to`: `Address` - (optional when creating a new contract) - The address the transaction is directed to. * `gas`: `Quantity` - (optional) Integer formatted as a hex string that represents the gas provided for the transaction execution. * `gasPrice`: `Quantity` - (optional) Integer formatted as a hex string that represents the gas price used for each paid gas. * `value`: `Quantity` - (optional) Integer formatted as a hex string that represents the value sent with the given transaction. * `data`: `Data` - (optional) 4-byte hash of the method signature followed by encoded parameters. This basically represents which function to call in the smart contract along with the function parameters, if it’s just a value transfer then this field can be empty. 2. `Array` - Type of trace, one or more of: `"vmTrace"`, `"trace"`, `"stateDiff"`. 1. `trace`: Returns the basic trace for the given transaction. 2. `stateDiff`: Provides information detailing all altered portions of the Ethereum state made due to the execution of the transaction. 3. `vmTrace`: Provides a full trace of the Ethereum state throughout the execution of the transaction, including for any subcalls. `vmTrace` is no longer supported by Alchemy. 3. `Quantity` or `Tag` - (optional) Integer formatted as a hex string that represents a block number, or the string `'earliest'` or `'latest'`. If this parameter is supplied, the transaction is replayed in the context of the given parameter. 1. `latest`: The latest block that the client has observed. 2. `earliest`: The lowest number block that the client has available. Intuitively, you can think of this as the first block created. Example Request and Response ---------------------------- The `trace_call` method returns an array of traces. The structure of these traces is explained in [Types of Trace Actions and their Structure](https://www.alchemy.com/docs/reference/what-are-evm-traces#types-of-trace-actions) . Below you can find an example. ### Request cURL ethers web3py curl https://eth-mainnet.g.alchemy.com/v2/demo \ -X POST \ -H "Content-Type: application/json" \ -d '{"method":"trace_call", "params":[{\ "from": "0x6f1FB6EFDf50F34bFA3F2bC0E5576EdD71631638",\ "to": "0x6b175474e89094c44da98b954eedeac495271d0f",\ "value": "0x0",\ "data": "0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE"},\ ["trace"]], "id":1, "jsonrpc":"2.0"}]' ### Response trace\_call { "output": "0x0000000000000000000000000000000000000000000000000858898f93629000", "stateDiff": null, "trace": [\ {\ "action": {\ "from": "0x0000000000000000000000000000000000000000",\ "callType": "call",\ "gas": "0x1dcd1148",\ "input": "0x70a082310000000000000000000000006e0d01a76c3cf4288372a29124a26d4353ee51be",\ "to": "0x6b175474e89094c44da98b954eedeac495271d0f",\ "value": "0x0"\ },\ "result": {\ "gasUsed": "0xa2a",\ "output": "0x0000000000000000000000000000000000000000000000000858898f93629000"\ },\ "subtraces": 0,\ "traceAddress": [],\ "type": "call"\ }\ ], "vmTrace": null } The debug\_traceCall method =========================== The [debug\_traceCall](https://www.alchemy.com/docs/reference/debug-tracecall) method executes the given call (transaction) and returns a number of possible traces for it. It’s helpful for debugging transactions and analyzing state changes due to a transaction. Under the hood,[debug\_traceCall](https://www.alchemy.com/docs/reference/debug-tracecall) is only supported by OpenEthereum or Erigon clients, but if you’re using an Alchemy API key we’ll automatically route the request for you so you don’t have to worry about the node client. Here are the parameters and response payloads for `debug_traceCall` Parameters ---------- The parameters for the `debug_traceCall` method are: 1. `Object` - Transaction object with the following fields: * `from` - string - The address the transaction is sent from. * `to` - string, **\[required\]** - The address the transaction is directed to. * `gasPrice` - string - Integer of the `gasPrice` used for each paid gas. * `value` - string - Integer of the value sent with the given transaction. * `data` - string - Hash of the method signature and encoded parameters. 2. `String` - One of the following options: 1. **block hash** 2. **block number** (in hex) 3. **block tag** (one of the following): * `pending` - A sample next block built by the client on top of the latest and containing the set of transactions usually taken from the local mempool. Intuitively, you can think of these as blocks that have not been mined yet. * `latest` - The most recent block observed by the client, this block may be re-orged out of the canonical chain even under healthy/normal conditions. * `safe` - The most recent crypto-economically secure block, cannot be re-orged outside of manual intervention driven by community coordination. Intuitively, this block is “unlikely” to be re-orged. **Only available on Ethereum Sepolia**. * `finalized` - The most recent crypto-economically secure block, that has been accepted by >2/3 of validators. Cannot be re-orged outside of manual intervention driven by community coordination. Intuitively, this block is very unlikely to be re-orged. **Only available on Ethereum Goerli**. * `earliest` - The lowest numbered block the client has available. Intuitively, you can think of this as the first block created. 3. Object - tracer * `tracer` - String to specify the type of tracer. Currently supports `callTracer` and `prestateTracer` (see below for definitions). * `tracerConfig` - Object to specify configurations for the tracer * `onlyTopCall` - boolean - setting this to `true` will only trace the main (top-level) call and none of the sub-calls. This avoids extra processing for each call frame if only the top-level call info is required (useful for getting `revertReason`). ### `callTracer` The `callTracer` tracks all the call frames executed during a transaction. The result will be a nested list of call frames. They form a tree with the top-level call at the root and sub-calls as children of the higher levels. It’s similar to the `trace` option of the [trace\_call](https://www.alchemy.com/docs/reference/trace-call) method. Each call frame has the following fields: | field | type | description | | --- | --- | --- | | type | string | CALL, CREATE or SUICIDE | | from | string | address | | to | string | address | | value | string | hex-encoded amount of value transfer | | gas | string | hex-encoded gas provided for call | | gasUsed | string | hex-encoded gas used during call | | input | string | call data | | output | string | return data | | error | string | error, if any | | revertReason | string | Solidity revert reason, if any | | calls | array of call frames | list of sub-calls | ### `prestateTracer` The `prestateTracer` replays the transaction and tracks every part of state that is touched during that transaction. This is similar to the `stateDiff` option of the [trace\_call](https://www.alchemy.com/docs/reference/trace-call) method. The result is an object. The keys are addresses of accounts. The value is an object with the following fields: | field | type | description | | --- | --- | --- | | balance | string | balance in wei | | nonce | uint64 | nonce | | code | string | hex-encoded bytecode | | storage | map\[string\]string | storage slots of the contract | As you've seen that the `callTracer` and `prestateTracer` options of [debug\_traceCall](https://www.alchemy.com/docs/reference/debug-tracecall) are similar to `trace` and `stateDiff` options of [debug\_traceCall](https://www.alchemy.com/docs/reference/debug-tracecall) , here's a table depicting this: | Options of [trace\_call](https://www.alchemy.com/docs/reference/trace-call) | Similar options of [debug\_traceCall](https://www.alchemy.com/docs/reference/debug-tracecall) | | --- | --- | | trace | callTrace | | stateDiff | prestateTracer | Example Request and Response ---------------------------- ### Request cURL ethers web3py curl https://eth-mainnet.g.alchemy.com/v2/demo \ -X POST \ -H "Content-Type: application/json" \ --data '{"method":"debug_traceCall","params":[{"from":null,"to":"0x6b175474e89094c44da98b954eedeac495271d0f","data":"0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE"}, "latest"],"id":1,"jsonrpc":"2.0"}' ### Response debug\_traceCall { "type": "CALL", "from": "0xe5cb067e90d5cd1f8052b83562ae670ba4a211a8", "to": "0xdc66567a990b7fa10730459537620857c9e03287", "value": "0x0", "gas": "0x7fffffffffffad2b", "gasUsed": "0x19dd6", "input": "0xae169a50000000000000000000000000000000000000000000000000000000000000000e", "output": "0x0000000000000000000000000000000000000000000000000000000000000001", "calls": [\ {\ "type": "CALL",\ "from": "0xdc66567a990b7fa10730459537620857c9e03287",\ "to": "0xa2b885e7065ea59a3251489715ca80de5ff642f8",\ "gas": "0x7dffffffffff9207",\ "gasUsed": "0x1bb3",\ "input": "0x6352211e000000000000000000000000000000000000000000000000000000000000000e",\ "output": "0x000000000000000000000000e5cb067e90d5cd1f8052b83562ae670ba4a211a8"\ },\ {\ "type": "CALL",\ "from": "0xdc66567a990b7fa10730459537620857c9e03287",\ "to": "0xf418588522d5dd018b425e472991e52ebbeeeeee",\ "gas": "0x7dffffffffff5b32",\ "gasUsed": "0xa4e",\ "input": "0x70a08231000000000000000000000000dc66567a990b7fa10730459537620857c9e03287",\ "output": "0x0000000000000000000000000000000000000000000011b962d6ea64e3500000"\ }\ ] } Difference between `trace_call` and `debug_traceCall` ===================================================== Since [trace\_call](https://www.alchemy.com/docs/reference/trace-call) is OpenEthereum's (Now Erigon's) equivalent to Geth's [debug\_traceCall](https://www.alchemy.com/docs/reference/debug-tracecall) there are not many differences between them but there are some minor differences which are mentioned below: * You can choose to trace only the main call (the top-level call) in `debug_traceCall` by setting the `onlyTopCall` option to `true`. This avoids extra processing if only the top-level info is required (like getting the revert reason). However, this is not possible using `trace_call` as you always get back the complete trace. * You can replay a transaction in a particular block by providing the block hash in `debug_traceCall` but not in `trace_call`. (However, both methods accept the block number in hex format and the tags like `latest` and `earliest`). * `trace_call` is accessible through Erigon while `debug_traceCall` is accessible through Geth. * By using `trace_call` you can get the simple trace for a transaction (trace) and the state difference (stateDiff) in just one request by putting an array containing `trace` and `stateDiff` options in trace\_call's second parameter (`["trace", "stateDiff"]`) as mentioned below: ethers // Request using ethers.js in node.js const ethers = require("ethers"); (async () => { const provider = new ethers.providers.JsonRpcProvider( "https://eth-mainnet.g.alchemy.com/v2/demo" ); const response = await provider.send("trace_call", [\ {\ from: "0xe5cb067e90d5cd1f8052b83562ae670ba4a211a8",\ to: "0xdc66567a990b7fa10730459537620857c9e03287",\ data: "0xae169a50000000000000000000000000000000000000000000000000000000000000000e",\ },\ ["trace", "stateDiff"], // getting both "trace" and "stateDiff" in one request\ "latest",\ ]); console.log(response); })(); In response for this request you will get both `trace` and `stateDiff`: response { "output": "0x", "stateDiff": { // ---> stateDiff "0xe5cb067e90d5cd1f8052b83562ae670ba4a211a8": { "balance": { "*": { "from": "0x43d1b8fda906d05", "to": "0x1c0671087043bf963a878705f" } }, "code": "=", "nonce": { "*": { "from": "0x21", "to": "0x22" } }, "storage": {} } }, "trace": [ // // ---> trace\ {\ "action": {\ "from": "0xe5cb067e90d5cd1f8052b83562ae670ba4a211a8",\ "callType": "call",\ "gas": "0x1dcd122c",\ "input": "0xae169a50000000000000000000000000000000000000000000000000000000000000000e",\ "to": "0xdc66567a990b7fa10730459537620857c9e03287",\ "value": "0x0"\ },\ "result": {\ "gasUsed": "0x0",\ "output": "0x"\ },\ "subtraces": 0,\ "traceAddress": [],\ "type": "call"\ }\ ], "vmTrace": { "code": "0x", "ops": [] } } But by using [debug\_traceCall](https://www.alchemy.com/docs/reference/debug-tracecall) you can either get the traces using `callTracer` or the state difference using `prestateTracer` in one request. Conclusion ========== In conclusion, [trace\_call](https://www.alchemy.com/docs/reference/trace-call) and [debug\_traceCall](https://www.alchemy.com/docs/reference/debug-tracecall) are two important methods for transaction tracing. They are accessible through different Ethereum clients and are slightly different from each other. Was this page helpful? YesNo --- # Custom Webhook Filters | Alchemy Docs Copy page Custom Webhook Filters ====================== Understand what filters are available for Custom Webhooks and how to use them Alchemy's Custom Webhooks allow you to access any on-chain activity while also precisely defining filters to control your data pipelines. With Alchemy's filters, you are able to set up logic for when you want blockchain data, whether that's for token movement, transactions of interest, or full blocks of data! Additionally, they allow you to easily filter down the data to exactly what you need, saving you on data ingestion costs and reducing infrastructure overhead. To get started with the filters head over to the [Custom Webhook playground](https://dashboard.alchemy.com/notify?utm_source=docs&utm_medium=referral&utm_content=reference_custom-webhook-filters) and test them out! Alchemy's Custom Webhooks currently feature filters on 3 types of on-chain data: * Events/Logs * External Transactions * Internal Transactions (Debug trace calls) Event/Log Filters ----------------- Custom Webhook log/event filters leverage the same semantics as a traditional _eth\_getLogs_ RPC call. In particular, we maintain the 2 key fields that _eth\_getLogs_ accepts to query for events of interest: an `address` field and a `topics` field In particular, Custom Webhook log GraphQL objects accept a _BlockLogsFilterCriteria_ filter which is comprised of the following objects: * `addresses: [Address!]` Addresses accepts an array of strings which map to either a single contract address or a list of addresses from which logs should originate. If this list is empty, results will not be filtered by address. * `topics: [[Bytes32!]!]` Array of 32 Bytes DATA topics (**up to 4 topics allowed per address**). Topics are order-dependent. Each topic can also be an array of DATA with "or" options. If you're not familiar with how topic filters work for _eth\_getLogs_, here's [an article](https://www.alchemy.com/docs/deep-dive-into-eth_getlogs) to get you up to speed. A transaction with topics will be matched by the following topic filters: * `[]` “anything” * `[A]` “A in first position (and anything after)” * `[[], [B]]` “anything in first position AND B in second position (and anything after)” * `[A, B]` “A in first position AND B in second position (and anything after)” * `[[A, B], [A, B]]` “(A OR B) in first position AND (A OR B) in second position (and anything after)” ### Specifying Addresses within Custom Webhook Event Filters Let's investigate an example log filter together! In this snippet, we only define a single address of interest, the Bored Ape NFT contract `0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D`. In this example, we set our filter so that we return logs/events only associated with the Bored Ape NFT contract. # Get all logs emitted by the Bored Ape NFT contract in block 0x4a4d98f90439daaf082642dfbdd0f7b9a36749484582fb3d3e03bd4583da337a { block(hash: "0x4a4d98f90439daaf082642dfbdd0f7b9a36749484582fb3d3e03bd4583da337a") { logs(filter: {addresses: ["0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D"], topics: []}) { topics data } } } In the case where we would want apply the same filter across a list of contracts, we could simply add more addresses to the address list part of filter! ### Specifying Topics within Custom Webhook Event Filters Let's investigate an example topc filter together! In this snippet, we only define a single topic of interest, the _transfer_ event with a kek hash of `0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef`. In this example, we set our filter so that we return logs/events only associated with the transfer event # Get all logs associated with a transfer event in block 0x4a4d98f90439daaf082642dfbdd0f7b9a36749484582fb3d3e03bd4583da337a { block(hash: "0x4a4d98f90439daaf082642dfbdd0f7b9a36749484582fb3d3e03bd4583da337a") { logs(filter: {addresses: [], topics: ["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"]}) { topics data } } } External Transaction Filters ---------------------------- Custom Webhook external transaction filters allow developers to filter on the `to` and `from` addresses associated with each external transaction! An external transaction refers to a transaction that is initiated by an external account on the Ethereum network. It involves sending a request to modify the state of the Ethereum blockchain, such as transferring Ether (the native cryptocurrency of Ethereum) or interacting with a smart contract. In particular, Custom Webhook log GraphQL objects accept a _BlockTransactionsFilterCriteria_ filter which is comprised of the following fields! * `from: [Address!]` The sending party of a transaction * `to: [Address!]` The receiving party of a transaction A transaction from the _BlockTransactionsFilterCriteria_ will match if it has a `from` address that is in the list of `from` addresses AND a `to` address that is in the list of `to` addresses provided. Missing or empty lists will be treated as wildcards and will return a match. ### Specifying `from` addresses within Custom Webhook Transaction Filters Let's investigate an example transaction filter together! In this snippet, we only define a single `from` address of interest `0xc83dad6e38BF7F2d79f2a51dd3C4bE3f530965D6` so that Alchemy sends out webhook emissions only associated with `0xc83dad6e38BF7F2d79f2a51dd3C4bE3f530965D6` # Filter for transactions originating from 0xc83dad6e38BF7F2d79f2a51dd3C4bE3f530965D6 { block(hash: "0x49c8fd41516ed8d8ba871c0dadaddb0928d7d03d4de569b2537343080f48c618") { hash number timestamp transactions(filter: {addresses: [\ {from: ["0xc83dad6e38BF7F2d79f2a51dd3C4bE3f530965D6"]}\ ]} ) { from { address }, to { address } hash, value gas status } } } ### Specifying `to` within Custom Webhook Transaction Filters Let's investigate an example transaction filter together! In this snippet, we only define a single `to` address `0x388C818CA8B9251b393131C08a736A67ccB19297` of interest so that Alchemy sends out webhook emissions only associated with transactions sent to `0x388C818CA8B9251b393131C08a736A67ccB19297` # Filter for transactions sent to 0x388C818CA8B9251b393131C08a736A67ccB19297 { block(hash: "0x49c8fd41516ed8d8ba871c0dadaddb0928d7d03d4de569b2537343080f48c618") { hash number timestamp transactions(filter: {addresses: [\ {to: ["0x388C818CA8B9251b393131C08a736A67ccB19297"]}\ ]} ) { from { address }, to { address } hash, value gas status } } } ### Specifying `from` & `to` within Custom Webhook Transaction Filters Let's investigate an example transaction filter together! In this snippet, we only define a single `to` address `0xeb83e695adcac2e83f290d2d2815fc58e6491d7a` and a `from` address `0x29469395eaf6f95920e59f858042f0e28d98a20b` so that Alchemy sends out webhook emissions only associated with that `from` and `to` configuration. { block(hash: "0x49c8fd41516ed8d8ba871c0dadaddb0928d7d03d4de569b2537343080f48c618") { hash number timestamp transactions(filter: {addresses: [\ {from: ["0xeb83e695adcac2e83f290d2d2815fc58e6491d7a"]},\ {to: ["0x29469395eaf6f95920e59f858042f0e28d98a20b"]}\ ]} ) { from { address }, to { address } hash, value gas status } } } Internal Transaction (Debug trace calls) Filters (BETA) ------------------------------------------------------- An internal transaction refers to a transaction that is triggered as a result of the execution of a smart contract. Unlike external transactions that are initiated by external accounts, internal transactions occur within the context of a specific smart contract and are not directly initiated by external users or applications. Similar to external transactions, Custom Webhook log GraphQL objects accept a _BlockCallTracesFilterCriteria_ filter which is comprised of the following fields! * `from: [Address!]` The sending party of a transaction * `to: [Address!]` The receiving party of a transaction A transaction from the _BlockCallTracesFilterCriteria_ will match if it has a `from` address that is in the list of `from` addresses AND a `to` address that is in the list of `to` addresses provided. Missing or empty lists will be treated as wildcards and will return a match. ### Specifying `from` addresses within Custom Webhook Internal Transaction Filters # Filter for internal transactions originating from 0x5c43B1eD97e52d009611D89b74fA829FE4ac56b1 { block { number callTracerTraces (filter: {addresses: [\ {from: ["0x5c43B1eD97e52d009611D89b74fA829FE4ac56b1"], to: []}\ ]} ){ from { address } to { address } type input output value gas gasUsed input output error revertReason subtraceCount traceAddressPath } } } ### Specifying `to` addresses within Custom Webhook Internal Transaction Filters # Filter for internal transactions going to 0x5c43B1eD97e52d009611D89b74fA829FE4ac56b1 { block { number callTracerTraces (filter: {addresses: [\ {from: [], to: ["0x5c43B1eD97e52d009611D89b74fA829FE4ac56b1"]}\ ]} ){ from { address } to { address } type input output value gas gasUsed input output error revertReason subtraceCount traceAddressPath } } } ### Specifying `from` & `to` within Custom Webhook Internal Transaction Filters { block { number callTracerTraces (filter: {addresses: [\ {from: ["0x29469395eaf6f95920e59f858042f0e28d98a20b"], to: ["0x5c43B1eD97e52d009611D89b74fA829FE4ac56b1"]}\ ]} ){ from { address } to { address } type input output value gas gasUsed input output error revertReason subtraceCount traceAddressPath } } } Was this page helpful? YesNo --- # On-chain Events | Alchemy Docs Copy page On-chain Events =============== List of articles related to on-chain events Introduction ============ On-chain events are important because they represent a permanent and unchangeable record of what happened on the blockchain. This provides a level of trust and transparency that is crucial for many use cases, such as financial transactions and voting systems. By recording events on the blockchain, it is possible to verify the authenticity and integrity of the data, as well as to ensure that it cannot be tampered with or altered. This makes on-chain events a valuable tool for building secure and reliable applications on the blockchain. Articles ======== The following articles are listed under this section: * [How to Get On-chain Events on Ethereum](https://www.alchemy.com/docs/how-to-get-on-chain-events) * [Understanding Logs: Deep Dive into eth\_getLogs](https://www.alchemy.com/docs/deep-dive-into-eth_getlogs) Was this page helpful? YesNo --- # How to Get a Contract's First Transfer Event | Alchemy Docs Copy page How to Get a Contract's First Transfer Event ============================================ Learn how to use Alchemy's SDK to query the transfer history of one or multiple smart contracts in a single request. This tutorial uses the **[alchemy\_getAssetTransfers](https://www.alchemy.com/docs/reference/alchemy-getassettransfers) ** endpoint. One of the best ways to study a smart contract is to look at its transfer events. In this tutorial, we will query the very first transfer event of the BAYC smart contract. However, you are welcome to use any contract address you are interested in! See the following for use cases for retrieving a contract's first transfer event: * Finding the first addresses to interact with a contract (e.g., the first address to mint a Bored Ape). * Tracking the first interaction an address had with a smart contract. * Verifying whether a contract facilitated transfers before a certain date. If you already completed "How to get a contract's last transfer event", you may skip the setup and installation steps. * * * Install Node.js --------------- Head to [Node.js](https://nodejs.org/en/) and download the LTS version. You can verify your installation was successful by running `npm -version` in your macOS terminal or Windows command prompt. A successful installation will display a version number, such as: shell 6.4.1 * * * Setup Project Environment ------------------------- Open VS Code (or your preferred IDE) and enter the following in a terminal: shell mkdir contract-transfers cd contract-transfers Once inside our project directory, initialize npm (node package manager) with the following command: shell npm init Press enter and answer the project prompt as follows: contract-transfers.json package name: (contract-transfers) version: (1.0.0) description: entry point: (index.js) test command: git repository: keywords: author: license: (ISC) Press enter again to complete the prompt. If successful, a `package.json` file will have been created in your directory. * * * Setup for API Calls ------------------- We'll use the built-in `fetch` API (available in Node.js 18+) to interact with Alchemy's endpoints and make JSON-RPC requests. No additional dependencies are required! * * * Get Contract's First Transfer Event ----------------------------------- In this section, we will use Alchemy's [Transfer API](https://www.alchemy.com/docs/reference/transfers-api) to retrieve the contract's first transfer event. We can call the [`alchemy_getAssetTransfers`](https://www.alchemy.com/docs/reference/alchemy-getassettransfers) function and filter transfers by passing in the following object parameters: | Property | Description | Requirement | Default | | --- | --- | --- | --- | | `fromBlock` | Indicates from which block the endpoint searches. Inclusive and can be a hex string, integer, or `latest`. | Optional | `"0x0"` | | `toBlock` | Indicates to which block the endpoint searches. Inclusive and can be a hex string, integer, or `latest`. | Optional | `latest` | | `fromAddress` | Indicates the sending address in the transaction. Can be a hex string. | Optional | Wildcard - any address | | `toAddress` | Indicates the receiving address in the transaction. Can be a hex string. | Optional | Wildcard - any address | | `contractAddresses` | An array of contact addresses to filter for. **Note:** Only applies to transfers of `token`, `erc20`, `erc721`, and `erc1155`. | Optional | Wildcard - any address | | `category` | An array of transfer categories. Can be any of the following: `external`, `internal`, `erc20`, `erc721`, or `erc1155`. | Required | | | `excludeZeroValue` | A boolean to exclude transfers of zero value. A zero value is not the same as `null`. | Optional | `true` | | `maxCount` | The maximum number of results to return per call. **Note**: 1000 is the max per request. | Optional | `1000 or 0x3e8` | | `pageKey` | Use for [pagination](https://app.gitbook.com/o/-MB5OnTtI_5pcZn7v2wm/s/-MB17w56kk7ZnRMWdqOL/~/changes/WTZhmfICAlXTSmnAxOTR/enhanced-apis/transfers-api/how-to-get-a-contracts-first-transfer-event#pagination)
. If more results are available after the response, a `uuid` property will return. You can use this in subsequent requests to retrieve the next 1000 results of `maxCount`. | Optional | | For reference, here is an example of how the above parameters could be passed into the `alchemy_getAssetTransfers` API: FirstTransfer.js // Using fetch for alchemy_getAssetTransfers API const response = await fetch(`https://eth-mainnet.g.alchemy.com/v2/${apiKey}`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ jsonrpc: '2.0', id: 1, method: 'alchemy_getAssetTransfers', params: [{\ fromBlock: "0x0",\ toBlock: "latest",\ contractAddresses: ["0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d"],\ excludeZeroValue: true,\ category: ["erc721"]\ }] }) }); const data = await response.json(); To get started finding a contract's first transfer, let's create a file inside our project folder named `FirstTransfer.js` and add the following code to utilize the [`alchemy_getAssetTransfers`](https://www.alchemy.com/docs/reference/alchemy-getassettransfers) endpoint: FirstTransfer.js // Replace with your Alchemy API Key const apiKey = "demo"; const baseURL = `https://eth-mainnet.g.alchemy.com/v2/${apiKey}`; const getFirstTransfer = async () => { try { // Calling the getAssetTransfers endpoint with filters const requestBody = { jsonrpc: "2.0", id: 0, method: "alchemy_getAssetTransfers", params: [{\ fromBlock: "0x0",\ contractAddresses: ["0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d"], // You can replace with contract of your choosing\ excludeZeroValue: true,\ category: ["erc721"]\ }] }; const response = await fetch(baseURL, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(requestBody) }); const data = await response.json(); if (data.error) { console.error('Error:', data.error); return; } // printing the first indexed transfer event to console console.log("First Transfer:", data.result.transfers[0]); } catch (error) { console.error('Request failed:', error); } }; getFirstTransfer(); Above, we created an async function called _`getFirstTransfer`_. To learn more about how what it does, view the commented notes above. To use your script, run the following command in your terminal: shell node FirstTransfer.js If successful, you should see the following transfer object in your output: output First Transfer: { blockNum: '0xbb933a', hash: '0xcfb197f62ec5c7f0e71a11ec0c4a0e394a3aa41db5386e85526f86c84b3f2796', from: '0x0000000000000000000000000000000000000000', to: '0xaba7161a7fb69c88e16ed9f455ce62b791ee4d03', value: null, erc721TokenId: '0x0000000000000000000000000000000000000000000000000000000000000000', erc1155Metadata: null, tokenId: '0x0000000000000000000000000000000000000000000000000000000000000000', asset: 'BAYC', category: 'erc721', rawContract: { value: null, address: '0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d', decimal: null } } Congratulations, you've successfully retrieved the first transfer event in the BAYC contract! If you enjoyed this tutorial for retrieving a contract's first transfer event, give us a tweet [@Alchemy](https://twitter.com/Alchemy) ! And don't forget to join our [Discord server](https://www.alchemy.com/discord) to meet other blockchain devs, builders, and entrepreneurs! Was this page helpful? YesNo --- # How to Check the Status of a Transaction using its Hash | Alchemy Docs Copy page How to Check the Status of a Transaction using its Hash ======================================================= Learn how to check the status of a transaction using the transaction hash Don’t have an API key? Start using this API in your app today. [Get started for free](https://dashboard.alchemy.com/signup?utm_source=docs&utm_medium=referral&utm_content=how-to-check-the-status-of-a-transaction-using-its-hash) This tutorial uses the **[getTransactionReceipt](https://www.alchemy.com/docs/reference/sdk-gettransactionreceipt) ** endpoint. Introduction ============ The transaction hash is a unique identifier that is assigned to every transaction on the blockchain network. In this article, we will explain how you can use Alchemy's [getTransactionReceipt](https://www.alchemy.com/docs/reference/sdk-gettransactionreceipt) API to check the status of a transaction using its transaction hash. Creating the Status Checker Script ================================== * * * Step 1: Install Node and npm ---------------------------- In case you haven't already, [install node and npm](https://nodejs.org/en/download/) on your local machine. Make sure that node is at least **v14 or higher** by typing the following in your terminal: shell node -v Step 2: Create an Alchemy app ----------------------------- * * * In case you haven't already, [sign up for a free Alchemy account](https://dashboard.alchemy.com/signup?utm_source=docs&utm_medium=referral&utm_content=how-to-check-the-status-of-a-transaction-using-its-hash) . ![2880](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764192918%2Fdocs%2Ftutorials%2Ftransactions%2Funderstanding-transactions%2F06c375a-Screenshot_2022-11-04_at_10.36.40_PM.png&w=3840&q=75 "Screenshot 2022-11-04 at 10.36.40 PM.png") Alchemy's account dashboard where developers can create a new app on the Ethereum blockchain. Next, navigate to the [Alchemy Dashboard](https://dashboard.alchemy.com/signup?utm_source=docs&utm_medium=referral&utm_content=how-to-check-the-status-of-a-transaction-using-its-hash) and create a new app. Make sure you set the chain to Ethereum and the network to Mainnet. Once the app is created, click on your app's _View Key_ button on the dashboard. Take note of the **HTTP URL**. The URL will be in this form: `https://eth-mainnet.g.alchemy.com/v2/xxxxxxxxx` You will need this later. * * * Step 3: Create a node project ----------------------------- Let's now create an empty repository and install all node dependencies. Run the following commands in order to create your node project. Viem Ethers.js mkdir transaction-status-checker && cd transaction-status-checker npm init -y npm install --save viem touch main.js This will create a repository named `transaction-status-checker` that holds all your files and dependencies. Next, open this repo in your favorite code editor. We will write all our code in the `main.js` file. Step 4: Check the Transaction Status ------------------------------------ To check the status of the transaction using its transaction hash, we will use the [getTransactionReceipt](https://www.alchemy.com/docs/reference/sdk-gettransactionreceipt) method. * This method accepts a transaction hash and returns the transaction receipt, which is an object that contains the details about the transaction. The returned object has a property called `status`. * If the value of the `status` property is `1`, it means that the transaction was successful, on the other hand, a value of `0` signifies that the transaction failed. * If no object (transaction receipt) is returned from the `getTransactionReceipt` method, it means either the transaction is pending or the hash provided is an invalid/unknown transaction hash. Add the following code to the `main.js` file: Viem Ethers.js import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' // Replace with your Alchemy API Key const apiKey = "demo"; const client = createPublicClient({ chain: mainnet, transport: http(`https://eth-mainnet.g.alchemy.com/v2/${apiKey}`) }) // Transaction hash for the transaction whose status we want to check const txHash = "0xd488331be3a2f9cdd0f2b351f2b13f5151630aaafd2c2b246f7f3cd7fd0b1dfc"; // Getting the status of the transaction using getTransactionReceipt and logging accordingly const checkTransactionStatus = async () => { try { const receipt = await client.getTransactionReceipt({ hash: txHash }); if (!receipt) { console.log("Pending or Unknown Transaction"); } else if (receipt.status === 'success') { console.log("Transaction was successful!"); } else { console.log("Transaction failed!"); } } catch (error) { console.log("Pending or Unknown Transaction"); } }; checkTransactionStatus(); Here's an explanation of what the code is doing: * Imports either Viem or Ethers.js library to interact with Ethereum. * Configures the client/provider with the Alchemy API key and Ethereum mainnet. * Defines the transaction hash for the transaction whose status we want to check. * Calls the `getTransactionReceipt` method, passing in the transaction hash as an argument. * This returns the transaction receipt for the transaction, which contains the status of the transaction. * It then logs the status of the transaction to the console according to the value of the `status` property. If the receipt is `null`, it means that the transaction is either pending or unknown. For Viem, the status is 'success' or 'reverted', while for Ethers.js the status is `1` for success and `0` for failure. Run the script using: shell node main.js If all goes well, you should see an output with the status of the transaction: Transaction was successful! Conclusion ========== In conclusion, checking the status of a transaction using its hash is a simple process. By following the steps outlined in this article, you can easily track the status of your transaction. Was this page helpful? YesNo --- # Sending Transactions | Alchemy Docs Copy page Sending Transactions ==================== Tutorials for sending transactions on the blockchain Introduction ============ In this section, you will find tutorials and resources for sending transactions on the blockchain. Transactions are a crucial aspect of the blockchain, and are used to transfer value, store data, and execute smart contracts. Tutorials ========= The following tutorials are listed under this section: * [How to Send Transactions on Ethereum](https://www.alchemy.com/docs/how-to-send-transactions-on-ethereum) * [How to Send a Private Transaction on Ethereum](https://www.alchemy.com/docs/how-to-send-a-private-transaction-on-ethereum) * [How to Check the Status of a Transaction using its Hash](https://www.alchemy.com/docs/how-to-check-the-status-of-a-transaction-using-its-hash) Was this page helpful? YesNo --- # Ethereum Transactions - Pending, Mined, Dropped & Replaced | Alchemy Docs Copy page Ethereum Transactions - Pending, Mined, Dropped & Replaced ========================================================== Explanation for different transaction states on Ethereum and other blockchains and how to handle each state to ensure your transaction gets mined in time. **TL;DR:** Alchemy just released support for “Dropped & Replaced” transactions in the Mempool Watcher, a browser-based user interface that allows web3 developers to browse, filter, and track transactions that were sent to the blockchain and help you [debug pending transactions](https://www.youtube.com/watch?v=MhtJLUl51gE) . With “Dropped & Replaced” transactions, a new blockchain developer tool, it will be dramatically easier to understand when transactions fail, when they are replaced, and the current state of the mempool. What is a Mempool? ------------------ A mempool, or memory pool, is a [collection of pending transactions waiting for validation from a node](https://www.alchemy.com/overviews/what-is-a-mempool) before they are committed to a new block on the blockchain. Put simply, the mempool is a staging area for unconfirmed transactions in a node. Every blockchain node in the network has a mempool, and they all intercommunicate to share information about the latest pending transactions. Mempools exist because only ~200 transactions can be confirmed per block, which are mined about once every 15 seconds. As a result, pending transactions are broadcasted throughout the entire network of mempools with an associated gas price (i.e. the gas fees that the sender is willing to pay to complete their transaction). When a block is mined, the ~200 pending transactions with the highest gas prices are confirmed onto the blockchain by the node that mines the latest block. If transactions fail to pass a series of validation checks or are submitted with too little gas, those transactions will eventually be dropped from the mempool. What is a nonce? ---------------- A nonce is a 0-indexed number corresponding to the number of confirmed transactions sent by a particular address. That is, if an address has 0 confirmed transactions, it marks its first transaction with a nonce of 0, and the subsequent transaction it would like to send with a nonce of 1. Every confirmed transaction by a particular sender address must have a unique nonce value. For example, if a sender submits two transactions with a nonce value of 1, only one can succeed. Why do you need to set your nonce? ---------------------------------- Nonces exist to protect against replay attacks. For example, a transaction sending 20 coins from A to B can be replayed by B over and over to continually drain A’s balance if it didn’t have a nonce. Because transactions are submitted as hashed values, B could simply copy the hashed transaction published to the blockchain and re-run it over and over again. However, if you set a unique nonce before creating the hashed transaction, it will prevent a replay attack, since every confirmed transaction must have a unique nonce value and subsequent identical transactions will fail. It’s important for senders to set their nonce values correctly to ensure transactions have the opportunity to be confirmed because transactions that are submitted with an out-of-order or duplicate nonce value will be dropped from the mempool. Nonces are also useful to guarantee ordering of transactions. For example, if a sender can submit 5 transactions with nonces from 0 - 4, they can expect that the transactions will be executed strictly in the order of their nonces. What transaction lifecycle states can a mempool transaction be in? ------------------------------------------------------------------ Traditionally, mempool transactions fall into one of the following three buckets: ### Pending Transactions Transactions that have been submitted to the mempool and are waiting to be included in the next block mined by a miner. [Learn more about debugging pending transactions.](https://alchemy.com/blog/how-to-debug-pending-ethereum-transactions) . ### Mined Transactions Transactions that have been selected and are included in the latest block by a miner. The results of these transactions are then broadcasted to the entire network. Mined transactions can have two statuses: **Success** These transactions are successfully executed and modify state on-chain. The `status` field for a successful transaction is `0x1`. **Failure/Execution Reverted** These transactions are not successfully executed but are still included in the block. This can occur if the execution process hits an error, runs out of gas, or encounters some other issue. The `status` field for a failed transaction is `0x0`. To check whether a mined transaction was successful or failed you can call [eth\_getTransactionReceipt](https://composer.alchemy.com/?share=eJyVWEtv4jAQ.i85cyjhzY0isVup26K220tVIccZIKqxkWNKUdX.vk5CqTMeB.bCYb6HHzO2J3xGfM0yGY3jVrQBs1bp.dZkSubR_OUzemdiB9E4YoKvYXNYrMBM8hzMk2YyX4LOo1YkWAKikfPVIp2e1BvIiRBqzyQH2glxmpyumSg4gSnVKU0_f8CwlBnW4HOihHyKpTNe7OMDcMi2JjQrguh6JkqX_7mzidGORT1OKKY7rUGauVZblQMhxYSwxzMTmV2sqiU7SCF8HpQyv1m_9uUnhFA9Zitpi2cSkNZhV2_LeME4VztZ2.VaGPMTofjb3W6T1LYKI1jFmRCIXoY8XnHCblJMPUYxG3KTbZiBXwxP30WwagnwO8ttCg5I5ABYs2L5XGe1o1cLe3wwxxOEFT8ApSm28PqA8kiAYS2ZGg8O6YkzSMIhvXNKp0X9NK4lQL7cu3GtQTrhP1UpkagySrBnmTCgp2smV7U7lISD_lu1CopLjFDSmhDb3lhq6dOrMMEnbh_MEKpHe2DYCibGl.1AhM7Jz.WhzFgxwkSmNzKFD9.sDP_iEaoK_J8xkOLcKPT2_ZRmn7JeG20qRrPL8bA2_nxzLnLKj3tyieOJSzj.lVzARTkPMs_4nstzAzfkfLxDTlMJmHq0S.xC91iIiD037MM_Q0pn5jADmIP2H0SSgn0k7MthqksIOSCQ0IZkYcUcZJrJlVM_IY8gE7tutTKKK.FsWx7LQk4YxercDvPA9s4wyIAgeB4Hye1UsfAYxeydzGRubC9Erhyjrrp8oaTRdhpEI06hSD0TSmnc1tTjSHHLtH3TzMTvGQkQae9mT.Q0XcDXoEHKCMGaKT1VQgDOGQkj.f2_6I8bHChCyKP86gnIK8xVSjALYXtOsHl2K6Yex4p3r7bdqMvesuLEN7V3IYbrUlQRVP29o3SjPht1.E7Q5_rQiSNhQg9bwaob0iG6q2zmhRwbJ_UxfBf7G9S7mKvcQ9JZcJEV34pemgnQ0_Zr1sGSMvb12irqZK.0WzTuXrW..8W4Y5tzDYQtEraxn64729COX6Krj246GvYHowTSuN9lvVE35r3_AAZxtxcPWNJu97rtpN0f8n7cGbSXvbjf6fDBAJbDUXcY966i169.r4czXw--) passing in your transaction hash. In the payload, you will find a `status` field which will be `0x0` for failed and `0x1` for success. ### Dropped Transactions Transactions that have failed to be confirmed. This could happen because the transaction failed certain validation tests, the nonce was incorrect, the submitted gas price was too low and it timed out, or a number of other errors. Dropped transactions return their assets and gas fees to the sender, as if the transaction never happened. Need help troubleshooting dropped transactions? Watch our tutorial on [how to fix pending or stuck transactions](https://www.youtube.com/watch?v=MhtJLUl51gE) with Alchemy’s Mempool Watcher. What are Dropped & Replaced transactions? ----------------------------------------- A new category has become a common feature request by developers. When a transaction is dropped, the sender will oftentimes send a replacement transaction with the same nonce value to “replace” that failed transaction. If the second transaction is confirmed onto the blockchain (e.g. by sending a new transaction with the same nonce and a higher gas price), the “dropped” transaction will be moved into the new transaction status category known as “Dropped & Replaced”. Similarly, if multiple transactions are simultaneously sent with the same nonce value, typically the transaction with a higher transaction fee will be selected for confirmation onto a block. The other transactions will fall into the “Dropped & Replaced” category. This transaction status is useful for smart contract developers as it allows them to track which transactions have been successfully re-broadcasted to the blockchain network (“dropped and replaced”) and which dropped transactions still need to be re-broadcasted (“dropped”). How to track Dropped & Replaced transactions -------------------------------------------- If you submit your transactions via [Alchemy](https://dashboard.alchemy.com/signup?utm_source=docs&utm_medium=referral&utm_content=ethereum-transactions-pending-mined-dropped-replaced) , we provide a convenient web3 developer tool to rapidly filter and explore transactions you’ve recently submitted: the Mempool Watcher. Before the Mempool Watcher tool was released, developers would have to track transactions via Etherscan (which was often unreliable), or by manually querying their nodes to retrieve the current state of the mempool and parse the response for the relevant transaction status details. Using the Mempool Watcher, web3 developers using Alchemy can now see all their transactions in a single UI, and filter them by mined, pending, dropped, and dropped & replaced transactions. Builders can also search transactions by these filters: * Date of submission * Sender address * Associated transaction hash Web3 developers can also use the Alchemy Notify API (webhook alerts for transaction activity) to: * [Send transaction status notifications with Zapier](https://www.alchemy.com/docs/alchemy/enhanced-apis/notify-api/integrate-alchemy-zapier) How do I start using the Mempool Watcher? ----------------------------------------- [Sign up for a free Alchemy account today](https://dashboard.alchemy.com/signup?utm_source=docs&utm_medium=referral&utm_content=ethereum-transactions-pending-mined-dropped-replaced) to access the Mempool Watcher, start tracking your dropped & replaced transactions, and access a host of other powerful blockchain developer tools! At our current pricing, you’ll be able to send 1.2 million transactions to the mempool each month on our free tier - the most generous in the web3 ecosystem. Was this page helpful? YesNo --- # How to Query Transaction Details on Ethereum | Alchemy Docs Copy page How to Query Transaction Details on Ethereum ============================================ Learn how to get general information about a transaction using the eth\_getTransactionReceipt method. Learn how to get general information about a transaction using the `eth_getTransactionReceipt` method. Introduction ============ When you inspect a transaction on Etherscan, you get general information about the transaction as shown in the image below: ![2024](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764192917%2Fdocs%2Ftutorials%2Ftransactions%2Funderstanding-transactions%2F9cbe9a0-inspect-transaction.png&w=3840&q=75 "inspect-transaction.png") But what if you want to get this information programmatically in your app? You can show these details to the users of your app to give them more information about the transaction. About this Tutorial =================== * * * We will write a simple script in `node.js` to get general details about a transaction using the transaction hash. We will use Alchemy's [getTransactionReceipt](https://www.alchemy.com/docs/reference/sdk-gettransactionreceipt) API to get the transaction receipt for a transaction. The transaction receipt contains general information about a transaction. Writing the Script ================== * * * Step 1: Install Node and NPM ---------------------------- In case you haven't already, [install node and npm](https://nodejs.org/en/download/) on your local machine. Make sure that node is at least **v14 or higher** by typing the following in your terminal: shell node -v Step 2: Create an Alchemy app ----------------------------- * * * In case you haven't already, [sign up for a free Alchemy account](https://dashboard.alchemy.com/signup?utm_source=docs&utm_medium=referral&utm_content=how-to-get-transaction-details) . ![2880](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764192918%2Fdocs%2Ftutorials%2Ftransactions%2Funderstanding-transactions%2F06c375a-Screenshot_2022-11-04_at_10.36.40_PM.png&w=3840&q=75 "Screenshot 2022-11-04 at 10.36.40 PM.png") Alchemy's account dashboard where developers can create a new app on the Ethereum blockchain. Next, navigate to the [Alchemy Dashboard](https://dashboard.alchemy.com/signup?utm_source=docs&utm_medium=referral&utm_content=how-to-get-transaction-details) and create a new app. Make sure you set the chain to Ethereum and the network to Mainnet. Once the app is created, click on your app's _View Key_ button on the dashboard. Take note of the **HTTP URL**. The URL will be in this form: `https://eth-mainnet.g.alchemy.com/v2/xxxxxxxxx` You will need this later. * * * Step 3: Create a node project ----------------------------- Let's now create an empty repository and install all node dependencies. To make requests, we will use Viem or Ethers.js. You can also use `ethers` or `cURL` alternatively. Viem Ethers.js mkdir my-project && cd my-project npm init -y npm install --save viem touch main.js This will create a repository named `my-project` that holds all your files and dependencies. Next, open this repo in your favorite code editor. We will be writing all our code in the `main.js` file. Step 4: Get the Transaction Receipt ----------------------------------- To get the Transaction Receipt, we will use the [getTransactionReceipt](https://www.alchemy.com/docs/reference/sdk-gettransactionreceipt) method which takes in the string of the transaction hash as the parameter. Add the following code to the `main.js` file. Viem Ethers.js import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const apiKey = "<-- ALCHEMY API KEY -->"; // Replace with your Alchemy API Key. const publicClient = createPublicClient({ chain: mainnet, transport: http(`https://eth-mainnet.g.alchemy.com/v2/${apiKey}`) }) async function main() { try { const txReceipt = await publicClient.getTransactionReceipt({ hash: "0x68ea69fd8b5dfa589a7a983c324ab153a33356320207885a9bba84425598dcaa" // Transaction hash }); console.log(txReceipt); } catch (error) { console.error('Failed to get transaction receipt:', error.message); } } main(); To make the request, run the script using the following command or make the request using `cURL`: bash cURL node main.js If all goes well, you should see an output that looks like this: json { to: '0xdAC17F958D2ee523a2206206994597C13D831ec7', from: '0xe5cB067E90D5Cd1F8052B83562Ae670bA4A211a8', contractAddress: null, transactionIndex: 86, gasUsed: BigNumber { _hex: '0xe429', _isBigNumber: true }, logsBloom: '0x00000000000000000000001000000000000000000000000000000000000000000000000000000000000200000000010000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000200000000000000100000000000000000000000000080000000100000000000000000000000000000000000000002000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000', blockHash: '0x2b9055d24eaeda177211e3b0f183c3b21c2f425d32d8fa7b710df0c63a89a558', transactionHash: '0x68ea69fd8b5dfa589a7a983c324ab153a33356320207885a9bba84425598dcaa', logs: [\ {\ transactionIndex: 86,\ blockNumber: 15802409,\ transactionHash: '0x68ea69fd8b5dfa589a7a983c324ab153a33356320207885a9bba84425598dcaa',\ address: '0xdAC17F958D2ee523a2206206994597C13D831ec7',\ topics: [Array],\ data: '0x000000000000000000000000000000000000000000000000000000001101bd29',\ logIndex: 127,\ blockHash: '0x2b9055d24eaeda177211e3b0f183c3b21c2f425d32d8fa7b710df0c63a89a558'\ }\ ], blockNumber: 15802409, confirmations: 209486, cumulativeGasUsed: BigNumber { _hex: '0x5f17f5', _isBigNumber: true }, effectiveGasPrice: BigNumber { _hex: '0x0425f51bc5', _isBigNumber: true }, } The output fields are explained below: * `transactionHash` - Hash of the transaction. * `transactionIndex` - Integer of the transactions index position in the block encoded as a hexadecimal. * `from` - Address of the sender. * `to` - Address of the receiver. null when its a contract creation transaction. * `blockHash` - Hash of the block where this transaction was in. * `blockNumber` - Block number where this transaction was added encoded as a hexadecimal. * `cumulativeGasUsed` - The total gas used when this transaction was executed in the block. * `effectiveGasPrice` - The price per gas at the time of the transaction * `gasUsed` - The amount of gas used by this specific transaction alone. * `contractAddress` - The contract address created for contract creation, otherwise null. * `logs` - Array of log objects, which this transaction generated. * `logsBloom` - Bloom filter for light clients to quickly retrieve related logs. * `value` - Value transferred in Wei encoded as hexadecimal. Congratulations! You now know how to programmatically get general information about a transaction. Was this page helpful? YesNo --- # Subscription API Endpoints | Alchemy Docs Copy page Subscription API Endpoints ========================== List of subscription endpoints for web3 events Subscription Types ================== The following subscription types are accepted in all `eth_subscribe` WebSocket requests through your Alchemy endpoint. Modern Web3 libraries like Viem and Ethers.js provide comprehensive WebSocket subscription functionality. Check out our WebSocket endpoint documentation for implementation examples. | Subscription Type | Description | | --- | --- | | [alchemy\_minedTransactions](https://www.alchemy.com/docs/reference/alchemy-minedtransactions) | Emits full transaction objects or hashes that are mined on the network based on provided filters and block tags. | | [alchemy\_pendingTransactions](https://www.alchemy.com/docs/reference/alchemy-pendingtransactions) | Emits full transaction objects or hashes that are sent to the network, marked as "pending", based on provided filters. | | [newPendingTransactions](https://www.alchemy.com/docs/reference/newpendingtransactions) | Emits transaction hashes that are sent to the network and marked as "pending". | | [newHeads](https://www.alchemy.com/docs/reference/newheads) | Emits new blocks that are added to the blockchain. | | [logs](https://www.alchemy.com/docs/reference/logs) | Emits logs attached to a new block that match certain topic filters. | * * * Subscription Type Support Per Chain =================================== Check the [Chains](https://dashboard.alchemy.com/chains?utm_source=docs&utm_medium=referral&utm_content=reference_subscription-api-endpoints) page for details about product and chain support! ![](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764179964%2Fdocs%2Fapi-reference%2Falchemy-transact%2Ftransaction-simulation%2F523fb8a9a9d899921ee1046d0ff1b389967a9976d1c6112ebbbe071ddd1ef374-image.png&w=3840&q=75) Was this page helpful? YesNo --- # Transaction Simulation | Alchemy Docs Copy page Transaction Simulation ====================== Discover Alchemy's powerful Transaction Simulation APIs that provide in-depth insights into the impact of transactions on various networks before execution. Transaction Simulation is a powerful feature that helps users understand the exact impact of a transaction before it is executed on the blockchain. With Alchemy's Simulation APIs, you can gain insights into asset transfers, emitted logs, and internal calls of a transaction before actually sending it to the blockchain. This not only enhances usability but also increases confidence in the integrity of transactions. Alchemy's Transaction Simulation supports multiple networks, including Ethereum (Mainnet and Goerli), Polygon (Mainnet and Mumbai), Arbitrum (Mainnet and Goerli) and Optimism (Mainnet and Goerli). Please note that the results provided by our transaction simulation APIs are based on the blockchain's state at the moment of simulation. Changes in the blockchain state, such as updates to contract variables or balances, can occur between the time of simulation and when you actually execute your transaction. This could lead to different outcomes than predicted. For instance, if a transaction's effect is conditional on the current state of a contract, and this state is altered before the transaction is executed, the final result may not match the simulation. Please be aware of this potential variance and consider it while using the APIs. In this section, we cover various tutorials related to Transaction Simulation. The tutorials provide in-depth explanations and step-by-step guides to help you master the powerful Simulation APIs offered by Alchemy. Articles -------- The following articles are listed under this section: * [Integrating Simulation with 1 line of code](https://www.alchemy.com/docs/integrating-simulation-with-1-line-of-code) * [Building a MetaMask Snap from scratch](https://www.alchemy.com/docs/building-a-metamask-snap-from-scratch) * [Asset Changes - Explained](https://www.alchemy.com/docs/asset-changes-explained) By following these tutorials, you can leverage the strong Simulation APIs offered by Alchemy to gain detailed insights into transaction outcomes, manage risks, and ensure seamless interactions with the blockchain. Was this page helpful? YesNo --- # How to Add Allowlists to Your Apps for Enhanced Security | Alchemy Docs Copy page How to Add Allowlists to Your Apps for Enhanced Security ======================================================== Learn how to limit addresses, domains and IPs that can interact with your app for added security Introduction ------------ When building applications that rely on your Alchemy API, security is the top concern. API keys are essential for your apps, but exposing them on the frontend could pose a risk. What if someone inspects your website's code and uses your API key for malicious purposes? Or what if your API key accidentally gets leaked through some other way? To mitigate these risks, we provide a set of features to restrict access to your app. These features effectively allow your app to only interact with specified addresses, domains, and IP addresses. In this guide, we'll walk you through how to utilize these restrictions for enhanced security. * * * Restricting Access To Apps -------------------------- Restricting access to your apps means setting up rules that limit which addresses, domains, or IPs can interact with your app or API key. You can set these rules for any app by navigating to the ["Apps" section](https://dashboard.alchemy.com/apps?utm_source=docs&utm_medium=referral&utm_content=how-to-add-allowlists-to-your-apps-for-enhanced-security) in your [Alchemy dashboard](https://dashboard.alchemy.com/signup?utm_source=docs&utm_medium=referral&utm_content=how-to-add-allowlists-to-your-apps-for-enhanced-security) and selecting the app you want to set the rules for. Once you're on the app page, go to the "Security" tab and that's where you can set the rules for your app. Alchemy offers three ways to restrict access: ### 1\. Allowlist Addresses By using the "Allowlist Addresses" feature, you can specify a list of crypto addresses that your app can interact with. This prevents third parties from using your key to interact with contracts or addresses not listed. **Methods Affected** * `eth_call` * `eth_getCode` * `eth_getLogs` * `eth_getStorageAt` #### Steps to Test * Before adding allowlist addresses 1. Use your Alchemy key to make an API request involving an address not intended for the allowlist. ( For example, using [`eth_call`](https://www.alchemy.com/docs/reference/eth-call) to call the `balanceOf` function of an ERC20 token ) 2. Confirm the request works as expected. * After adding allowlist addresses (Note: Updates may take a few minutes to propagate.) 1. Make the same API request again. 2. Confirm that the request fails, thereby confirming the address restriction is working. * * * ### 2\. Allowlist Domains The "Allowlist Domains" feature allows you to specify a list of web domains that can use your API key, thereby preventing third-parties from using your key on their websites. **Notes on Caveats** * If domain whitelist items are set, a missing `Origin` header in the API request will cause the request to fail. * Specifying a parent domain like `wadafada.com` will not automatically allow its subdomains like `ada.wadafada.com`. * Using wildcard notation ( ex. `*.padafada.com` ) for subdomains allows all the subdomains but excludes the parent domain itself ( `padafada.com` ) #### Steps to Test * Before adding allowlist domains 1. Make an API request from a domain not intended for the allowlist. 2. Confirm that the request works as expected. * After adding allowlist domains (Note: Updates may take a few minutes to propagate.) 1. Make an API request from a domain not on the allowlist. 2. Confirm that the request fails, thereby confirming the domain restriction is working. You can also use tools like Postman to manually set the `Origin` header of the request to mimic different domains. * * * ### 3\. Allowlist IPs With the "Allowlist IPs" feature, you can specify IPv4 addresses from which requests can be made using your API key, blocking all others. #### Steps to Test * Before adding whitelist IPs 1. Connect to any VPN server. 2. Test an API request using your Alchemy key. 3. Confirm the request works as expected. * After adding whitelist IPs (Note: Updates may take a few minutes to propagate.) 1. Connect to a non-whitelisted VPN server. 2. Test an API request using your Alchemy key. 3. The request should fail, confirming the IP restriction. * * * Conclusion ---------- In this guide, we've shown you how to secure your Alchemy apps by restricting access via "Allowlist Addresses", "Allowlist Domains", and "Allowlist IPs". Implementing these restrictions will make it much harder for unauthorized users to misuse your API key, allowing you to build more secure applications. Was this page helpful? YesNo --- # How to Get the Number of Transactions in a Block | Alchemy Docs Copy page How to Get the Number of Transactions in a Block ================================================ This is a simple script to teach you how to communicate with the blockchain and read the number of transactions in a block. _This guide assumes you've gone through the [getting started](https://www.alchemy.com/docs/alchemy-quickstart-guide) steps and have an [Alchemy account!](https://dashboard.alchemy.com/signup?utm_source=docs&utm_medium=referral&utm_content=how-to-get-the-number-of-transactions-in-a-block) _ This tutorial uses the **[eth\_getBlockTransactionCountByNumber](https://www.alchemy.com/docs/reference/eth-getblocktransactioncountbynumber) ** endpoint. Each Block in a Blockchain is assigned a block number. It is the unique sequential number for each Block. Follow the steps below to return all transactions in the current finalized Block on Ethereum: 1\. From your command line, create a new project directory and cd into it: -------------------------------------------------------------------------- shell mkdir get-num-block-txns cd get-num-block-txns 2\. Install HTTP client library ------------------------------- You can use any HTTP library of your choosing. In this guide, we will make use of the [Axios](https://www.npmjs.com/package/axios) library for HTTP requests. npm yarn npm install axios 3\. Create a file named index.js and add the following contents: ---------------------------------------------------------------- index.js const options = { method: "POST", url: "https://eth-mainnet.g.alchemy.com/v2/{your-api-key}", headers: { accept: "application/json", "content-type": "application/json" }, data: { id: 1, jsonrpc: "2.0", method: "eth_getBlockTransactionCountByNumber", params: "finalized", }, }; axios .request(options) .then(function (response) { console.log(response.data); }) .catch(function (error) { console.error(error); }); This is an `axios` call, where a POST request is made to the Alchemy API and the `data` sent contains the particular endpoint called method: "eth_getBlockTransactionCountByNumber", And the param which specifies, returning information on the most recent finalized Block: params: "finalized", 4\. Run it using node --------------------- shell node index.js You will see the following response logged to the console: json { jsonrpc: '2.0', id: 1, result: '0xb3' } This response is in HEX. To view it in decimal, you can add a simple convert function to the code: 5\. Converting HEX to Decimal: ------------------------------ javascript function hexToDec(hex) { return parseInt(hex, 16); } Convert the `result` response from Hexademical to Decimal. Target the `result` by updating the response in the then block. index.js result = response.data.result; console.log(hexToDec(result)); The result will be returned as a number in the console: json 179 Once you complete this tutorial, let us know how your experience was or if you have any feedback by tagging us on Twitter [@Alchemy](https://twitter.com/Alchemy) ! 🎉 Was this page helpful? YesNo --- # Debug API Quickstart | Alchemy Docs Copy page Debug API Quickstart ==================== The Debug API provides deeper insights into transaction processing and on-chain activity. To use the Debug API your Alchemy plan must be set to the pay as you go or enterprise tiers. ([Upgrade your plan](https://dashboard.alchemy.com/settings/billing?utm_source=docs&utm_medium=referral&utm_content=reference_debug-api-quickstart) ) for access. Don’t have an API key? Sign up or upgrade your plan for access. [Get started for free](https://dashboard.alchemy.com/signup?utm_source=docs&utm_medium=referral&utm_content=reference_debug-api-quickstart) Introduction ------------ The debug API gives you access to several non-standard RPC methods, which will allow you to inspect and debug transactions. The returned information includes the execution of the following: * `CREATE` * `SUICIDE` * Variants of the `CALL` * Input data * Output data * Gas usage * Amount transferred * Success status of individual actions Debug API use cases ------------------- Common use cases for the Debug API come in all flavors. Below are popular ones: | Use case | Description | Endpoint | | --- | --- | --- | | Debug Trace Call | Executes an [eth\_call](https://www.alchemy.com/docs/reference/eth-call)
and returns number of possible traces for it. | \[`debug_tracecall`\] ([/docs/reference/debug-tracecall](https://www.alchemy.com/docs/reference/debug-tracecall)
) | | Debug Trace Transaction | Returns the traces of a transaction. | \[`debug_traceTransaction`\] ([/docs/reference/debug-tracetransaction](https://www.alchemy.com/docs/reference/debug-tracetransaction)
) | | Debug Trace Block by Number | Returns the traces executed in the block. | \[`debug_traceBlockByNumber`\] ([/docs/reference/debug-traceblockbynumber](https://www.alchemy.com/docs/reference/debug-traceblockbynumber)
) | Trace types ----------- | Type | Parameter | Description | | --- | --- | --- | | Transaction Trace | [`callTracer`](https://www.alchemy.com/docs/reference/trace_call-vs-debug_tracecall#calltracer) | Trace of your transaction. | | State difference | `prestatetracer` | Ethereum state changed values of a transaction. | Trace actions types ------------------- ### `CREATE` * Used to create a smart contract. #### Example response json { "type": "CREATE", "from": "0xe5cb067e90d5cd1f8052b83562ae670ba4a211a8", "to": "0x3c9075f574edc2f630f918ebac5ccf1095d82cc2", "value": "0x0", "gas": "0x26384a", "gasUsed": "0x26384a", "input": "0x611e61600b55600c805460ff19166001179055662386f26fc10000600f5560c06040526005608081905264173539b7b760d91b60a090815262000046916012919062000178565b503480156200005457600080fd5b5060405162002ea038038062002ea08339810160408190526200007791620002eb565b8383620000843362000128565b81516200009990600390602085019062000178565b508051620000af90600490602084019062000178565b506001805550508351620000cb90601090602087019062000178565b508251620000e190601190602086019062000178565b508151620000f790600d90602085019062000178565b50601380546001600160a01b0390921661010002610100600160a81b031990921691909117905550620003da915050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b82805462000186906200039e565b90600052602060002090601f016020900481019282620001aa5760008555620001f5565b82601f10620001c557805160ff1916838001178555620001f5565b82800160010185558215620001f5579182015b82811115620001f5578251825591602001919060010190620001d8565b506200020392915062000207565b5090565b5b8082111562000203576000815560010162000208565b634e487b7160e01b600052604160045260246000fd5b600082601f8301126200024657600080fd5b81516001600160401b03808211156200026357620002636200021e565b604051601f8301601f19908116603f011681019082821181831017156200028e576200028e6200021e565b81604052838152602092508683858801011115620002ab57600080fd5b600091505b83821015620002cf5785820183015181830184015290820190620002b0565b83821115620002e15760008385830101525b9695505050505050565b600080600080608085870312156200030257600080fd5b84516001600160401b03808211156200031a57600080fd5b620003288883890162000234565b955060208701519150808211156200033f57600080fd5b6200034d8883890162000234565b945060408701519150808211156200036457600080fd5b50620003738782880162000234565b606087015190935090506001600160a01b03811681146200039357600080fd5b939692955090935050565b600181811c90821680620003b357607f821691505b602082108103620003d457634e487b7160e01b600052602260045260246000fd5b50919050565b612ab680620003ea6000396000f3fe60806040526004361061029f5760003560e01c8063715018a61161016a578063a45ba8e7116100d5578063e0a8085311610084578063f2fde38b11610061578063f2fde38b146107fd578063f56bce831461081d578063f65747951461083057005b8063e0a8085314610781578063e985e9c5146107a1578063f254933d146107ea57005b8063c23dc68f116100b2578063c23dc68f1461071f578063c87b56dd1461074c578063cfc86f7b1461076c57005b8063a45ba8e7146106ca578063b88d4fde146106df578063bb866a59146106ff57005b806391b7f5ed1161013157806399a2557a1161010e57806399a2557a14610674578063a035b1fe14610694578063a22cb465146106aa57005b806391b7f5ed1461060f57806395d89b411461062f5780639907d22b1461064457005b8063715018a61461055f57806379c127491461057457806381b3e575146105a45780638462151c146105c45780638da5cb5b146105f157005b806342842e0e1161020a57806355f804b3116101d15780635f769621116101ae5780635f769621146105095780636352211e1461051f57806370a082311461053f57005b806355f804b31461049c5780635a446215146104bc5780635bbb2177146104dc57005b806342842e0e1461041a57806343ebf17b1461043a5780634fdd43cb1461044d578063518302271461046d5780635503a0e81461048757005b806316c38b3c1161026657806323b872dd1161024357806323b872dd146103d25780633ccfd60b146103f25780634029a3ce1461040757005b806316c38b3c1461037157806316c61ccc1461039157806318160ddd146103ab57005b806301ffc9a7146102a857806303524005146102dd57806306fdde03146102f7578063081812fc14610319578063095ea7b31461035157005b366102a657005b005b3480156102b457600080fd5b506102c86102c3366004612218565b610843565b60405190151581526020015b60405180910390f35b3480156102e957600080fd5b506013546102c89060ff1681565b34801561030357600080fd5b5061030c610895565b6040516102d4919061228d565b34801561032557600080fd5b506103396103343660046122a0565b610927565b6040516001600160a01b0390911681526020016102d4565b34801561035d57600080fd5b506102a661036c3660046122ce565b61096b565b34801561037d57600080fd5b506102a661038c36600461230f565b610a35565b34801561039d57600080fd5b50600c546102c89060ff1681565b3480156103b757600080fd5b5060025460015403600019015b6040519081526020016102d4565b3480156103de57600080fd5b506102a66103ed36600461232a565b610a95565b3480156103fe57600080fd5b506102a6610c4a565b6102a66104153660046123b7565b610d0f565b34801561042657600080fd5b506102a661043536600461232a565b610e0b565b6102a661044836600461246a565b610e26565b34801561045957600080fd5b506102a6610468366004612588565b610fdc565b34801561047957600080fd5b50600e546102c89060ff1681565b34801561049357600080fd5b5061030c61103b565b3480156104a857600080fd5b506102a66104b7366004612588565b6110c9565b3480156104c857600080fd5b506102a66104d73660046125bd565b611124565b3480156104e857600080fd5b506104fc6104f736600461246a565b611193565b6040516102d49190612621565b34801561051557600080fd5b506103c4600b5481565b34801561052b57600080fd5b5061033961053a3660046122a0565b611261565b34801561054b57600080fd5b506103c461055a36600461269e565b61126c565b34801561056b57600080fd5b506102a66112bb565b34801561058057600080fd5b506102c861058f3660046122a0565b60096020526000908152604090205460ff1681565b3480156105b057600080fd5b506102a66105bf366004612588565b61130f565b3480156105d057600080fd5b506105e46105df36600461269e565b61136a565b6040516102d491906126bb565b3480156105fd57600080fd5b506000546001600160a01b0316610339565b34801561061b57600080fd5b506102a661062a3660046122a0565b611473565b34801561063b57600080fd5b5061030c6114c0565b34801561065057600080fd5b506102c861065f3660046122a0565b60009081526009602052604090205460ff1690565b34801561068057600080fd5b506105e461068f3660046126f3565b6114cf565b3480156106a057600080fd5b506103c4600f5481565b3480156106b657600080fd5b506102a66106c5366004612728565b611657565b3480156106d657600080fd5b5061030c6116ec565b3480156106eb57600080fd5b506102a66106fa36600461275d565b6116f9565b34801561070b57600080fd5b506102a661071a36600461230f565b611743565b34801561072b57600080fd5b5061073f61073a3660046122a0565b61179e565b6040516102d491906127dd565b34801561075857600080fd5b5061030c6107673660046122a0565b611826565b34801561077857600080fd5b5061030c61196b565b34801561078d57600080fd5b506102a661079c36600461230f565b611978565b3480156107ad57600080fd5b506102c86107bc366004612822565b6001600160a01b03918216600090815260086020908152604080832093909416825291909152205460ff1690565b6102a66107f83660046122ce565b6119d3565b34801561080957600080fd5b506102a661081836600461269e565b611a5f565b6102a661082b3660046122a0565b611b15565b6102a661083e3660046122a0565b611bee565b60006301ffc9a760e01b6001600160e01b03198316148061087457506380ac58cd60e01b6001600160e01b03198316145b8061088f5750635b5e139f60e01b6001600160e01b03198316145b92915050565b6060601080546108a49061285b565b80601f01602080910402602001604051908101604052809291908181526020018280546108d09061285b565b801561091d5780601f106108f25761010080835404028352916020019161091d565b820191906000526020600020905b81548152906001019060200180831161090057829003601f168201915b5050505050905090565b600061093282611d47565b61094f576040516333d1c03960e21b815260040160405180910390fd5b506000908152600760205260409020546001600160a01b031690565b600061097682611261565b9050336001600160a01b038216146109cc576001600160a01b038116600090815260086020908152604080832033845290915290205460ff166109cc576040516367d9dca160e11b815260040160405180910390fd5b600082815260076020526040808220805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b6000546001600160a01b03163314610a825760405162461bcd60e51b81526020600482018190526024820152600080516020612a6183398151915260448201526064015b60405180910390fd5b600c805460ff1916911515919091179055565b6000610aa082611d7c565b9050836001600160a01b0316816001600160a01b031614610ad35760405162a1148160e81b815260040160405180910390fd5b60008281526007602052604090208054338082146001600160a01b03881690911417610b3d576001600160a01b038616600090815260086020908152604080832033845290915290205460ff16610b3d57604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b038516610b6457604051633a954ecd60e21b815260040160405180910390fd5b8015610b6f57600082555b6001600160a01b038681166000908152600660205260408082208054600019019055918716808252919020805460010190554260a01b17600160e11b17600085815260056020526040812091909155600160e11b84169003610c0157600184016000818152600560205260408120549003610bff576001548114610bff5760008181526005602052604090208490555b505b83856001600160a01b0316876001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050505050565b6000546001600160a01b03163314610c925760405162461bcd60e51b81526020600482018190526024820152600080516020612a618339815191526044820152606401610a79565b600080546040516001600160a01b03909116914791839083908381818185875af1925050503d8060008114610ce3576040519150601f19603f3d011682016040523d82523d6000602084013e610ce8565b606091505b5050905080610d0a57604051631d42c86760e21b815260040160405180910390fd5b505050565b6000546001600160a01b03163314610d575760405162461bcd60e51b81526020600482018190526024820152600080516020612a618339815191526044820152606401610a79565b60005b83811015610e0457600b54838383818110610d7757610d77612895565b90506020020135610d8b6001546000190190565b610d9591906128c1565b1115610db457604051637d3d824960e01b815260040160405180910390fd5b610dfc858583818110610dc957610dc9612895565b9050602002016020810190610dde919061269e565b848484818110610df057610df0612895565b90506020020135611deb565b600101610d5a565b5050505050565b610d0a838383604051806020016040528060008152506116f9565b600c5460ff1615610e4a5760405163ab35696f60e01b815260040160405180910390fd5b333214610e6a57604051634f19899d60e11b815260040160405180910390fd5b60005b8151811015610fcd5760096000838381518110610e8c57610e8c612895565b60209081029190910181015182528101919091526040016000205460ff1615610ec8576040516330ba573b60e21b815260040160405180910390fd5b6013548251339161010090046001600160a01b031690636352211e90859085908110610ef657610ef6612895565b60200260200101516040518263ffffffff1660e01b8152600401610f1c91815260200190565b602060405180830381865afa158015610f39573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f5d91906128d9565b6001600160a01b031614610f8457604051630e1f609760e31b815260040160405180910390fd5b600160096000848481518110610f9c57610f9c612895565b6020908102919091018101518252810191909152604001600020805460ff1916911515919091179055600101610e6d565b50610fd9338251611deb565b50565b6000546001600160a01b031633146110245760405162461bcd60e51b81526020600482018190526024820152600080516020612a618339815191526044820152606401610a79565b805161103790600d906020840190612169565b5050565b601280546110489061285b565b80601f01602080910402602001604051908101604052809291908181526020018280546110749061285b565b80156110c15780601f10611096576101008083540402835291602001916110c1565b820191906000526020600020905b8154815290600101906020018083116110a457829003601f168201915b505050505081565b6000546001600160a01b031633146111115760405162461bcd60e51b81526020600482018190526024820152600080516020612a618339815191526044820152606401610a79565b805161103790600a906020840190612169565b6000546001600160a01b0316331461116c5760405162461bcd60e51b81526020600482018190526024820152600080516020612a618339815191526044820152606401610a79565b815161117f906010906020850190612169565b508051610d0a906011906020840190612169565b805160609060008167ffffffffffffffff8111156111b3576111b3612423565b60405190808252806020026020018201604052801561120557816020015b6040805160808101825260008082526020808301829052928201819052606082015282526000199092019101816111d15790505b50905060005b8281146112595761123485828151811061122757611227612895565b602002602001015161179e565b82828151811061124657611246612895565b602090810291909101015260010161120b565b509392505050565b600061088f82611d7c565b60006001600160a01b038216611295576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b031660009081526006602052604090205467ffffffffffffffff1690565b6000546001600160a01b031633146113035760405162461bcd60e51b81526020600482018190526024820152600080516020612a618339815191526044820152606401610a79565b61130d6000611ecb565b565b6000546001600160a01b031633146113575760405162461bcd60e51b81526020600482018190526024820152600080516020612a618339815191526044820152606401610a79565b8051611037906012906020840190612169565b6060600080600061137a8561126c565b905060008167ffffffffffffffff81111561139757611397612423565b6040519080825280602002602001820160405280156113c0578160200160208202803683370190505b5090506113ed60408051608081018252600080825260208201819052918101829052606081019190915290565b60015b8386146114675761140081611f28565b9150816040015161145f5781516001600160a01b03161561142057815194505b876001600160a01b0316856001600160a01b03160361145f578083878060010198508151811061145257611452612895565b6020026020010181815250505b6001016113f0565b50909695505050505050565b6000546001600160a01b031633146114bb5760405162461bcd60e51b81526020600482018190526024820152600080516020612a618339815191526044820152606401610a79565b600f55565b6060601180546108a49061285b565b60608183106114f157604051631960ccad60e11b815260040160405180910390fd5b6000806114fd60015490565b9050600185101561150d57600194505b80841115611519578093505b60006115248761126c565b905084861015611543578585038181101561153d578091505b50611547565b5060005b60008167ffffffffffffffff81111561156257611562612423565b60405190808252806020026020018201604052801561158b578160200160208202803683370190505b509050816000036115a157935061165092505050565b60006115ac8861179e565b9050600081604001516115bd575080515b885b8881141580156115cf5750848714155b15611644576115dd81611f28565b9250826040015161163c5782516001600160a01b0316156115fd57825191505b8a6001600160a01b0316826001600160a01b03160361163c578084888060010199508151811061162f5761162f612895565b6020026020010181815250505b6001016115bf565b50505092835250909150505b9392505050565b336001600160a01b038316036116805760405163b06307db60e01b815260040160405180910390fd5b3360008181526008602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b600d80546110489061285b565b611704848484610a95565b6001600160a01b0383163b1561173d5761172084848484611fa7565b61173d576040516368d2bf6b60e11b815260040160405180910390fd5b50505050565b6000546001600160a01b0316331461178b5760405162461bcd60e51b81526020600482018190526024820152600080516020612a618339815191526044820152606401610a79565b6013805460ff1916911515919091179055565b60408051608081018252600080825260208201819052918101829052606081019190915260408051608081018252600080825260208201819052918101829052606081019190915260018310806117f757506001548310155b156118025792915050565b61180b83611f28565b905080604001511561181d5792915050565b61165083612093565b606061183182611d47565b61184e57604051631c29085d60e11b815260040160405180910390fd5b600e5460ff16151560000361189257600d6118688361210b565b601260405160200161187c9392919061298f565b6040516020818303038152906040529050919050565b600061189c61215a565b9050600081511161193757600d80546118b49061285b565b80601f01602080910402602001604051908101604052809291908181526020018280546118e09061285b565b801561192d5780601f106119025761010080835404028352916020019161192d565b820191906000526020600020905b81548152906001019060200180831161191057829003601f168201915b5050505050611650565b806119418461210b565b6012604051602001611955939291906129c2565b6040516020818303038152906040529392505050565b600a80546110489061285b565b6000546001600160a01b031633146119c05760405162461bcd60e51b81526020600482018190526024820152600080516020612a618339815191526044820152606401610a79565b600e805460ff1916911515919091179055565b6000546001600160a01b03163314611a1b5760405162461bcd60e51b81526020600482018190526024820152600080516020612a618339815191526044820152606401610a79565b600b5481611a2c6001546000190190565b611a3691906128c1565b1115611a5557604051637d3d824960e01b815260040160405180910390fd5b6110378282611deb565b6000546001600160a01b03163314611aa75760405162461bcd60e51b81526020600482018190526024820152600080516020612a618339815191526044820152606401610a79565b6001600160a01b038116611b0c5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610a79565b610fd981611ecb565b600c5460ff1615611b395760405163ab35696f60e01b815260040160405180910390fd5b333214611b5957604051634f19899d60e11b815260040160405180910390fd5b60135460ff16611b7c5760405163ac4d09c760e01b815260040160405180910390fd5b600b5481611b8d6001546000190190565b611b9791906128c1565b1115611bb657604051637d3d824960e01b815260040160405180910390fd5b80600f54611bc491906129e8565b341015611be4576040516335c20e3960e11b815260040160405180910390fd5b610fd93382611deb565b600c5460ff1615611c125760405163ab35696f60e01b815260040160405180910390fd5b333214611c3257604051634f19899d60e11b815260040160405180910390fd5b600b546001541115611c5757604051637d3d824960e01b815260040160405180910390fd5b60008181526009602052604090205460ff1615611c87576040516330ba573b60e21b815260040160405180910390fd5b6013546040516331a9108f60e11b815260048101839052339161010090046001600160a01b031690636352211e90602401602060405180830381865afa158015611cd5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cf991906128d9565b6001600160a01b031614611d2057604051630e1f609760e31b815260040160405180910390fd5b6000818152600960205260409020805460ff19166001908117909155610fd9903390611deb565b600081600111158015611d5b575060015482105b801561088f575050600090815260056020526040902054600160e01b161590565b60008180600111611dd257600154811015611dd25760008181526005602052604081205490600160e01b82169003611dd0575b80600003611650575060001901600081815260056020526040902054611daf565b505b604051636f96cda160e11b815260040160405180910390fd5b6001546001600160a01b038316611e1457604051622e076360e81b815260040160405180910390fd5b81600003611e355760405163b562e8dd60e01b815260040160405180910390fd5b6001600160a01b038316600081815260066020526040902080546801000000000000000185020190554260a01b6001841460e11b1717600082815260056020526040902055808281015b6040516001830192906001600160a01b038716906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a4808210611e7f5760015550505050565b600080546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60408051608081018252600080825260208201819052918101829052606081019190915260008281526005602052604090205461088f90604080516080810182526001600160a01b038316815260a083901c67ffffffffffffffff166020820152600160e01b831615159181019190915260e89190911c606082015290565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a0290611fdc903390899088908890600401612a07565b6020604051808303816000875af1925050508015612017575060408051601f3d908101601f1916820190925261201491810190612a43565b60015b612075573d808015612045576040519150601f19603f3d011682016040523d82523d6000602084013e61204a565b606091505b50805160000361206d576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490505b949350505050565b60408051608081018252600080825260208201819052918101829052606081019190915261088f6120c383611d7c565b604080516080810182526001600160a01b038316815260a083901c67ffffffffffffffff166020820152600160e01b831615159181019190915260e89190911c606082015290565b604080516080810191829052607f0190826030600a8206018353600a90045b801561214857600183039250600a81066030018353600a900461212a565b50819003601f19909101908152919050565b6060600a80546108a49061285b565b8280546121759061285b565b90600052602060002090601f01602090048101928261219757600085556121dd565b82601f106121b057805160ff19168380011785556121dd565b828001600101855582156121dd579182015b828111156121dd5782518255916020019190600101906121c2565b506121e99291506121ed565b5090565b5b808211156121e957600081556001016121ee565b6001600160e01b031981168114610fd957600080fd5b60006020828403121561222a57600080fd5b813561165081612202565b60005b83811015612250578181015183820152602001612238565b8381111561173d5750506000910152565b60008151808452612279816020860160208601612235565b601f01601f19169290920160200192915050565b6020815260006116506020830184612261565b6000602082840312156122b257600080fd5b5035919050565b6001600160a01b0381168114610fd957600080fd5b600080604083850312156122e157600080fd5b82356122ec816122b9565b946020939093013593505050565b8035801515811461230a57600080fd5b919050565b60006020828403121561232157600080fd5b611650826122fa565b60008060006060848603121561233f57600080fd5b833561234a816122b9565b9250602084013561235a816122b9565b929592945050506040919091013590565b60008083601f84011261237d57600080fd5b50813567ffffffffffffffff81111561239557600080fd5b6020830191508360208260051b85010111156123b057600080fd5b9250929050565b600080600080604085870312156123cd57600080fd5b843567ffffffffffffffff808211156123e557600080fd5b6123f18883890161236b565b9096509450602087013591508082111561240a57600080fd5b506124178782880161236b565b95989497509550505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561246257612462612423565b604052919050565b6000602080838503121561247d57600080fd5b823567ffffffffffffffff8082111561249557600080fd5b818501915085601f8301126124a957600080fd5b8135818111156124bb576124bb612423565b8060051b91506124cc848301612439565b81815291830184019184810190888411156124e657600080fd5b938501935b83851015612504578435825293850193908501906124eb565b98975050505050505050565b600067ffffffffffffffff83111561252a5761252a612423565b61253d601f8401601f1916602001612439565b905082815283838301111561255157600080fd5b828260208301376000602084830101529392505050565b600082601f83011261257957600080fd5b61165083833560208501612510565b60006020828403121561259a57600080fd5b813567ffffffffffffffff8111156125b157600080fd5b61208b84828501612568565b600080604083850312156125d057600080fd5b823567ffffffffffffffff808211156125e857600080fd5b6125f486838701612568565b9350602085013591508082111561260a57600080fd5b5061261785828601612568565b9150509250929050565b6020808252825182820181905260009190848201906040850190845b818110156114675761268b8385516001600160a01b03815116825267ffffffffffffffff602082015116602083015260408101511515604083015262ffffff60608201511660608301525050565b928401926080929092019160010161263d565b6000602082840312156126b057600080fd5b8135611650816122b9565b6020808252825182820181905260009190848201906040850190845b81811015611467578351835292840192918401916001016126d7565b60008060006060848603121561270857600080fd5b8335612713816122b9565b95602085013595506040909401359392505050565b6000806040838503121561273b57600080fd5b8235612746816122b9565b9150612754602084016122fa565b90509250929050565b6000806000806080858703121561277357600080fd5b843561277e816122b9565b9350602085013561278e816122b9565b925060408501359150606085013567ffffffffffffffff8111156127b157600080fd5b8501601f810187136127c257600080fd5b6127d187823560208401612510565b91505092959194509250565b81516001600160a01b0316815260208083015167ffffffffffffffff169082015260408083015115159082015260608083015162ffffff16908201526080810161088f565b6000806040838503121561283557600080fd5b8235612840816122b9565b91506020830135612850816122b9565b809150509250929050565b600181811c9082168061286f57607f821691505b60208210810361288f57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600082198211156128d4576128d46128ab565b500190565b6000602082840312156128eb57600080fd5b8151611650816122b9565b8054600090600181811c908083168061291057607f831692505b6020808410820361293157634e487b7160e01b600052602260045260246000fd5b818015612945576001811461295657612983565b60ff19861689528489019650612983565b60008881526020902060005b8681101561297b5781548b820152908501908301612962565b505084890196505b50505050505092915050565b600061299b82866128f6565b84516129ab818360208901612235565b6129b7818301866128f6565b979650505050505050565b600084516129d4818460208901612235565b8451908301906129ab818360208901612235565b6000816000190483118215151615612a0257612a026128ab565b500290565b60006001600160a01b03808716835280861660208401525083604083015260806060830152612a396080830184612261565b9695505050505050565b600060208284031215612a5557600080fd5b81516116508161220256fe4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a2646970667358221220e104c159fe21a1728dc6323c64435ac8be0154e68f1e538673f6747fa16a941a64736f6c634300080d0033000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000007350271594848ab8c0371ef4afeef199c69c3e05000000000000000000000000000000000000000000000000000000000000001147756e736c696e67657220486f72736573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000248530000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000036697066733a2f2f516d617569345166576e78633846596265534e76427044485074627347366e4456695668723233465459766758532f00000000000000000000", "output": "0x60806040526004361061029f5760003560e01c8063715018a61161016a578063a45ba8e7116100d5578063e0a8085311610084578063f2fde38b11610061578063f2fde38b146107fd578063f56bce831461081d578063f65747951461083057005b8063e0a8085314610781578063e985e9c5146107a1578063f254933d146107ea57005b8063c23dc68f116100b2578063c23dc68f1461071f578063c87b56dd1461074c578063cfc86f7b1461076c57005b8063a45ba8e7146106ca578063b88d4fde146106df578063bb866a59146106ff57005b806391b7f5ed1161013157806399a2557a1161010e57806399a2557a14610674578063a035b1fe14610694578063a22cb465146106aa57005b806391b7f5ed1461060f57806395d89b411461062f5780639907d22b1461064457005b8063715018a61461055f57806379c127491461057457806381b3e575146105a45780638462151c146105c45780638da5cb5b146105f157005b806342842e0e1161020a57806355f804b3116101d15780635f769621116101ae5780635f769621146105095780636352211e1461051f57806370a082311461053f57005b806355f804b31461049c5780635a446215146104bc5780635bbb2177146104dc57005b806342842e0e1461041a57806343ebf17b1461043a5780634fdd43cb1461044d578063518302271461046d5780635503a0e81461048757005b806316c38b3c1161026657806323b872dd1161024357806323b872dd146103d25780633ccfd60b146103f25780634029a3ce1461040757005b806316c38b3c1461037157806316c61ccc1461039157806318160ddd146103ab57005b806301ffc9a7146102a857806303524005146102dd57806306fdde03146102f7578063081812fc14610319578063095ea7b31461035157005b366102a657005b005b3480156102b457600080fd5b506102c86102c3366004612218565b610843565b60405190151581526020015b60405180910390f35b3480156102e957600080fd5b506013546102c89060ff1681565b34801561030357600080fd5b5061030c610895565b6040516102d4919061228d565b34801561032557600080fd5b506103396103343660046122a0565b610927565b6040516001600160a01b0390911681526020016102d4565b34801561035d57600080fd5b506102a661036c3660046122ce565b61096b565b34801561037d57600080fd5b506102a661038c36600461230f565b610a35565b34801561039d57600080fd5b50600c546102c89060ff1681565b3480156103b757600080fd5b5060025460015403600019015b6040519081526020016102d4565b3480156103de57600080fd5b506102a66103ed36600461232a565b610a95565b3480156103fe57600080fd5b506102a6610c4a565b6102a66104153660046123b7565b610d0f565b34801561042657600080fd5b506102a661043536600461232a565b610e0b565b6102a661044836600461246a565b610e26565b34801561045957600080fd5b506102a6610468366004612588565b610fdc565b34801561047957600080fd5b50600e546102c89060ff1681565b34801561049357600080fd5b5061030c61103b565b3480156104a857600080fd5b506102a66104b7366004612588565b6110c9565b3480156104c857600080fd5b506102a66104d73660046125bd565b611124565b3480156104e857600080fd5b506104fc6104f736600461246a565b611193565b6040516102d49190612621565b34801561051557600080fd5b506103c4600b5481565b34801561052b57600080fd5b5061033961053a3660046122a0565b611261565b34801561054b57600080fd5b506103c461055a36600461269e565b61126c565b34801561056b57600080fd5b506102a66112bb565b34801561058057600080fd5b506102c861058f3660046122a0565b60096020526000908152604090205460ff1681565b3480156105b057600080fd5b506102a66105bf366004612588565b61130f565b3480156105d057600080fd5b506105e46105df36600461269e565b61136a565b6040516102d491906126bb565b3480156105fd57600080fd5b506000546001600160a01b0316610339565b34801561061b57600080fd5b506102a661062a3660046122a0565b611473565b34801561063b57600080fd5b5061030c6114c0565b34801561065057600080fd5b506102c861065f3660046122a0565b60009081526009602052604090205460ff1690565b34801561068057600080fd5b506105e461068f3660046126f3565b6114cf565b3480156106a057600080fd5b506103c4600f5481565b3480156106b657600080fd5b506102a66106c5366004612728565b611657565b3480156106d657600080fd5b5061030c6116ec565b3480156106eb57600080fd5b506102a66106fa36600461275d565b6116f9565b34801561070b57600080fd5b506102a661071a36600461230f565b611743565b34801561072b57600080fd5b5061073f61073a3660046122a0565b61179e565b6040516102d491906127dd565b34801561075857600080fd5b5061030c6107673660046122a0565b611826565b34801561077857600080fd5b5061030c61196b565b34801561078d57600080fd5b506102a661079c36600461230f565b611978565b3480156107ad57600080fd5b506102c86107bc366004612822565b6001600160a01b03918216600090815260086020908152604080832093909416825291909152205460ff1690565b6102a66107f83660046122ce565b6119d3565b34801561080957600080fd5b506102a661081836600461269e565b611a5f565b6102a661082b3660046122a0565b611b15565b6102a661083e3660046122a0565b611bee565b60006301ffc9a760e01b6001600160e01b03198316148061087457506380ac58cd60e01b6001600160e01b03198316145b8061088f5750635b5e139f60e01b6001600160e01b03198316145b92915050565b6060601080546108a49061285b565b80601f01602080910402602001604051908101604052809291908181526020018280546108d09061285b565b801561091d5780601f106108f25761010080835404028352916020019161091d565b820191906000526020600020905b81548152906001019060200180831161090057829003601f168201915b5050505050905090565b600061093282611d47565b61094f576040516333d1c03960e21b815260040160405180910390fd5b506000908152600760205260409020546001600160a01b031690565b600061097682611261565b9050336001600160a01b038216146109cc576001600160a01b038116600090815260086020908152604080832033845290915290205460ff166109cc576040516367d9dca160e11b815260040160405180910390fd5b600082815260076020526040808220805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b6000546001600160a01b03163314610a825760405162461bcd60e51b81526020600482018190526024820152600080516020612a6183398151915260448201526064015b60405180910390fd5b600c805460ff1916911515919091179055565b6000610aa082611d7c565b9050836001600160a01b0316816001600160a01b031614610ad35760405162a1148160e81b815260040160405180910390fd5b60008281526007602052604090208054338082146001600160a01b03881690911417610b3d576001600160a01b038616600090815260086020908152604080832033845290915290205460ff16610b3d57604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b038516610b6457604051633a954ecd60e21b815260040160405180910390fd5b8015610b6f57600082555b6001600160a01b038681166000908152600660205260408082208054600019019055918716808252919020805460010190554260a01b17600160e11b17600085815260056020526040812091909155600160e11b84169003610c0157600184016000818152600560205260408120549003610bff576001548114610bff5760008181526005602052604090208490555b505b83856001600160a01b0316876001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050505050565b6000546001600160a01b03163314610c925760405162461bcd60e51b81526020600482018190526024820152600080516020612a618339815191526044820152606401610a79565b600080546040516001600160a01b03909116914791839083908381818185875af1925050503d8060008114610ce3576040519150601f19603f3d011682016040523d82523d6000602084013e610ce8565b606091505b5050905080610d0a57604051631d42c86760e21b815260040160405180910390fd5b505050565b6000546001600160a01b03163314610d575760405162461bcd60e51b81526020600482018190526024820152600080516020612a618339815191526044820152606401610a79565b60005b83811015610e0457600b54838383818110610d7757610d77612895565b90506020020135610d8b6001546000190190565b610d9591906128c1565b1115610db457604051637d3d824960e01b815260040160405180910390fd5b610dfc858583818110610dc957610dc9612895565b9050602002016020810190610dde919061269e565b848484818110610df057610df0612895565b90506020020135611deb565b600101610d5a565b5050505050565b610d0a838383604051806020016040528060008152506116f9565b600c5460ff1615610e4a5760405163ab35696f60e01b815260040160405180910390fd5b333214610e6a57604051634f19899d60e11b815260040160405180910390fd5b60005b8151811015610fcd5760096000838381518110610e8c57610e8c612895565b60209081029190910181015182528101919091526040016000205460ff1615610ec8576040516330ba573b60e21b815260040160405180910390fd5b6013548251339161010090046001600160a01b031690636352211e90859085908110610ef657610ef6612895565b60200260200101516040518263ffffffff1660e01b8152600401610f1c91815260200190565b602060405180830381865afa158015610f39573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f5d91906128d9565b6001600160a01b031614610f8457604051630e1f609760e31b815260040160405180910390fd5b600160096000848481518110610f9c57610f9c612895565b6020908102919091018101518252810191909152604001600020805460ff1916911515919091179055600101610e6d565b50610fd9338251611deb565b50565b6000546001600160a01b031633146110245760405162461bcd60e51b81526020600482018190526024820152600080516020612a618339815191526044820152606401610a79565b805161103790600d906020840190612169565b5050565b601280546110489061285b565b80601f01602080910402602001604051908101604052809291908181526020018280546110749061285b565b80156110c15780601f10611096576101008083540402835291602001916110c1565b820191906000526020600020905b8154815290600101906020018083116110a457829003601f168201915b505050505081565b6000546001600160a01b031633146111115760405162461bcd60e51b81526020600482018190526024820152600080516020612a618339815191526044820152606401610a79565b805161103790600a906020840190612169565b6000546001600160a01b0316331461116c5760405162461bcd60e51b81526020600482018190526024820152600080516020612a618339815191526044820152606401610a79565b815161117f906010906020850190612169565b508051610d0a906011906020840190612169565b805160609060008167ffffffffffffffff8111156111b3576111b3612423565b60405190808252806020026020018201604052801561120557816020015b6040805160808101825260008082526020808301829052928201819052606082015282526000199092019101816111d15790505b50905060005b8281146112595761123485828151811061122757611227612895565b602002602001015161179e565b82828151811061124657611246612895565b602090810291909101015260010161120b565b509392505050565b600061088f82611d7c565b60006001600160a01b038216611295576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b031660009081526006602052604090205467ffffffffffffffff1690565b6000546001600160a01b031633146113035760405162461bcd60e51b81526020600482018190526024820152600080516020612a618339815191526044820152606401610a79565b61130d6000611ecb565b565b6000546001600160a01b031633146113575760405162461bcd60e51b81526020600482018190526024820152600080516020612a618339815191526044820152606401610a79565b8051611037906012906020840190612169565b6060600080600061137a8561126c565b905060008167ffffffffffffffff81111561139757611397612423565b6040519080825280602002602001820160405280156113c0578160200160208202803683370190505b5090506113ed60408051608081018252600080825260208201819052918101829052606081019190915290565b60015b8386146114675761140081611f28565b9150816040015161145f5781516001600160a01b03161561142057815194505b876001600160a01b0316856001600160a01b03160361145f578083878060010198508151811061145257611452612895565b6020026020010181815250505b6001016113f0565b50909695505050505050565b6000546001600160a01b031633146114bb5760405162461bcd60e51b81526020600482018190526024820152600080516020612a618339815191526044820152606401610a79565b600f55565b6060601180546108a49061285b565b60608183106114f157604051631960ccad60e11b815260040160405180910390fd5b6000806114fd60015490565b9050600185101561150d57600194505b80841115611519578093505b60006115248761126c565b905084861015611543578585038181101561153d578091505b50611547565b5060005b60008167ffffffffffffffff81111561156257611562612423565b60405190808252806020026020018201604052801561158b578160200160208202803683370190505b509050816000036115a157935061165092505050565b60006115ac8861179e565b9050600081604001516115bd575080515b885b8881141580156115cf5750848714155b15611644576115dd81611f28565b9250826040015161163c5782516001600160a01b0316156115fd57825191505b8a6001600160a01b0316826001600160a01b03160361163c578084888060010199508151811061162f5761162f612895565b6020026020010181815250505b6001016115bf565b50505092835250909150505b9392505050565b336001600160a01b038316036116805760405163b06307db60e01b815260040160405180910390fd5b3360008181526008602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b600d80546110489061285b565b611704848484610a95565b6001600160a01b0383163b1561173d5761172084848484611fa7565b61173d576040516368d2bf6b60e11b815260040160405180910390fd5b50505050565b6000546001600160a01b0316331461178b5760405162461bcd60e51b81526020600482018190526024820152600080516020612a618339815191526044820152606401610a79565b6013805460ff1916911515919091179055565b60408051608081018252600080825260208201819052918101829052606081019190915260408051608081018252600080825260208201819052918101829052606081019190915260018310806117f757506001548310155b156118025792915050565b61180b83611f28565b905080604001511561181d5792915050565b61165083612093565b606061183182611d47565b61184e57604051631c29085d60e11b815260040160405180910390fd5b600e5460ff16151560000361189257600d6118688361210b565b601260405160200161187c9392919061298f565b6040516020818303038152906040529050919050565b600061189c61215a565b9050600081511161193757600d80546118b49061285b565b80601f01602080910402602001604051908101604052809291908181526020018280546118e09061285b565b801561192d5780601f106119025761010080835404028352916020019161192d565b820191906000526020600020905b81548152906001019060200180831161191057829003601f168201915b5050505050611650565b806119418461210b565b6012604051602001611955939291906129c2565b6040516020818303038152906040529392505050565b600a80546110489061285b565b6000546001600160a01b031633146119c05760405162461bcd60e51b81526020600482018190526024820152600080516020612a618339815191526044820152606401610a79565b600e805460ff1916911515919091179055565b6000546001600160a01b03163314611a1b5760405162461bcd60e51b81526020600482018190526024820152600080516020612a618339815191526044820152606401610a79565b600b5481611a2c6001546000190190565b611a3691906128c1565b1115611a5557604051637d3d824960e01b815260040160405180910390fd5b6110378282611deb565b6000546001600160a01b03163314611aa75760405162461bcd60e51b81526020600482018190526024820152600080516020612a618339815191526044820152606401610a79565b6001600160a01b038116611b0c5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610a79565b610fd981611ecb565b600c5460ff1615611b395760405163ab35696f60e01b815260040160405180910390fd5b333214611b5957604051634f19899d60e11b815260040160405180910390fd5b60135460ff16611b7c5760405163ac4d09c760e01b815260040160405180910390fd5b600b5481611b8d6001546000190190565b611b9791906128c1565b1115611bb657604051637d3d824960e01b815260040160405180910390fd5b80600f54611bc491906129e8565b341015611be4576040516335c20e3960e11b815260040160405180910390fd5b610fd93382611deb565b600c5460ff1615611c125760405163ab35696f60e01b815260040160405180910390fd5b333214611c3257604051634f19899d60e11b815260040160405180910390fd5b600b546001541115611c5757604051637d3d824960e01b815260040160405180910390fd5b60008181526009602052604090205460ff1615611c87576040516330ba573b60e21b815260040160405180910390fd5b6013546040516331a9108f60e11b815260048101839052339161010090046001600160a01b031690636352211e90602401602060405180830381865afa158015611cd5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cf991906128d9565b6001600160a01b031614611d2057604051630e1f609760e31b815260040160405180910390fd5b6000818152600960205260409020805460ff19166001908117909155610fd9903390611deb565b600081600111158015611d5b575060015482105b801561088f575050600090815260056020526040902054600160e01b161590565b60008180600111611dd257600154811015611dd25760008181526005602052604081205490600160e01b82169003611dd0575b80600003611650575060001901600081815260056020526040902054611daf565b505b604051636f96cda160e11b815260040160405180910390fd5b6001546001600160a01b038316611e1457604051622e076360e81b815260040160405180910390fd5b81600003611e355760405163b562e8dd60e01b815260040160405180910390fd5b6001600160a01b038316600081815260066020526040902080546801000000000000000185020190554260a01b6001841460e11b1717600082815260056020526040902055808281015b6040516001830192906001600160a01b038716906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a4808210611e7f5760015550505050565b600080546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60408051608081018252600080825260208201819052918101829052606081019190915260008281526005602052604090205461088f90604080516080810182526001600160a01b038316815260a083901c67ffffffffffffffff166020820152600160e01b831615159181019190915260e89190911c606082015290565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a0290611fdc903390899088908890600401612a07565b6020604051808303816000875af1925050508015612017575060408051601f3d908101601f1916820190925261201491810190612a43565b60015b612075573d808015612045576040519150601f19603f3d011682016040523d82523d6000602084013e61204a565b606091505b50805160000361206d576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490505b949350505050565b60408051608081018252600080825260208201819052918101829052606081019190915261088f6120c383611d7c565b604080516080810182526001600160a01b038316815260a083901c67ffffffffffffffff166020820152600160e01b831615159181019190915260e89190911c606082015290565b604080516080810191829052607f0190826030600a8206018353600a90045b801561214857600183039250600a81066030018353600a900461212a565b50819003601f19909101908152919050565b6060600a80546108a49061285b565b8280546121759061285b565b90600052602060002090601f01602090048101928261219757600085556121dd565b82601f106121b057805160ff19168380011785556121dd565b828001600101855582156121dd579182015b828111156121dd5782518255916020019190600101906121c2565b506121e99291506121ed565b5090565b5b808211156121e957600081556001016121ee565b6001600160e01b031981168114610fd957600080fd5b60006020828403121561222a57600080fd5b813561165081612202565b60005b83811015612250578181015183820152602001612238565b8381111561173d5750506000910152565b60008151808452612279816020860160208601612235565b601f01601f19169290920160200192915050565b6020815260006116506020830184612261565b6000602082840312156122b257600080fd5b5035919050565b6001600160a01b0381168114610fd957600080fd5b600080604083850312156122e157600080fd5b82356122ec816122b9565b946020939093013593505050565b8035801515811461230a57600080fd5b919050565b60006020828403121561232157600080fd5b611650826122fa565b60008060006060848603121561233f57600080fd5b833561234a816122b9565b9250602084013561235a816122b9565b929592945050506040919091013590565b60008083601f84011261237d57600080fd5b50813567ffffffffffffffff81111561239557600080fd5b6020830191508360208260051b85010111156123b057600080fd5b9250929050565b600080600080604085870312156123cd57600080fd5b843567ffffffffffffffff808211156123e557600080fd5b6123f18883890161236b565b9096509450602087013591508082111561240a57600080fd5b506124178782880161236b565b95989497509550505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561246257612462612423565b604052919050565b6000602080838503121561247d57600080fd5b823567ffffffffffffffff8082111561249557600080fd5b818501915085601f8301126124a957600080fd5b8135818111156124bb576124bb612423565b8060051b91506124cc848301612439565b81815291830184019184810190888411156124e657600080fd5b938501935b83851015612504578435825293850193908501906124eb565b98975050505050505050565b600067ffffffffffffffff83111561252a5761252a612423565b61253d601f8401601f1916602001612439565b905082815283838301111561255157600080fd5b828260208301376000602084830101529392505050565b600082601f83011261257957600080fd5b61165083833560208501612510565b60006020828403121561259a57600080fd5b813567ffffffffffffffff8111156125b157600080fd5b61208b84828501612568565b600080604083850312156125d057600080fd5b823567ffffffffffffffff808211156125e857600080fd5b6125f486838701612568565b9350602085013591508082111561260a57600080fd5b5061261785828601612568565b9150509250929050565b6020808252825182820181905260009190848201906040850190845b818110156114675761268b8385516001600160a01b03815116825267ffffffffffffffff602082015116602083015260408101511515604083015262ffffff60608201511660608301525050565b928401926080929092019160010161263d565b6000602082840312156126b057600080fd5b8135611650816122b9565b6020808252825182820181905260009190848201906040850190845b81811015611467578351835292840192918401916001016126d7565b60008060006060848603121561270857600080fd5b8335612713816122b9565b95602085013595506040909401359392505050565b6000806040838503121561273b57600080fd5b8235612746816122b9565b9150612754602084016122fa565b90509250929050565b6000806000806080858703121561277357600080fd5b843561277e816122b9565b9350602085013561278e816122b9565b925060408501359150606085013567ffffffffffffffff8111156127b157600080fd5b8501601f810187136127c257600080fd5b6127d187823560208401612510565b91505092959194509250565b81516001600160a01b0316815260208083015167ffffffffffffffff169082015260408083015115159082015260608083015162ffffff16908201526080810161088f565b6000806040838503121561283557600080fd5b8235612840816122b9565b91506020830135612850816122b9565b809150509250929050565b600181811c9082168061286f57607f821691505b60208210810361288f57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600082198211156128d4576128d46128ab565b500190565b6000602082840312156128eb57600080fd5b8151611650816122b9565b8054600090600181811c908083168061291057607f831692505b6020808410820361293157634e487b7160e01b600052602260045260246000fd5b818015612945576001811461295657612983565b60ff19861689528489019650612983565b60008881526020902060005b8681101561297b5781548b820152908501908301612962565b505084890196505b50505050505092915050565b600061299b82866128f6565b84516129ab818360208901612235565b6129b7818301866128f6565b979650505050505050565b600084516129d4818460208901612235565b8451908301906129ab818360208901612235565b6000816000190483118215151615612a0257612a026128ab565b500290565b60006001600160a01b03808716835280861660208401525083604083015260806060830152612a396080830184612261565b9695505050505050565b600060208284031215612a5557600080fd5b81516116508161220256fe4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a2646970667358221220e104c159fe21a1728dc6323c64435ac8be0154e68f1e538673f6747fa16a941a64736f6c634300080d0033" } **Create parameter definitions** | Parameter | Description | Example | | --- | --- | --- | | `from` | The address that created the contract. | `0xe5cb067e90d5cd1f8052b83562ae670ba4a211a8` | | `gas` | Contract gas fee to create the contract. | `0x26384a` | | `input` | Initialization code to create the contract. | `0x6060604052604051602080610516833981016040...` | | `value` | The value sent to the contract. | `0x0` | | `to` | Location address of the new contract. | `0x3c9075f574edc2f630f918ebac5ccf1095d82cc2` | | `output` | The contract code. | `0x60806040526004361061029f5760003560e01c806371501...` | | `gasUsed` | Required fee (gas) to create the contract. | `0x26384a` | | `type` | Type of operation code (OPCODE). | `CREATE` | ### `SUICIDE` * `SUICIDE` is captured when a smart contract is destroyed. That is when the [selfdestruct](https://solidity-by-example.org/hacks/self-destruct/) function of Solidity is used. * `SUICIDE` transfers the contract's balance to the `address` specified in the `selfdestruct` function clearing on-chain memory. * The cleared memory is processed as a refund of the total gas cost to complete the transaction. #### Example response json { "type": "SELFDESTRUCT", "from": "0x87051f6ba0562fdb0485763562bf34cb2ad705b1", "to": "0x000000000000000000000000000000000000dead", "value": "0x0", "gas": "0x0", "gasUsed": "0x0", "input": "0x", "output": "0x" } **SUICIDE parameter definitions** | Parameter | Description | Example | | --- | --- | --- | | `from` | The address of contract destroyed. | `0x87051f6ba0562fdb0485763562bf34cb2ad705b1` | | `to` | Address to send the remainder of contract `balance`. | `0x000000000000000000000000000000000000dead` | | `value` | Value sent with the given transaction. | `0x0` | | `gas` | Gas fee for the given trace action (SUICIDE trace actions do not cost any gas to be executed) | `0x0` | | `gasUsed` | Required fee (gas) to execute the given trace action. | `0x0` | | `input` | `null` for `SUICIDE` | `0x0` | | `output` | `null` for `SUICIDE` | `0x0` | | `type` | Type of operation code (OPCODE). | `SUICIDE` | ### `CALL` * `CALL` is used for transferring ETH between [externally owned accounts](https://www.alchemy.com/docs/web3-glossary#externally-owned-account) (EOAs). * Also used to `CALL` a smart contract function. #### Example response json { "type": "CALL", "from": "0xdead682186dff1408c169b7b36974af55d8c8473", "to": "0x6066150a2070cc165222141b47fd2ba0642b57a1", "value": "0x0", "gas": "0x173a8", "gasUsed": "0x124b0", "input": "0x15b6a37100000000000000000000000098b17e440c844e1d0f99897145828d3cd91890761e59117ba15350e0740348cfd4378065bce49b9951cbdd5fe19ebb2181e9bde0", "output": "0x", "calls": [\ {\ "type": "CALL",\ "from": "0x6066150a2070cc165222141b47fd2ba0642b57a1",\ "to": "0x6090a6e47849629b7245dfa1ca21d94cd15878ef",\ "value": "0x0",\ "gas": "0x165cf",\ "gasUsed": "0x3f4",\ "input": "0x5e43170900000000000000000000000098b17e440c844e1d0f99897145828d3cd91890761e59117ba15350e0740348cfd4378065bce49b9951cbdd5fe19ebb2181e9bddf",\ "output": "0x00000000000000000000000087051f6ba0562fdb0485763562bf34cb2ad705b1"\ }\ ] } **`CALL` parameter definitions** | Parameter | Description | Example | | --- | --- | --- | | `from` | Address of the sender. | `0xdead682186dff1408c169b7b36974af55d8c8473` | | `callType` | The type of `CALL`. | `CALL` | | `gas` | The gas included in the transaction. | `0x173a8` | | `input` | Specific call function on the contract. | `0x15b6a37100000000000000000000000098b...` | | `to` | Address of the receiver. | `0x6066150a2070cc165222141b47fd2ba0642b57a1` | | `value` | Transferred value amount. | `0x0` | | `gasUsed` | gas used to execute the transaction. | `0x124b0` | | `output` | The result of the smart contract function call. | `0x` | | `calls` | Array of trace actions that were executed due to this trace action. | `[{...}, {...}]` | | `type` | Type of operation code (OPCODE). | `call` | Helpful Resources ----------------- * [What are EVM Traces?](https://www.alchemy.com/docs/reference/what-are-evm-traces) * [Trace API vs. Debug API](https://www.alchemy.com/docs/reference/trace-api-vs-debug-api) * [trace\_call vs debug\_traceCall](https://www.alchemy.com/docs/reference/trace_call-vs-debug_tracecall) Was this page helpful? YesNo --- # How to Enable Compression to Speed Up JSON-RPC Blockchain Requests | Alchemy Docs Copy page How to Enable Compression to Speed Up JSON-RPC Blockchain Requests ================================================================== Adding an 'Accept-Encoding: gzip' header to JSON-RPC requests results in roughly a 75% speedup for requests over 100kb. Use this single code change to speed up JSON-RPC requests! **TL;DR -** Adding an "Accept-Encoding: gzip" header to JSON-RPC requests results in roughly a 75% speedup for requests over 100kb. Use this single code change to speed up JSON-RPC requests for Ethereum, Polygon Optimism, Arbitrum, and more! Because of the structure of data storage in [blockchain nodes](https://www.alchemy.com/blog/what-is-a-node-provider) , RPC endpoints that provide access to blockchain nodes can have extremely slow requests and response times. Many requests, such as a simple `getLogs` or `replayTransaction` call, can take anywhere from 1 to 30 seconds to process ### What causes slow response times? The round-trip time of these requests can take a while for two primary reasons: (1) the request or response is large; (2) the requests are complex. #### 1\. Large Requests or Responses The size of the request or response can become quite large - up to 1MB for certain requests - and from 10MB - 250MB for certain response patterns. The latency to send or receive these calls can take seconds to process, depending on the connection speeds of the client or server. #### 2\. Complex Requests The requests themselves can take the nodes seconds to process, as they oftentimes involve replaying complicated transactions from scratch or scanning thousands of blocks to identify relevant transactions. Because of this, the [best practice for making calls to RPC node providers](https://www.alchemy.com/docs/alchemy/documentation/best-practices-when-using-alchemy) includes: 1. Keeping request sizes under 100KB 2. Keeping response sizes under 10MB 3. Sending requests in batches no larger than 50 Together, these best practices help developers avoid client-side timeouts and unreliable behavior * * * Compressing RPC Responses to Speed Up Blockchain Node Requests -------------------------------------------------------------- At Alchemy, many of our developers have brought up slow response times as a major blocker to providing their customers with a good web3 user experience. To provide users with better product experiences, we updated our internal infrastructure to offer **Alchemy developers support for gzip compression on all responses larger than 1kb in size.** Gzip compression offers up to a 95% decrease in the size of files sent over a streaming connection. However, the actual latency and bandwidth savings are dependent on the structure of data being broadcast, the connection speeds of the client and server, and the size of the response. In practice, we’ve seen roughly a **75% improvement in the total latency of typical JSON-RPC `replayTransaction` calls.** ### Can JSON-RPC responses be compressed on Optimism, Arbitrum, Polygon, Starknet, or Solana? Beyond support for gZip compression for Ethereum, this method of compressing JSON-RPC requests works on all the above blockchains. To implement this latency optimization, simply enable Gzip compression using your Alchemy endpoint * * * How to Enable Gzip Compression on Node Requests ----------------------------------------------- ### Step 1: Set up an Alchemy Account To enable gzip compression, first, you’ll need an Alchemy endpoint. [If you don’t already have an Alchemy account, sign up for free here.](https://dashboard.alchemy.com/signup?utm_source=docs&utm_medium=referral&utm_content=how-to-enable-compression-to-speed-up-json-rpc-blockchain-requests) If you’re already building applications on Alchemy’s developer platform, sign in to your account and skip to step 3. Alchemy is a blockchain developer platform and suite of APIs that allow developers to communicate with multiple blockchains without having to run their own nodes. Alchemy comes with 300 million compute units per month for free, which is equivalent to roughly 12 million free requests per month. ### Step 2: Create your app and API key Once you’ve created an Alchemy account, you can generate an API key by creating an app. This will allow you to make requests to the mainnet. Navigate to the “Create App” page in your Alchemy Dashboard by hovering over “Apps” in the nav bar. Then, click “Create App.” ![1600](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764192928%2Fdocs%2Ftutorials%2Fgetting-started%2Fdeveloper-best-practices%2F6e2d9b2-628fa8bdba8b412aa1242500_createappwitharrow.png&w=3840&q=75 "628fa8bdba8b412aa1242500_createappwitharrow.png") Then: * Name your app “Hello World” * Offer a short description * Click “Create App”! ![1600](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764180090%2Fdocs%2Fapi-reference%2Fwebsockets%2F62db7ae-Screen_Shot_2022-06-24_at_12.46.25_PM.png&w=3840&q=75 "Screen Shot 2022-06-24 at 12.46.25 PM.png") Your app should appear in the table. Finally, click on “View Key” on the right-hand side and copy the HTTPS URL. ![1600](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764192929%2Fdocs%2Ftutorials%2Fgetting-started%2Fdeveloper-best-practices%2F3dc80a4-Screen_Shot_2022-06-24_at_12.47.28_PM.png&w=3840&q=75 "Screen Shot 2022-06-24 at 12.47.28 PM.png") ### Step 3: Make a command-line node request with gzip enabled In order to enable gzip compression, **you’ll simply need to provide the additional field "Accept-Encoding: gzip" to the header of the JSON-RPC request.** When making a curl request in the terminal, your request with gzip might look like this: curl curl https://eth-mainnet.g.alchemy.com/v2/demo -v -X POST -H "Content-Type: application/json" -H "Accept-Encoding: gzip" -d '{"method":"trace_replayTransaction","params":["0x3277c743c14e482243862c03a70e83ccb52e25cb9e54378b20a8303f15cb985d",["trace"]],"id":1,"jsonrpc":"2.0"}' * * * Test the JSON-RPC Response Latency Decrease using Gzip Compression ------------------------------------------------------------------ To compare the latency improvements you’ll get using gzip on a single request, we’ll set up a script to record the total time a [`trace_replayTransaction`](https://www.alchemy.com/docs/alchemy/enhanced-apis/trace-api/trace_replaytransaction) request takes, and then run the same request with gzip compression and without gzip compression ### Step 1: Create a curl-format file Create a new file named `curl-format.txt` and add the following lines: curl-format.txt time_namelookup: %{time_namelookup}s\n time_connect: %{time_connect}s\n time_appconnect: %{time_appconnect}s\n time_pretransfer: %{time_pretransfer}s\n time_redirect: %{time_redirect}s\n time_starttransfer: %{time_starttransfer}s\n —------------------------------------------------------\n time_total: %{time_total}s\n ### Step 2: Run a test JSON-RPC request script without gzip compression Next, run the following script without gzip compression on an arbitrary node request: curl curl -w "@curl-format.txt" -o /dev/null -s https://eth-mainnet.g.alchemy.com/v2/demo -v -X POST -H "Content-Type: application/json" -d '{"method":"trace_replayTransaction","params":["0x3277c743c14e482243862c03a70e83ccb52e25cb9e54378b20a8303f15cb985d",["trace"]],"id":1,"jsonrpc":"2.0"}' On our pass, **we got the following output with approximately a 4-second response time:** json time_namelookup: 0.004295s time_connect: 0.015269s time_appconnect: 0.055590s time_pretransfer: 0.056517s time_redirect: 0.000000s time_starttransfer: 0.056595s ---------- time_total: 4.017589s ### Step 3: Run a test JSON-RPC request with gzip compression enabled Run the same script, but this time with gzip compression enabled on the same node request: curl-format curl -w "@curl-format.txt" -o /dev/null -s https://eth-mainnet.g.alchemy.com/v2/demo -v -X POST -H "Content-Type: application/json" -H "Accept-Encoding: gzip" -d '{"method":"trace_replayTransaction","params":["0x3277c743c14e482243862c03a70e83ccb52e25cb9e54378b20a8303f15cb985d",["trace"]],"id":1,"jsonrpc":"2.0"}' On our pass, **we got the following output with a roughly 1 second response time:** response time_namelookup: 0.030062s time_connect: 0.046659s time_appconnect: 0.099016s time_pretransfer: 0.099198s time_redirect: 0.000000s time_starttransfer: 0.099243s ---------- time_total: 0.984284s As you can see, in just two responses we’ve seen a **75% decrease in total latency!** JSON-RPC response latency improvements are dependent on many factors, including connection speed from the client, type of request, and size of the response. Though this number will vary dramatically based on these factors, you’ll typically see a non-trivial decrease in latency using gzip compression for speeding up large response packages. If you have any questions or feedback, please contact us at [\[email protected\]](https://www.alchemy.com/cdn-cgi/l/email-protection#63101613130c111723020f000b060e1a4d000c0e) or open a ticket in the dashboard. Was this page helpful? YesNo --- # API Reference Overview | Alchemy Docs Copy page API Reference Overview ====================== API Reference ============= Yellowstone gRPC provides real-time streaming of Solana blockchain data through a flexible subscription API. Subscription Types ------------------ ### [Subscribe Request](https://www.alchemy.com/docs/reference/yellowstone-grpc-subscribe-request) The base structure for all subscriptions. Defines filters, commitment levels, and combines multiple subscription types in a single request. ### [Subscribe to Slots](https://www.alchemy.com/docs/reference/yellowstone-grpc-subscribe-slots) Track slot progression and chain state. Essential for understanding confirmations and synchronizing with blockchain time. ### [Subscribe to Transactions](https://www.alchemy.com/docs/reference/yellowstone-grpc-subscribe-transactions) Stream transactions with filters for accounts, vote/non-vote, and success/failure status. ### [Subscribe to Accounts](https://www.alchemy.com/docs/reference/yellowstone-grpc-subscribe-accounts) Monitor account changes with filters for addresses, owners, data patterns, and balances. ### [Subscribe to Blocks](https://www.alchemy.com/docs/reference/yellowstone-grpc-subscribe-blocks) Stream complete blocks with all transactions and metadata. Was this page helpful? YesNo --- # What are EVM Traces? | Alchemy Docs Copy page What are EVM Traces? ==================== A guide to understanding EVM traces, their types, and how to use them. Prerequisites ============= Before reading about EVM traces, you should have a clear understanding of [EVM](https://www.alchemy.com/overviews/what-is-the-ethereum-virtual-machine-evm) , [Execution Clients](https://www.alchemy.com/overviews/execution-layer-and-consensus-layer-node-clients) , [Smart Contracts](https://ethereum.org/en/developers/docs/smart-contracts/) and [Nodes](https://ethereum.org/en/developers/docs/nodes-and-clients/) . You can read about these topics in the official [Ethereum documentation](https://ethereum.org/en/developers/docs/) or [Alchemy documentation](https://www.alchemy.com/docs) . However, if you just need a refresher, you can find the one-line definitions for these topics below. * **Smart Contracts:** Smart contracts are self-executing contracts with the terms of the agreement written into lines of code. The code and the agreements contained therein exist across a decentralized, distributed blockchain network. * **Execution Client:** An Execution/Ethereum Client is a software program that connects to the Ethereum network to enable users to interact with the Ethereum blockchain. Some popular Ethereum clients include Geth, Parity, and Erigon. * **EVM:** The Ethereum Virtual Machine (EVM) is a turing-complete virtual machine that allows for the execution of smart contracts on the Ethereum blockchain. The EVM is responsible for processing and executing all of the transactions that occur on the Ethereum network. * **Node:** An Ethereum node is a computer that runs an Ethereum Client and maintains the Ethereum blockchain. The Problem =========== There are two types of transactions in EVM-compatible protocols: 1. **Value Transfers:** A value transfer just moves the native blockchain currency (Ether in the case of Ethereum) from one account to another. 2. **Contract Executions:** A contract execution involves calling a function of the smart contract that can change the state of the contract and even call functions of other smart contracts. The downside of the contract execution is that it is very hard to tell what the transaction actually did. When a transaction is executed, you can get a transaction receipt that contains a status code to check whether the execution succeeded or not, besides looking at EVM traces there is no way to see what data was modified, or what external contracts were invoked. Look at the transaction flow below: ![](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764193603%2Fdocs%2Fapi-reference%2Ftrace-api%2Ftrace-api-resources%2Ff9906e7-transaction-flow.png&w=3840&q=75 "transaction-flow.png") Here is the [Etherscan link](https://etherscan.io/tx/0x0d13800319458a403500d407226328bbedbd8a10ff3d26a18c67872ac1f94ea7) for the transaction defined above. This is a transaction in which a user (externally owned account) invokes a contract which in turn invokes another contract and this is how the transaction receipt for this transaction looks like: transaction-receipt.json { to: '0xdE8BFD2b6E8F765710198fd10E7e87757B959F84', from: '0x80b4f0bc53F620141C16Bd209269aeC0D72B22c4', contractAddress: null, gasUsed: BigNumber { _hex: '0x7f54', _isBigNumber: true }, blockHash: '0x985ab37352c3c8765c6f7b480e07e1eadef6dd53c06fa25cf72394cb8eae34', transactionHash: '0x0d13800319458a403500d407226328bbedbd8a10ff3d26a18c67872ac1f94ea7', blockNumber: 15095426, confirmations: 768898, effectiveGasPrice: BigNumber { _hex: '0x0454f97690', _isBigNumber: true }, status: 1, } You can get the transaction receipt for any transaction using the **[eth\_getTransactionReceipt](https://www.alchemy.com/docs/reference/eth-gettransactionreceipt) ** Alchemy API The transaction receipt has a couple of fields, let’s take a look at them one by one: * `to`: The address the transaction is directed to. (In this case, Contract A address). * `from`: Address of the caller (In this case, the user). * `contractAddress`: If a new contract was created as part of this transaction then this field would have the address of the newly created contract, in this case, it is `null` because no new contract was created. * `gasUsed`: Gas used for the execution of the transaction in big number format. * `blockHash`: Hash of the block in which the transaction is included. * `transactionHash`: The hash of the transaction itself. This is the unique identifier of the transaction. * `blockNumber`: The block number in which the transaction is included. * `confirmations`: The number of blocks that have been mined since the block containing the given transaction was mined. * `effectiveGasPrice`: Gas price for the transaction. * `status`: A status with the value `1` means that the transaction was successful while a value of `0` means that the transaction failed. As you can see that the transaction receipt provides some information about the transaction but it does not tell that contract A further called contract B. This can be a problem depending on your use case. If you want information about all the steps involved in the transaction including calls to other contracts then transaction receipt will not be of much use to you. So how can this problem be solved? The Solution: EVM Traces ======================== **EVM traces** provide a step-by-step record of what happened during the execution of a transaction, including which other contracts were invoked and what data was changed. They help give debugging information that can be used to troubleshoot issues with EVM-compatible smart contracts, which is useful for understanding why a contract behaved in a certain way, or for finding bugs. When you trace a transaction you get back an array of objects also known as **EVM traces** for the transaction. Each step of the transaction is represented as an individual object in the array. Example ------- So, the EVM traces for [this](https://etherscan.io/tx/0x0d13800319458a403500d407226328bbedbd8a10ff3d26a18c67872ac1f94ea7) transaction which is also defined in "The Problem" section looks like this (We’ll learn how to retrieve EVM traces in a later section): evm-traces.json [\ {\ "action": {\ "from": "0x80b4f0bc53f620141c16bd209269aec0d72b22c4",\ "callType": "call",\ "gas": "0x7a37",\ "input": "0x",\ "to": "0xde8bfd2b6e8f765710198fd10e7e87757b959f84",\ "value": "0xb2ece213edb23a"\ },\ "blockHash": "0x985ab37352c3c8765c6f7b480e07e1eadef6dd53c06fa25cf72394cb8eae32b4",\ "blockNumber": 15095426,\ "result": {\ "gasUsed": "0x2d4c",\ "output": "0x"\ },\ "subtraces": 1,\ "traceAddress": [],\ "transactionHash": "0x0d13800319458a403500d407226328bbedbd8a10ff3d26a18c67872ac1f94ea7",\ "transactionPosition": 420,\ "type": "call"\ },\ {\ "action": {\ "from": "0xde8bfd2b6e8f765710198fd10e7e87757b959f84",\ "callType": "call",\ "gas": "0x8fc",\ "input": "0x",\ "to": "0xaf1931c20ee0c11bea17a41bfbbad299b2763bc0",\ "value": "0xb2ece213edb23a"\ },\ "blockHash": "0x985ab37352c3c8765c6f7b480e07e1eadef6dd53c06fa25cf72394cb8eae32b4",\ "blockNumber": 15095426,\ "result": {\ "gasUsed": "0x0",\ "output": "0x"\ },\ "subtraces": 0,\ "traceAddress": [\ 0\ ],\ "transactionHash": "0x0d13800319458a403500d407226328bbedbd8a10ff3d26a18c67872ac1f94ea7",\ "transactionPosition": 420,\ "type": "call"\ }\ ] Here is an explanation of the above EVM traces (click on the image to zoom into it): ![](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764193604%2Fdocs%2Fapi-reference%2Ftrace-api%2Ftrace-api-resources%2F652e40e-flow-of-transaction.png&w=3840&q=75 "flow-of-transaction.png") Each step of the transaction is represented as a separate **Trace** and each trace has its own fields. A lot of the fields are the same as the fields of the transaction receipt, such as `from`, `to`, `blockHash`, `blockNumber` and `transactionHash` but there are additional fields as well. The **type** field defines the type of the given action/trace and the structure of the given trace depends on the type of the action. Let’s take a look at the types of trace actions and their structures. Types of Trace Actions ---------------------- There are many types of actions captured in transaction traces: Some common actions are [CREATE](https://www.alchemy.com/docs/reference/what-are-evm-traces#create) , [SUICIDE](https://www.alchemy.com/docs/reference/what-are-evm-traces#suicide)  and [CALL](https://www.alchemy.com/docs/reference/what-are-evm-traces#call) . Below you will find the structure for these trace actions. ### **`CREATE`** Captured when a new smart contract is created. **Structure** * `action` * `from`: address that created the contract * `gas`: gas cost to create the contract * `init`: initialization code for creating the contract * `value`: value sent to contract * `blockHash`: block hash the transaction was included in * `blockNumber`: block number the transaction was included in * `result` * `address`: address for contract created * `code`: code for contract created * `gasUsed`: gas used in contract creation * `subtraces`: number of child traces of the given trace * `traceAddress`: index for the given trace in the trace tree * `transactionHash`: hash for the transaction * `transactionPosition`: position (or index) of transaction in the block * `type`: type of action, in this case, `CREATE` **Example:** create-evm-trace.json { "action": { "from": "0x6090a6e47849629b7245dfa1ca21d94cd15878ef", "gas": "0x6a7f1", "init": "0x606060405260405160208061051683398101604052515b60028054600160a060020a03808416600160a060020a0319928316179092556000805433909316929091169190911790554260019081556005805460ff19169091179055346004555b505b6104a6806100706000396000f300606060405236156100885763ffffffff60e060020a60003504166305b34410811461008a5780630b5ab3d5146100ac57806313af4035146100be5780632b20e397146100dc5780633fa4f24514610108578063674f220f1461012a5780638da5cb5b14610156578063b0c8097214610182578063bbe427711461019c578063faab9d39146101b1575bfe5b341561009257fe5b61009a6101cf565b60408051918252519081900360200190f35b34156100b457fe5b6100bc6101d5565b005b34156100c657fe5b6100bc600160a060020a036004351661021d565b005b34156100e457fe5b6100ec6102c3565b60408051600160a060020a039092168252519081900360200190f35b341561011057fe5b61009a6102d2565b60408051918252519081900360200190f35b341561013257fe5b6100ec6102d8565b60408051600160a060020a039092168252519081900360200190f35b341561015e57fe5b6100ec6102e7565b60408051600160a060020a039092168252519081900360200190f35b341561018a57fe5b6100bc60043560243515156102f6565b005b34156101a457fe5b6100bc600435610382565b005b34156101b957fe5b6100bc600160a060020a0360043516610431565b005b60015481565b60055460ff16156101e65760006000fd5b600254604051600160a060020a039182169130163180156108fc02916000818181858888f193505050501561021a5761deadff5b5b565b60005433600160a060020a039081169116146102395760006000fd5b600160a060020a038116151561024f5760006000fd5b600280546003805473ffffffffffffffffffffffffffffffffffffffff19908116600160a060020a03808516919091179092559084169116811790915560408051918252517fa2ea9883a321a3e97b8266c2b078bfeec6d50c711ed71f874a90d500ae2eaf369181900360200190a15b5b50565b600054600160a060020a031681565b60045481565b600354600160a060020a031681565b600254600160a060020a031681565b60005433600160a060020a039081169116146103125760006000fd5b60055460ff1615156103245760006000fd5b8160045410156103345760006000fd5b6004829055600254604051600160a060020a039182169130163184900380156108fc02916000818181858888f193505050501580156103705750805b1561037b5760006000fd5b5b5b5b5050565b60005433600160a060020a0390811691161461039e5760006000fd5b60055460ff1615156103b05760006000fd5b6005805460ff1916905561dead6108fc6103e883810330600160a060020a031631025b604051919004801590920291906000818181858888f1935050505015156103fa5760006000fd5b6040517fbb2ce2f51803bba16bc85282b47deeea9a5c6223eabea1077be696b3f265cf1390600090a16102bf6101d5565b5b5b5b50565b60005433600160a060020a0390811691161461044d5760006000fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b505600a165627a7a72305820fbfa6f8a2024760ef0e0eb29a332c9a820526e92f8b4fbcce6f00c7643234b140029000000000000000000000000a7f3659c53820346176f7e0e350780df304db179", "value": "0xe4b4b8af6a70000" }, "blockHash": "0x6d00f7707938cca36b0730d8f7f090543242002b6fa0fe94bf85b9ab02e6bed6", "blockNumber": 4000036, "result": { "address": "0xfc9779d9a0f2715435a3e8ebf780322145d7546e", "code": "0x606060405236156100885763ffffffff60e060020a60003504166305b34410811461008a5780630b5ab3d5146100ac57806313af4035146100be5780632b20e397146100dc5780633fa4f24514610108578063674f220f1461012a5780638da5cb5b14610156578063b0c8097214610182578063bbe427711461019c578063faab9d39146101b1575bfe5b341561009257fe5b61009a6101cf565b60408051918252519081900360200190f35b34156100b457fe5b6100bc6101d5565b005b34156100c657fe5b6100bc600160a060020a036004351661021d565b005b34156100e457fe5b6100ec6102c3565b60408051600160a060020a039092168252519081900360200190f35b341561011057fe5b61009a6102d2565b60408051918252519081900360200190f35b341561013257fe5b6100ec6102d8565b60408051600160a060020a039092168252519081900360200190f35b341561015e57fe5b6100ec6102e7565b60408051600160a060020a039092168252519081900360200190f35b341561018a57fe5b6100bc60043560243515156102f6565b005b34156101a457fe5b6100bc600435610382565b005b34156101b957fe5b6100bc600160a060020a0360043516610431565b005b60015481565b60055460ff16156101e65760006000fd5b600254604051600160a060020a039182169130163180156108fc02916000818181858888f193505050501561021a5761deadff5b5b565b60005433600160a060020a039081169116146102395760006000fd5b600160a060020a038116151561024f5760006000fd5b600280546003805473ffffffffffffffffffffffffffffffffffffffff19908116600160a060020a03808516919091179092559084169116811790915560408051918252517fa2ea9883a321a3e97b8266c2b078bfeec6d50c711ed71f874a90d500ae2eaf369181900360200190a15b5b50565b600054600160a060020a031681565b60045481565b600354600160a060020a031681565b600254600160a060020a031681565b60005433600160a060020a039081169116146103125760006000fd5b60055460ff1615156103245760006000fd5b8160045410156103345760006000fd5b6004829055600254604051600160a060020a039182169130163184900380156108fc02916000818181858888f193505050501580156103705750805b1561037b5760006000fd5b5b5b5b5050565b60005433600160a060020a0390811691161461039e5760006000fd5b60055460ff1615156103b05760006000fd5b6005805460ff1916905561dead6108fc6103e883810330600160a060020a031631025b604051919004801590920291906000818181858888f1935050505015156103fa5760006000fd5b6040517fbb2ce2f51803bba16bc85282b47deeea9a5c6223eabea1077be696b3f265cf1390600090a16102bf6101d5565b5b5b5b50565b60005433600160a060020a0390811691161461044d5760006000fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b505600a165627a7a72305820fbfa6f8a2024760ef0e0eb29a332c9a820526e92f8b4fbcce6f00c7643234b140029", "gasUsed": "0x52ce0" }, "subtraces": 0, "traceAddress": [\ 0\ ], "transactionHash": "0xc9601ea5ca42e57c3ef1d770ab0b278d6aadf2511a4feb879cba573854443423", "transactionPosition": 70, "type": "create" } Here is the [link](https://etherscan.io/tx/0xc9601ea5ca42e57c3ef1d770ab0b278d6aadf2511a4feb879cba573854443423) for the transaction on Etherscan whose example EVM trace is given above. ### **`SUICIDE`** Captured when a smart contract is destroyed, which transfers the contract's current balance to a specified `address` and clear the contract's data, freeing up memory on-chain. The freed space on-chain is processed as a refund towards the total gas cost for completing the transaction. **Structure** * `action` * `address`: address of contract to destroy * `refundAddress`: address to send the remainder of the contract `balance` to * `balance`: remaining balance in the contract * `blockHash`: block hash the transaction was included in * `blockNumber`: block number the transaction was included in * `result:` `null` for `SUICIDE` actions * `subtraces`: number of child traces of the given trace * `traceAddress`: index for the given trace in the trace tree * `transactionHash`: hash for the transaction * `transactionPosition`: position (or index) of transaction in the block * `type`: type of the action, in this case, `SUICIDE` **Example:** suicide-evm-trace.json { "action": { "address": "0x87051f6ba0562fdb0485763562bf34cb2ad705b1", "refundAddress": "0x000000000000000000000000000000000000dead", "balance": "0x0" }, "blockHash": "0x6d00f7707938cca36b0730d8f7f090543242002b6fa0fe94bf85b9ab02e6bed6", "blockNumber": 4000036, "result": null, "subtraces": 0, "traceAddress": [\ 1,\ 2,\ 2\ ], "transactionHash": "0xbc15addb97490a168dc1d099ab8537caf2e4ff7d1deeff6d685d2d594a750037", "transactionPosition": 45, "type": "suicide" }, Here is the [link](https://etherscan.io/tx/0xbc15addb97490a168dc1d099ab8537caf2e4ff7d1deeff6d685d2d594a750037) for the transaction on Etherscan whose example EVM trace is given above. ### **`CALL`** Used for transferring ETH between [externally owned accounts](https://www.alchemy.com/docs/web3-glossary#externally-owned-account)  (EOAs) or to call a smart contract function. **Structure** * `action` * `from`: address of the sender * `callType`: type of `CALL`, can be any of the following: * `call` * `delegatecall` * `callcode` * `staticcall` * `gas`: gas included in the transaction * `input`: the specific function to call on the contract with parameters specified, encoded. For transfers to an EOA, `input` will be `0x` * `to`: address the transaction is directed. * `value`: the amount of value to be transferred * `blockHash`: block hash the transaction was included in * `blockNumber`: block number the transaction was included in * `result` * `gasUsed`: gas used to execute the transaction * `output`: the result of the smart contract function call, encoded. For transfers to an EOA or smart contract, the `output` will be `0x`. * `subtraces`: number of child traces of the given trace * `traceAddress`: index for a given trace in the trace tree * `transactionHash`: hash for the transaction * `transactionPosition`: position (or index) of transaction in the block * `type`: type of the action, in this case, `CALL` **Example:** call-evm-trace.json { "action": { "from": "0xbc9f06dd67578b0b8b4d87fda9acde453bc4c067", "callType": "call", "gas": "0x97478", "input": "0xfebefd610000000000000000000000000000000000000000000000000000000000000040cc849afc28894f79411f12309e75c71ded27d1666b75a2423633c204e671cb1e00000000000000000000000000000000000000000000000000000000000000036eaec0ff7c4899bec2db1479d7d195d614ca26819a301523d82daaaaf436122d2ceb36dfa12b359202b4dfd756478988f5023bf7297afa81f563d4b6242e36e707671a8bf38ee483a37feca948997dcfba17b3372e166ba5c824629beeed6b5c", "to": "0x6090a6e47849629b7245dfa1ca21d94cd15878ef", "value": "0x2386f26fc10000" }, "blockHash": "0x6d00f7707938cca36b0730d8f7f090543242002b6fa0fe94bf85b9ab02e6bed6", "blockNumber": 4000036, "result": { "gasUsed": "0x7ad71", "output": "0x" }, "subtraces": 4, "traceAddress": [], "transactionHash": "0x552b31a3a9c92577d65db62cf9f729e81571e10cad90e356423adcfa2caebacc", "transactionPosition": 71, "type": "call" } Here is the [link](https://etherscan.io/tx/0x552b31a3a9c92577d65db62cf9f729e81571e10cad90e356423adcfa2caebacc) for the transaction on Etherscan whose example EVM trace is given above. How to read `traceAddress`? --------------------------- Traces are structured in a tree format. This helps in better understanding the flow of the transaction. The `traceAddress` field represents the position of the given trace in the tree. An empty array represents the root of the tree (the first trace). Furthermore, traces which are captured due to the first trace have their `traceAddress` in \[0\], \[1\], \[2\] etc. format. Here is a diagram of `traceAddress` results to help understand how to read this position: ![](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764193606%2Fdocs%2Fapi-reference%2Ftrace-api%2Ftrace-api-resources%2F6c52e64-Reading_Trace_Tree.png&w=3840&q=75 "Reading_Trace_Tree.png") Applications of EVM Traces ========================== There are many use cases for EVM traces some of them are listed below: ### **Transaction Tracers** Etherscan and other transaction tracers help us better understand the flow of a transaction. They extract the EVM traces for a transaction and display them in a way that’s readable by us. For example here is the result for a USDT transfer transaction trace: ![](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764193606%2Fdocs%2Fapi-reference%2Ftrace-api%2Ftrace-api-resources%2Ff6f173b-txs-fyi.png&w=3840&q=75 "txs-fyi.png") As you can see it’s clear from the execution trace that the caller called the transfer function of the `TetherToken` contract and the contract transferred 285 USDT from the caller to the target address. ### **Debugging Transactions** When a transaction fails, you can find the reason for the failure of the transaction using EVM traces. For example, in the trace image below you can see that the transaction failed due to an "Out of gas" exception, which means that there was not enough gas to complete the transaction. ![](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764193607%2Fdocs%2Fapi-reference%2Ftrace-api%2Ftrace-api-resources%2Faa4d8bc-debugged-transaction.png&w=3840&q=75 "debugged-transaction.png") Here is the [link](https://etherscan.io/tx/0xda8c0b80d8e240a83c8f6b067c4656babeb13e8e0ece4fd4292aa06252f1285c) to the above-defined transaction on Etherscan. ### **Contract Performance Analysis** Transaction traces can be used to analyze the performance of smart contracts by looking at the number of actions it takes for each transaction to be processed. This information can be used to identify bottlenecks and optimize the contract for better performance. How to retrieve EVM traces? =========================== There are several ways to retrieve EVM traces of a transaction. 1. **Using Alchemy APIs:** Alchemy manages trace-enabled nodes and offers API endpoints to collect transaction traces. This is the simplest way of retrieving EVM traces since running your own node requires a lot of resources and maintenance. You can either use the [Trace API](https://www.alchemy.com/docs/reference/trace-api-quickstart) endpoints or the [Debug API](https://www.alchemy.com/docs/reference/debug-api-endpoints) endpoints to get the transaction traces. For getting the transaction traces using a transaction hash, you can use the [trace\_transaction](https://www.alchemy.com/docs/reference/trace-transaction) method. 2. **Replaying the transaction in a full/archive node:** Ethereum clients have methods that allow them to re-run transactions that have been executed previously. They collect traces from these transactions in order to get results. Even though it takes time to retrieve the results, nodes are not required to store the traces as long as they have enough information to run the transaction. 3. **Running an archive node with traces enabled:** Ethereum clients support running nodes with traces enabled. This allows nodes to store traces so that they can be retrieved quickly without having to re-execute the transaction. However, this comes at the expense of higher costs and slower node performance. Conclusion ========== In conclusion, EVM transaction traces are a valuable tool for debugging smart contracts. They provide a step-by-step record of the execution of a contract and can be used to identify errors and optimize code. Was this page helpful? YesNo --- # How to Get Transaction History for an Address on Ethereum | Alchemy Docs Copy page How to Get Transaction History for an Address on Ethereum ========================================================= Learn how to get the full transaction history for a smart contract or a user address including external, internal, token, ERC-20, ERC-721 and ERC-1155 token transfers in a single request. This tutorial uses the **[alchemy\_getAssetTransfers](https://www.alchemy.com/docs/reference/alchemy-getassettransfers) ** endpoint. A few reasons for why you'd want to get address transaction history by an address: * Displaying your a user’s full transaction history * Querying an address's transactions filtered by smart contract interactions * Analyzing a user's historical profit and loss Regardless of the different types of transaction history, you want to look up, this process can be extremely burdensome for developers to stitch together without the [Alchemy Transfers API](https://www.alchemy.com/docs/reference/transfers-api) **In this tutorial, we’ll be using Alchemy’s [Transfers API](https://www.alchemy.com/docs/reference/transfers-api) to fetch all transactions sent _`from`_ and sent _`to`_ addresses you care about to create a complete picture of a user's transaction history.** * * * How to query transaction history -------------------------------- When using the [Transfers API](https://www.alchemy.com/docs/reference/transfers-api) for querying a user’s full on-chain history, it's important to have a few key parameters on hand. * `fromAddress`: the address we want to see transaction information originating from * `toAddress`: the address we want to see for recipient-based transactions * `fromBlock`: the starting time range we want to fetch transactions over (defaults to `latest`) * `toBlock` : the ending time range we want to fetch transactions over (defaults to `latest`) * `category`: the type of transfer events we care about, in our case we want to see all transactions so we can simply let the param use its default argument of \["`external`", "`internal`", "`token`"\] For transaction information that originates from your target sender address, use the `fromAddress` parameter within the [Transfers API](https://www.alchemy.com/docs/reference/transfers-api) . For recipient-based transactions, use the `toAddress` parameter. If you want to get transactions that have a specific `from` and `to` address, you can specify the `fromAddress` and `toAddress` in your request. * * * ### Example: Getting Transactions Originating `From` An Address **For a no-code view of the API request check out the [composer tool](https://composer.alchemy.com/?composer_state=%7B%22chain%22%3A0%2C%22network%22%3A0%2C%22methodName%22%3A%22alchemy_getAssetTransfers%22%2C%22paramValues%22%3A%5B%7B%22excludeZeroValue%22%3Atrue%2C%22toAddress%22%3A%22%22%2C%22toBlock%22%3A%22%22%2C%22fromAddress%22%3A%220x5c43B1eD97e52d009611D89b74fA829FE4ac56b1%22%2C%22fromBlock%22%3A%220x0%22%7D%5D%7D) ** #### Fetch You can easily interact with Alchemy's Transfers API using simple fetch requests. No additional dependencies required with Node.js 18+. [![transfers_api_javascript_scripts/tx-history-from-alchemyweb3.js at main · alchemyplatform/transfers_api_javascript_scripts](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764180254%2Fdocs%2Ftutorials%2Ftransactions%2Ftransaction-history%2Ftransfers_api_javascript_scripts.png&w=3840&q=75)](https://github.com/alchemyplatform/transfers_api_javascript_scripts/blob/main/javascript/alchemyweb3/tx-history/tx-history-from-alchemyweb3.js) [![github.com](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764179977%2Fdocs%2Fapi-reference%2Fdata%2Ftoken-api%2Ffavicon.ico&w=3840&q=75)github.com](https://github.com/alchemyplatform/transfers_api_javascript_scripts/blob/main/javascript/alchemyweb3/tx-history/tx-history-from-alchemyweb3.js) [transfers\_api\_javascript\_scripts/tx-history-from-alchemyweb3.js at main · alchemyplatform/transfers\_api\_javascript\_scripts](https://github.com/alchemyplatform/transfers_api_javascript_scripts/blob/main/javascript/alchemyweb3/tx-history/tx-history-from-alchemyweb3.js) No installation needed - `fetch` is built into Node.js 18 and higher: ##### 1\. Create a file. In your current directory, create a new file called `tx-history-from-fetch.js` Use your favorite file browser, code editor, or just directly in the terminal using the `touch` command like this: shell touch tx-history-from-fetch.js ##### 2\. Write script! Copy and paste the following code snippet into your new file: `tx-history-from-fetch.js` tx-history-from-fetch.js // Replace with your Alchemy API Key const apiKey = "demo"; const baseURL = `https://eth-mainnet.g.alchemy.com/v2/${apiKey}`; async function getTransactionHistory() { try { const data = { jsonrpc: "2.0", id: 0, method: "alchemy_getAssetTransfers", params: [{\ fromBlock: "0x0",\ fromAddress: "0x5c43B1eD97e52d009611D89b74fA829FE4ac56b1",\ category: ["external", "internal", "erc20", "erc721", "erc1155"]\ }] }; const response = await fetch(baseURL, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(data) }); const result = await response.json(); console.log(JSON.stringify(result, null, 2)); } catch (error) { console.error('Error:', error); } } getTransactionHistory(); ##### 3\. Run script! Now, on your command line, you can execute the script by calling: shell node tx-history-from-fetch.js #### Node-Fetch If you're using `node-fetch` a lightweight, common module that brings the Fetch API to Node.js and allows us to make our HTTP requests, here's a code snipper for the request you'd make! [![transfers_api_javascript_scripts/tx-history-from-axios.js at main · alchemyplatform/transfers_api_javascript_scripts](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764180254%2Fdocs%2Ftutorials%2Ftransactions%2Ftransaction-history%2Ftransfers_api_javascript_scripts.png&w=3840&q=75)](https://github.com/alchemyplatform/transfers_api_javascript_scripts/blob/main/javascript/axios/tx-history/tx-history-from-axios.js) [![github.com](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764179977%2Fdocs%2Fapi-reference%2Fdata%2Ftoken-api%2Ffavicon.ico&w=3840&q=75)github.com](https://github.com/alchemyplatform/transfers_api_javascript_scripts/blob/main/javascript/axios/tx-history/tx-history-from-axios.js) [transfers\_api\_javascript\_scripts/tx-history-from-axios.js at main · alchemyplatform/transfers\_api\_javascript\_scripts](https://github.com/alchemyplatform/transfers_api_javascript_scripts/blob/main/javascript/axios/tx-history/tx-history-from-axios.js) ##### 1\. Create a file. In your current directory, create a new file called `tx-history-from-fetch.js` using your favorite file browser, code editor, or just directly in the terminal using the `touch` command like this: shell touch tx-history-from-fetch.js ##### 2\. Write script! Copy and paste in the following code snippet into your new file: `tx-history-from-fetch.js` tx-history-from-fetch.js let data = JSON.stringify({ "jsonrpc": "2.0", "id": 0, "method": "alchemy_getAssetTransfers", "params": [\ {\ "fromBlock": "0x0",\ "fromAddress": "0x5c43B1eD97e52d009611D89b74fA829FE4ac56b1",\ }\ ] }); var requestOptions = { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: data, redirect: 'follow' }; const apiKey = "demo" const baseURL = `https://eth-mainnet.g.alchemy.com/v2/${apiKey}`; const fetchURL = `${baseURL}`; fetch(fetchURL, requestOptions) .then(response => response.json()) .then(response => JSON.stringify(response, null, 2)) .then(result => console.log(result)) .catch(error => console.log('error', error)); ##### 3\. Run script! shell node tx-history-from-fetch.js #### Axios If you're using Javascript `axios`, a promise-based HTTP client for the browser and Node.js which allows us to make a raw request to the Alchemy API, here's a code snipper for the request you'd make! [![transfers_api_javascript_scripts/tx-history-from-fetch.js at main · alchemyplatform/transfers_api_javascript_scripts](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764180254%2Fdocs%2Ftutorials%2Ftransactions%2Ftransaction-history%2Ftransfers_api_javascript_scripts.png&w=3840&q=75)](https://github.com/alchemyplatform/transfers_api_javascript_scripts/blob/main/javascript/fetch/tx-history/tx-history-from-fetch.js) [![github.com](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764179977%2Fdocs%2Fapi-reference%2Fdata%2Ftoken-api%2Ffavicon.ico&w=3840&q=75)github.com](https://github.com/alchemyplatform/transfers_api_javascript_scripts/blob/main/javascript/fetch/tx-history/tx-history-from-fetch.js) [transfers\_api\_javascript\_scripts/tx-history-from-fetch.js at main · alchemyplatform/transfers\_api\_javascript\_scripts](https://github.com/alchemyplatform/transfers_api_javascript_scripts/blob/main/javascript/fetch/tx-history/tx-history-from-fetch.js) ##### 1\. Create a file. In your current directory, create a new file called `tx-history-from-axios.js` using your favorite file browser, code editor, or just directly in the terminal using the `touch` command. shell touch tx-history-from-axios.js ##### 2\. Write script! Copy and paste the following code snippet into your new file: `tx-history-from-axios.js` tx-history-from-axios.js import axios from 'axios'; let data = JSON.stringify({ "jsonrpc": "2.0", "id": 0, "method": "alchemy_getAssetTransfers", "params": [\ {\ "fromBlock": "0x0",\ "fromAddress": "0x5c43B1eD97e52d009611D89b74fA829FE4ac56b1",\ }\ ] }); var requestOptions = { method: 'post', headers: { 'Content-Type': 'application/json' }, data: data, }; const apiKey = "demo" const baseURL = `https://eth-mainnet.g.alchemy.com/v2/${apiKey}`; const axiosURL = `${baseURL}`; axios(axiosURL, requestOptions) .then(response => console.log(JSON.stringify(response.data, null, 2))) .catch(error => console.log(error)); ##### 3\. Run script! Now, on your command line, you can execute the script by calling: shell node tx-history-from-axios.js * * * ### Example: Getting Recipient-based Transactions \*_For a no-code view of the API request check out the [composer tool](https://composer.alchemy.com/?composer_state=%7B%22chain%22%3A0%2C%22network%22%3A0%2C%22methodName%22%3A%22alchemy_getAssetTransfers%22%2C%22paramValues%22%3A%5B%7B%22excludeZeroValue%22%3Atrue%2C%22toAddress%22%3A%220x5c43B1eD97e52d009611D89b74fA829FE4ac56b1%22%2C%22toBlock%22%3A%22%22%2C%22fromAddress%22%3A%22%22%2C%22fromBlock%22%3A%220x0%22%7D%5D%7D) _ #### JavaScript with Fetch (Recommended) Using native fetch allows us to efficiently interact with Alchemy's endpoints and make JSON-RPC requests. [![transfers_api_javascript_scripts/tx-history-to-alchemyweb3.js at main · alchemyplatform/transfers_api_javascript_scripts](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764180254%2Fdocs%2Ftutorials%2Ftransactions%2Ftransaction-history%2Ftransfers_api_javascript_scripts.png&w=3840&q=75)](https://github.com/alchemyplatform/transfers_api_javascript_scripts/blob/main/javascript/alchemyweb3/tx-history/tx-history-to-alchemyweb3.js) [![github.com](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764179977%2Fdocs%2Fapi-reference%2Fdata%2Ftoken-api%2Ffavicon.ico&w=3840&q=75)github.com](https://github.com/alchemyplatform/transfers_api_javascript_scripts/blob/main/javascript/alchemyweb3/tx-history/tx-history-to-alchemyweb3.js) [transfers\_api\_javascript\_scripts/tx-history-to-alchemyweb3.js at main · alchemyplatform/transfers\_api\_javascript\_scripts](https://github.com/alchemyplatform/transfers_api_javascript_scripts/blob/main/javascript/alchemyweb3/tx-history/tx-history-to-alchemyweb3.js) Ensure you are inside your project folder and type the following command in the terminal: Shell # No installation needed - fetch is built-in to Node.js 18+ and browsers ##### 1\. Create a file In your current directory, create a new file called `transaction-history-script.js` Use your favorite file browser, code editor, or just directly in the terminal using the `touch` command like this: Shell touch transaction-history-script.js ##### 2\. Write script! Copy and paste in the following code snippet into your new file: transaction-history.js // transaction-history.js const main = async () => { // Replace with your Alchemy API key const apiKey = "<-- ALCHEMY APP API KEY -->"; const requestBody = { jsonrpc: "2.0", id: 0, method: "alchemy_getAssetTransfers", params: [\ {\ fromBlock: "0x0",\ toAddress: "0x5c43B1eD97e52d009611D89b74fA829FE4ac56b1",\ category: ["external", "internal", "erc20", "erc721", "erc1155"],\ }\ ] }; try { const response = await fetch(`https://eth-mainnet.g.alchemy.com/v2/${apiKey}`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(requestBody) }); const data = await response.json(); console.log('Transaction history:', data.result); } catch (error) { console.error('Error:', error); } }; main(); ##### 3\. Run script! Now, on your command line, you can execute the script by calling: shell node transaction-history.js #### Node-Fetch If you're using `node-fetch` a lightweight, common module that brings the Fetch API to Node.js and allows us to make our HTTP requests, here's a code snipper for the request you'd make! [![transfers_api_javascript_scripts/tx-history-to-fetch.js at main · alchemyplatform/transfers_api_javascript_scripts](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764180254%2Fdocs%2Ftutorials%2Ftransactions%2Ftransaction-history%2Ftransfers_api_javascript_scripts.png&w=3840&q=75)](https://github.com/alchemyplatform/transfers_api_javascript_scripts/blob/main/javascript/fetch/tx-history/tx-history-to-fetch.js) [![github.com](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764179977%2Fdocs%2Fapi-reference%2Fdata%2Ftoken-api%2Ffavicon.ico&w=3840&q=75)github.com](https://github.com/alchemyplatform/transfers_api_javascript_scripts/blob/main/javascript/fetch/tx-history/tx-history-to-fetch.js) [transfers\_api\_javascript\_scripts/tx-history-to-fetch.js at main · alchemyplatform/transfers\_api\_javascript\_scripts](https://github.com/alchemyplatform/transfers_api_javascript_scripts/blob/main/javascript/fetch/tx-history/tx-history-to-fetch.js) ##### 1\. Create a file. In your current directory, create a new file called `fetch-transfers-to-script.js` using your favorite file browser, code editor, or just directly in the terminal using the `touch` command like this: shell touch fetch-transfers-to-script.js ##### 2\. Write script! Copy and paste in the following code snippet into your new file: `fetch-transfers-to-script.js` fetch-transfers-to-script.js let data = JSON.stringify({ "jsonrpc": "2.0", "id": 0, "method": "alchemy_getAssetTransfers", "params": [\ {\ "fromBlock": "0x0",\ "toAddress": "0x5c43B1eD97e52d009611D89b74fA829FE4ac56b1",\ }\ ] }); var requestOptions = { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: data, redirect: 'follow' }; const apiKey = "demo" const baseURL = `https://eth-mainnet.g.alchemy.com/v2/${apiKey}`; const fetchURL = `${baseURL}`; fetch(fetchURL, requestOptions) .then(response => response.json()) .then(response => JSON.stringify(response, null, 2)) .then(result => console.log(result)) .catch(error => console.log('error', error)); ##### 3\. Run script! Now, on your command line, you can execute the script by calling: shell node fetch-transfers-from-script.js #### Axios If you're using Javascript `axios`, a promise-based HTTP client for the browser and Node.js which allows us to make a raw request to the Alchemy API, here's a code snipper for the request you'd make! [![transfers_api_javascript_scripts/tx-history-to-axios.js at main · alchemyplatform/transfers_api_javascript_scripts](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764180254%2Fdocs%2Ftutorials%2Ftransactions%2Ftransaction-history%2Ftransfers_api_javascript_scripts.png&w=3840&q=75)](https://github.com/alchemyplatform/transfers_api_javascript_scripts/blob/main/javascript/axios/tx-history/tx-history-to-axios.js) [![github.com](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764179977%2Fdocs%2Fapi-reference%2Fdata%2Ftoken-api%2Ffavicon.ico&w=3840&q=75)github.com](https://github.com/alchemyplatform/transfers_api_javascript_scripts/blob/main/javascript/axios/tx-history/tx-history-to-axios.js) [transfers\_api\_javascript\_scripts/tx-history-to-axios.js at main · alchemyplatform/transfers\_api\_javascript\_scripts](https://github.com/alchemyplatform/transfers_api_javascript_scripts/blob/main/javascript/axios/tx-history/tx-history-to-axios.js) ##### 1\. Create a file. In your current directory, create a new file called `axios-transfers-to-script.js` using your favorite file browser, code editor, or just directly in the terminal using the `touch` command. shell touch axios-transfers-to-script.js ##### 2\. Write script! Copy and paste the following code snippet into your new file: `axios-transfers-to-script.js` axios-transfers-to-script.js import axios from 'axios'; let data = JSON.stringify({ "jsonrpc": "2.0", "id": 0, "method": "alchemy_getAssetTransfers", "params": [\ {\ "fromBlock": "0x0",\ "toAddress": "0x5c43B1eD97e52d009611D89b74fA829FE4ac56b1",\ }\ ] }); var requestOptions = { method: 'post', headers: { 'Content-Type': 'application/json' }, data: data, }; const apiKey = "demo" const baseURL = `https://eth-mainnet.g.alchemy.com/v2/${apiKey}`; const axiosURL = `${baseURL}`; axios(axiosURL, requestOptions) .then(response => console.log(JSON.stringify(response.data, null, 2))) .catch(error => console.log(error)); ##### 3\. Run script! Now, on your command line, you can execute the script by calling: shell node axios-transfers-to-script.js * * * How to process the API response ------------------------------- Now that we have made a query and can see the response, let's learn how to handle it. If you feel like jumping ahead and grabbing some pre-built code, choose a repo that matches your preferred library. ### Modern Web3 Libraries (Recommended) #### Parsing with Modern Web3 Library Responses [![transfers_api_javascript_scripts/tx-history-parsed-alchemyweb3.js at main · alchemyplatform/transfers_api_javascript_scripts](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764180254%2Fdocs%2Ftutorials%2Ftransactions%2Ftransaction-history%2Ftransfers_api_javascript_scripts.png&w=3840&q=75)](https://github.com/alchemyplatform/transfers_api_javascript_scripts/blob/main/javascript/alchemyweb3/tx-history/tx-history-parsed-alchemyweb3.js) [![github.com](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764179977%2Fdocs%2Fapi-reference%2Fdata%2Ftoken-api%2Ffavicon.ico&w=3840&q=75)github.com](https://github.com/alchemyplatform/transfers_api_javascript_scripts/blob/main/javascript/alchemyweb3/tx-history/tx-history-parsed-alchemyweb3.js) [transfers\_api\_javascript\_scripts/tx-history-parsed-alchemyweb3.js at main · alchemyplatform/transfers\_api\_javascript\_scripts](https://github.com/alchemyplatform/transfers_api_javascript_scripts/blob/main/javascript/alchemyweb3/tx-history/tx-history-parsed-alchemyweb3.js) ### Node-Fetch #### Parsing with `Node-Fetch` Responses [![transfers_api_javascript_scripts/tx-history-parsed-fetch.js at main · alchemyplatform/transfers_api_javascript_scripts](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764180254%2Fdocs%2Ftutorials%2Ftransactions%2Ftransaction-history%2Ftransfers_api_javascript_scripts.png&w=3840&q=75)](https://github.com/alchemyplatform/transfers_api_javascript_scripts/blob/main/javascript/fetch/tx-history/tx-history-parsed-fetch.js) [![github.com](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764179977%2Fdocs%2Fapi-reference%2Fdata%2Ftoken-api%2Ffavicon.ico&w=3840&q=75)github.com](https://github.com/alchemyplatform/transfers_api_javascript_scripts/blob/main/javascript/fetch/tx-history/tx-history-parsed-fetch.js) [transfers\_api\_javascript\_scripts/tx-history-parsed-fetch.js at main · alchemyplatform/transfers\_api\_javascript\_scripts](https://github.com/alchemyplatform/transfers_api_javascript_scripts/blob/main/javascript/fetch/tx-history/tx-history-parsed-fetch.js) ### Axios #### Parsing with `Axios` Responses [![transfers_api_javascript_scripts/tx-history-parsed-axios.js at main · alchemyplatform/transfers_api_javascript_scripts](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764180254%2Fdocs%2Ftutorials%2Ftransactions%2Ftransaction-history%2Ftransfers_api_javascript_scripts.png&w=3840&q=75)](https://github.com/alchemyplatform/transfers_api_javascript_scripts/blob/main/javascript/axios/tx-history/tx-history-parsed-axios.js) [![github.com](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764179977%2Fdocs%2Fapi-reference%2Fdata%2Ftoken-api%2Ffavicon.ico&w=3840&q=75)github.com](https://github.com/alchemyplatform/transfers_api_javascript_scripts/blob/main/javascript/axios/tx-history/tx-history-parsed-axios.js) [transfers\_api\_javascript\_scripts/tx-history-parsed-axios.js at main · alchemyplatform/transfers\_api\_javascript\_scripts](https://github.com/alchemyplatform/transfers_api_javascript_scripts/blob/main/javascript/axios/tx-history/tx-history-parsed-axios.js) ### Raw API Response Without parsing the response, we have a console log that looks as follows. json { "transfers": [\ {\ "blockNum": "0xb7389b",\ "hash": "0xfde2a5157eda40b90514751f74e3c7314f452a41890b19a342ee147f5336dfd6", \ "from": "0x5c43b1ed97e52d009611d89b74fa829fe4ac56b1",\ "to": "0xe9b29ae1b4da8ba5b1de76bfe775fbc5e25bc69a",\ "value": 0.245,\ "erc721TokenId": null,\ "erc1155Metadata": null,\ "tokenId": null,\ "asset": "ETH",\ "category": "external",\ "rawContract": {}\ },\ {\ "blockNum": "0xcf5dea",\ "hash": "0x701f837467ae3112d787ddedf8051c4996ea82914f7a7735cb3db2d805799286",\ "from": "0x5c43b1ed97e52d009611d89b74fa829fe4ac56b1", \ "to": "0x92560c178ce069cc014138ed3c2f5221ba71f58a",\ "value": 152.89962568845024,\ "erc721TokenId": null,\ "erc1155Metadata": null,\ "tokenId": null,\ "asset": "ENS",\ "category": "token",\ "rawContract": {}\ },\ {\ "blockNum": "0xd14898",\ "hash": "0x2f5d93a9db65548eb43794aa43698acd653e6b2df35c6028b8599a234f2c6dc0",\ "from": "0x5c43b1ed97e52d009611d89b74fa829fe4ac56b1",\ "to": "0x83abecf7204d5afc1bea5df734f085f2535a9976", \ "value": 27579.060635486854,\ "erc721TokenId": null,\ "erc1155Metadata": null,\ "tokenId": null,\ "asset": "PEOPLE",\ "category": "token",\ "rawContract": {}\ }\ ] } #### Understanding API Response * `blockNum`: the block number where a transaction event occurred, in `hex` * `hash`: the transaction hash of a transaction * `from`: where the transaction originated from * `to`: where ETH or another asset was transferred to * `value`: the amount of ETH transferred * `erc721TokenId`: the ERC721 token ID. `null` if not an ERC721 token transfer. * `erc1155Metadata`: a list of objects containing the ERC1155 `tokenId` and `value`. `null` if not an ERC1155 transfer * `tokenId`: the token ID for ERC721 tokens or other NFT token standards * `asset`: `ETH` or the token's symbol. `null` if not defined in the contract and not available from other sources. * `rawContract` * `value`: raw transfer value denominated in the relevant Ethereum token * `address`: Ethereum token contract address * `decimal`: contract decimal Printing out the `asset` and `value` ------------------------------------ Two of the many different response objects you may be interested in parsing are: `asset` and `value`. Let's walk through an example that parses the returned JSON object. Whether we're querying via `alchemy web3`, `axios`, or `node-fetch`, we'll need to save the queried response object into a constant. ### Modern Web3 Libraries (Recommended) #### Saving response objects with Modern Web3 Libraries Modern // Using fetch for alchemy_getAssetTransfers API const response = await fetch(`https://eth-mainnet.g.alchemy.com/v2/${apiKey}`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ jsonrpc: '2.0', id: 1, method: 'alchemy_getAssetTransfers', params: [{\ fromBlock: "0x0",\ toAddress: "0x5c43B1eD97e52d009611D89b74fA829FE4ac56b1",\ category: ["external", "internal", "erc20", "erc721", "erc1155"]\ }] }) }); const res = await response.json(); ### Node-Fetch #### Saving response objects with `Node-Fetch` Node-fetch // Node-Fetch fetch(fetchURL, requestOptions) .then((res) => { return res.json() }) .then((jsonResponse) => { //Print token name / asset value for (const events of jsonResponse.result.transfers) { console.log("Token Transfer: ", events.value, " ", events.asset); } }) .catch((err) => { // handle error console.error(err); }); ### Axios #### Saving response objects with `Axios` Axios // Axios const res = await axios(axiosURL, requestOptions); With our queried response object saved as a constant, we can now index through the transfers. In particular, the steps we take are: 1. Loop through all transfers in the result 2. Print each element's `value` and `asset` field javascript // Print token asset name and its associated value for (const events of res.data.result.transfers) { console.log("Token Transfer: ", events.value, " ", events.asset); } If you followed along, your response should look like the following: response Token Transfer: 0.5 ETH Token Transfer: 0.27 ETH Token Transfer: 9.90384 ETH Token Transfer: 0.07024968 ETH Token Transfer: 0.000447494250654841 ETH Token Transfer: null null Token Transfer: 0.075 ETH Token Transfer: 0.003 ETH Token Transfer: null BURN Token Transfer: 54 DAI Token Transfer: 12.5 GTC Token Transfer: 2 GTC Token Transfer: 0.42 ETH ........ Token Transfer: 0.588 WETH Token Transfer: null null Token Transfer: null null Token Transfer: 2.3313024 ETH Token Transfer: 0.0633910153108353 ETH Token Transfer: 0.0335 ETH Token Transfer: 2 GTC And that's it! You've now learned how to fetch transaction history for address on Ethereum. For more, check out the tutorial below: [![alchemy.com/docs](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764180255%2Fdocs%2Ftutorials%2Ftransactions%2Ftransaction-history%2Fspaces-2F-MB17w56kk7ZnRMWdqOL-2Favatar-1631043648701.png&w=3840&q=75)alchemy.com/docs](https://www.alchemy.com/docs/alchemy/tutorials/transfers-tutorial) [Integrating Historical Transaction Data into your dApp](https://www.alchemy.com/docs/alchemy/tutorials/transfers-tutorial) If you enjoyed this tutorial for getting address transaction history on Ethereum, give us a tweet [@Alchemy](https://twitter.com/Alchemy) ! (Or give the author [@crypt0zeke](https://twitter.com/crypt0zeke) a shoutout!) Don't forget to join our [Discord server](https://www.alchemy.com/discord) to meet other blockchain devs, builders, and entrepreneurs! Was this page helpful? YesNo --- # How to Get a Contract's Last Transfer Event | Alchemy Docs Copy page How to Get a Contract's Last Transfer Event =========================================== Learn how to use Alchemy's SDK to query the transfer history of one or multiple smart contracts in a single request. This tutorial uses the **[alchemy\_getAssetTransfers](https://www.alchemy.com/docs/reference/alchemy-getassettransfers) ** endpoint. Have you ever wanted to know what's going on under the hood of a smart contract? One way to get insight into how a smart contract is used is to track a contract's transfer events. This allows you to examine how users/addresses interact with it. In this guide, you will query the last transfer even of the BAYC smart contract, though you may choose another contract of your preference. The following is a list of potential use cases: * Create an NFT tracker for reporting on the latest trades. * Create a DeFi tracker of a particular dex to get the latest transfer info or provide current information. * Create Crypto Whale Twitter bot. * Create the transfer history of a particular address or smart contract. * Build smart contract logic that requires the most up-to-date transfer info. If you already completed "How to get a contract's first transfer event" you may skip the setup and installation steps. * * * Install Node.js --------------- Head to [Node.js](https://nodejs.org/en/) and download the LTS version. You can verify your installation was successful by running `npm -version` in your macOS terminal or Windows command prompt. A successful installation will display a version number, such as: shell 6.4.1 * * * Setup Project Environment ------------------------- Open VS Code (or your preferred IDE) and enter the following in terminal: shell mkdir contract-transfers cd contract-transfers Once inside our project directory, initialize npm (node package manager) with the following command: shell npm init Press enter and answer the project prompt as follows: contract-transfers.json package name: (contract-transfers) version: (1.0.0) description: entry point: (index.js) test command: git repository: keywords: author: license: (ISC) Press enter again to complete the prompt. If successful, a `package.json` file will have been created in your directory. * * * Using Native JavaScript ----------------------- Using native fetch allows us to efficiently interact with Alchemy's endpoints and make JSON-RPC requests. * * * Get Contract's Last Transfer Event ---------------------------------- In this section, we will use Alchemy's \[Transfer API\]ref:transfers-api) to retrieve the contract's last transfer event. We can call the [`alchemy_getAssetTransfers`](https://www.alchemy.com/docs/reference/alchemy-getassettransfers) function and filter transfers by passing in the following object parameters: | Property | Description | Requirements | Default | | --- | --- | --- | --- | | `fromBlock` | Indicates from which block the endpoint searches. Inclusive and can be a hex string, integer, or `latest`. | Optional | `"0x0"` | | `toBlock` | Indicates to which block the endpoint searches. Inclusive and can be a hex string, integer, or `latest`. | Optional | `latest` | | `fromAddress` | Indicates the sending address in the transaction. Can be a hex string. | Optional | Wildcard - any address | | `toAddress` | Indicates the receiving address in the transaction. Can be a hex string. | Optional | Wildcard - any address | | `contractAddresses` | An array of contact addresses to filter for. **Note:** Only applies to transfers of `token`, `erc20`, `erc721`, and `erc1155`. | Optional | Wildcard - any address | | `category` | An array of transfer categories. Can be any of the following: `external`, `internal`, `erc20`, `erc721`, or `erc1155`. | Required | | | `excludeZeroValue` | A boolean to exclude transfers of zero value. A zero value is not the same as `null`. | Optional | `true` | | `maxCount` | The maximum number of results to return per call. **Note**: 1000 is the max per request. | Optional | `1000 or 0x3e8` | | `pageKey` | Use for [pagination](https://app.gitbook.com/o/-MB5OnTtI_5pcZn7v2wm/s/-MB17w56kk7ZnRMWdqOL/~/changes/WTZhmfICAlXTSmnAxOTR/enhanced-apis/transfers-api/how-to-get-a-contracts-first-transfer-event#pagination)
. If more results are available after the response, a `uuid` property will return. You can use this in subsequent requests to retrieve the next 1000 results of `maxCount`. | Optional | | For reference, here is an example of how the above parameters could be passed into `getAssetTransfers`: FirstTransfer.js const getFirstTransfer = async () => { const apiKey = "<-- ALCHEMY APP API KEY -->"; const requestBody = { jsonrpc: "2.0", id: 1, method: "alchemy_getAssetTransfers", params: [{\ fromBlock: "0x0",\ toBlock: "latest",\ contractAddresses: ["0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d"],\ excludeZeroValue: true,\ category: ["erc721"],\ }] }; try { const response = await fetch(`https://eth-mainnet.g.alchemy.com/v2/${apiKey}`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(requestBody) }); const data = await response.json(); console.log("Example response:", data.result); } catch (error) { console.error("Error:", error); } }; getFirstTransfer(); To get started finding a contract's first transfer, let's create a file inside our project folder named `FirstTransfer.js` and add the following code to utilize the [`alchemy_getAssetTransfers`](https://www.alchemy.com/docs/reference/alchemy-getassettransfers) endpoint: FirstTransfer.js const getFirstTransfer = async () => { const apiKey = "<-- ALCHEMY APP API KEY -->"; const requestBody = { jsonrpc: "2.0", id: 1, method: "alchemy_getAssetTransfers", params: [\ {\ fromBlock: "0x0",\ contractAddresses: ["0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d"], // You can replace with contract of your choosing\ excludeZeroValue: true,\ category: ["erc721"],\ }\ ] }; try { const response = await fetch(`https://eth-mainnet.g.alchemy.com/v2/${apiKey}`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(requestBody) }); const data = await response.json(); // printing the first indexed transfer event to console console.log("First Transfer:", data.result.transfers[0]); } catch (error) { console.error("Error:", error); } }; getFirstTransfer(); Above, we created an async function called _`getFirstTransfer`_.To learn more about how what it does, view the commented notes above. To use your script, type the following command in your terminal: shell node FirstTransfer.js If successful, you should see the following transfer object in your output: json { blockNum: '0xbc61b7', hash: '0xb74538f871af833485fd3e62c5b53234403628e3be5ae369385ee24bf546f0df', from: '0x0000000000000000000000000000000000000000', to: '0x7772881a615cd2d326ebe0475a78f9d2963074b7', value: null, erc721TokenId: '0x00000000000000000000000000000000000000000000000000000000000003b7', erc1155Metadata: null, tokenId: '0x00000000000000000000000000000000000000000000000000000000000003b7', asset: 'BAYC', category: 'erc721', rawContract: { value: null, address: '0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d', decimal: null } } Page key: 915e662f-a7ca-4c4f-a5e9-0bbf2c6a53f1 If your output includes a `page key`, you can use the value for pagination in subsequent requests. If you've received the latest transfer event, your result will not include a page key and reads as: shell Page key: none In that scenario, congratulations, you've successfully queried some of the latest transfer events! However, in our case, we did receive a UUID page key. This is because the BAYC contract contains more than 1000 transfer events (the maximum allowed per `getAssetTransfers` request). To learn more about how to use page keys, continue on to the following section. * * * Use Page Keys ------------- To account for potential page keys, we will create a loop to check whether `getAssetTransfer` returns a page key. If it does, the loop will continuously call `getAssetTransfers` until a page key no longer returns. To do this, we need to reorganize our code to make room for the while loop. Remove lines 18-25 of `LastTransfer.js`: LastTransfer.js const getLastTransfer = async () => { const apiKey = "<-- ALCHEMY APP API KEY -->"; const requestBody = { jsonrpc: "2.0", id: 1, method: "alchemy_getAssetTransfers", params: [{\ fromBlock: "0x0",\ toBlock: "latest",\ contractAddresses: ["0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d"],\ excludeZeroValue: true,\ category: ["erc721"],\ }] }; try { const response = await fetch(`https://eth-mainnet.g.alchemy.com/v2/${apiKey}`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(requestBody) }); const firstPage = await response.json(); // *** remove these lines *** const firstPageLength = firstPage.transfers.length; console.log(firstPage.transfers[firstPageLength - 1]); let pageKey = firstPage.pageKey; if (pageKey) { console.log("Page key: " + pageKey); } else { console.log("Page key: none"); } // *** ^^^^^^^^^^^^^^^^^^ *** } catch (error) { console.error("Error fetching transfers:", error); } }; getLastTransfer(); Now, replace lines 18-25 with the following code block: LastTransfer.js let pageKey = firstPage.result.pageKey; try { if (pageKey) { let counter = 0; while (pageKey) { // Request next page with pagination const nextRequestBody = { jsonrpc: "2.0", id: 1, method: "alchemy_getAssetTransfers", params: [{\ fromBlock: "0x0",\ toBlock: "latest",\ contractAddresses: ["0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d"],\ excludeZeroValue: true,\ category: ["erc721"],\ pageKey: pageKey.toString(),\ }] }; const nextResponse = await fetch(`https://eth-mainnet.g.alchemy.com/v2/${apiKey}`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(nextRequestBody) }); const nextPage = await nextResponse.json(); pageKey = nextPage.result.pageKey; if (pageKey) { counter += 1; console.log("Request #" + counter + " made!"); continue; } else { const nextPageLength = nextPage.result.transfers.length; const transferCount = counter * 1000 + nextPageLength; console.log("Last BAYC token transfer(#" + transferCount + "):"); console.log(nextPage.result.transfers[nextPageLength - 1]); break; } } } else if (pageKey === undefined) { const firstPageLength = firstPage.result.transfers.length; console.log(firstPage.result.transfers[firstPageLength - 1]); } } catch (err) { console.log("Something went wrong with your request: " + err); } To dive into the loop's details, check out the commented code above. Your entire `LastTransfer.js` script should look like this: LastTransfer.js const getLastTransfer = async () => { const apiKey = "<-- ALCHEMY APP API KEY -->"; // First request to get initial page const firstRequestBody = { jsonrpc: "2.0", id: 1, method: "alchemy_getAssetTransfers", params: [{\ fromBlock: "0x0",\ toBlock: "latest",\ contractAddresses: ["0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d"],\ excludeZeroValue: true,\ category: ["erc721"],\ }] }; try { const firstResponse = await fetch(`https://eth-mainnet.g.alchemy.com/v2/${apiKey}`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(firstRequestBody) }); const firstPage = await firstResponse.json(); let pageKey = firstPage.result.pageKey; if (pageKey) { let counter = 0; while (pageKey) { // Request next page using pageKey const nextRequestBody = { jsonrpc: "2.0", id: 1, method: "alchemy_getAssetTransfers", params: [{\ fromBlock: "0x0",\ toBlock: "latest",\ contractAddresses: ["0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d"],\ excludeZeroValue: true,\ category: ["erc721"],\ pageKey: pageKey.toString(),\ }] }; const nextResponse = await fetch(`https://eth-mainnet.g.alchemy.com/v2/${apiKey}`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(nextRequestBody) }); const nextPage = await nextResponse.json(); pageKey = nextPage.result.pageKey; if (pageKey) { counter += 1; console.log("Request #" + counter + " made!"); continue; } else { const nextPageLength = nextPage.result.transfers.length; const transferCount = counter * 1000 + nextPageLength; console.log("Last BAYC token transfer(#" + transferCount + "):"); console.log(nextPage.result.transfers[nextPageLength - 1]); break; } } } else if (pageKey === undefined) { const firstPageLength = firstPage.result.transfers.length; console.log("Last transfer from first page:"); console.log(firstPage.result.transfers[firstPageLength - 1]); } } catch (err) { console.log("Something went wrong with your request: " + err); } }; getLastTransfer(); To test our script, run the following code in your terminal: shell node LastTransfer.js If successful, your script should log each request: shell Request #1 made! Request #2 made! Request #3 made! Once your script loops through the contract's entire transfer history, you should see an output similar to the following: ouput ... Request #73 made! Request #74 made! Request #75 made! Last BAYC token transfer(#75016): { blockNum: '0xe4f531', hash: '0x9363b1b2fa0808183e713c49fd9e2720e8a1592aeae13ecb899cac4a67b8d2c0', from: '0x86018f67180375751fd42c26c560da2928e2b8d2', to: '0x3bad83b5e9a026774f3928d1f27d9d6c0590da85', value: null, erc721TokenId: '0x00000000000000000000000000000000000000000000000000000000000000c0', erc1155Metadata: null, tokenId: '0x00000000000000000000000000000000000000000000000000000000000000c0', asset: 'BAYC', category: 'erc721', rawContract: { value: null, address: '0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d', decimal: null } } Hooray! You have successfully used pagination to get the latest transfer of the BAYC contract! If you enjoyed this tutorial for retrieving a contract's latest transfer event, give us a tweet [@Alchemy](https://twitter.com/Alchemy) ! And don't forget to join our [Discord server](https://www.alchemy.com/discord) to meet other blockchain devs, builders, and entrepreneurs! Was this page helpful? YesNo --- # How to Get All the Contracts Deployed by a Wallet | Alchemy Docs Copy page How to Get All the Contracts Deployed by a Wallet ================================================= Learn how to get all the contract addresses deployed by a given wallet address Don’t have an API key? Start using Alchemy APIs in your app today. [Get started for free](https://dashboard.alchemy.com/signup?utm_source=docs&utm_medium=referral&utm_content=how-to-get-all-the-contracts-deployed-by-a-wallet) Introduction ============ In the world of Web3 development, you might want to find all the contracts deployed by a specific wallet address. This information can be useful for tracking / analyzing wallets and development activities. In this tutorial, we will walk you through how to programmatically retrieve all the contracts deployed by a wallet. ![2236](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764192926%2Fdocs%2Ftutorials%2Ftransactions%2Ftransaction-history%2F231792f-terminal-ss.png&w=3840&q=75 "terminal-ss.png") We will be using Alchemy's [getAssetTransfers](https://www.alchemy.com/docs/reference/alchemy-getassettransfers) API to fetch transaction data for a specific wallet address and, from there, extract the contracts deployed by it using the [eth\_getTransactionReceipt](https://www.alchemy.com/docs/reference/eth-gettransactionreceipt) method. * * * The Gameplan ============ To achieve our goal, we will follow these steps: 1. First, we will use the [alchemy\_getAssetTransfers](https://www.alchemy.com/docs/reference/alchemy-getassettransfers) method ([Alchemy's Transfers API](https://www.alchemy.com/docs/reference/transfers-api-quickstart) ) to fetch all transactions associated with the wallet address of interest. This method allows us to retrieve a list of transactions `to` or `from` the specified wallet address. 2. Next, we will filter the list of transactions to find only those where the `to` field is `null`. This condition indicates that the transaction resulted in the deployment of a new contract. This is true because when a contract is deployed, it does not have an address yet, as it does not exist on the blockchain. Therefore, the `to` field in the transaction is set to `null`. 3. Finally, for each of the filtered transactions, we will call the [eth\_getTransactionReceipt](https://www.alchemy.com/docs/reference/eth-gettransactionreceipt) method. This method will return the transaction receipt containing the contract address for the newly deployed contract. 4. We will store the addresses of the deployed contracts in an array and finally log that array to the console. Now, let's execute our plan! * * * Setting up the project ====================== Install Node and npm -------------------- In case you haven't already, [install node and npm](https://nodejs.org/en/download/) on your local machine. Make sure that node is at least **v14 or higher** by typing the following in your terminal: shell node -v * * * Create an Alchemy App --------------------- In case you haven't already, [sign up for a free Alchemy account](https://dashboard.alchemy.com/signup?utm_source=docs&utm_medium=referral&utm_content=how-to-get-all-the-contracts-deployed-by-a-wallet) . ![3000](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764192926%2Fdocs%2Ftutorials%2Ftransactions%2Ftransaction-history%2F38ca71f-alch-app.png&w=3840&q=75 "alch-app.png") Alchemy's account dashboard where developers can create a new app on the Ethereum blockchain. Next, navigate to the [Alchemy Dashboard](https://dashboard.alchemy.com/signup?utm_source=docs&utm_medium=referral&utm_content=how-to-get-all-the-contracts-deployed-by-a-wallet) and create a new app. Make sure you set the chain to Ethereum and the network to Mainnet. Once the app is created, click on your app's _View Key_ button on the dashboard. Take note of the **HTTP URL**. The URL will be in this form: `https://eth-mainnet.g.alchemy.com/v2/xxxxxxxxx` You will need this later. * * * Create a node project --------------------- Let's now create an empty repository and install all node dependencies. Run the following commands in order to create your node project. Shell mkdir get-deployed-contracts && cd get-deployed-contracts npm init -y touch main.js This will create a repository named `get-deployed-contracts` that holds all your files and dependencies. Next, open this repo in your favorite code editor. Now our project is set up and we are ready to write code. We will write all our code in the `main.js` file. * * * Writing and Testing the Script ============================== Coding the Script ----------------- The script below utilizes Alchemy's API to find all the contract addresses deployed by a wallet address: getDeployedContracts.js // Replace with your Alchemy API Key const apiKey = "demo"; const baseURL = `https://eth-mainnet.g.alchemy.com/v2/${apiKey}`; // Define the asynchronous function that will retrieve deployed contracts async function findContractsDeployed(address) { const transfers = []; let pageKey = undefined; // Paginate through the results using alchemy_getAssetTransfers method do { const requestBody = { jsonrpc: "2.0", id: 1, method: "alchemy_getAssetTransfers", params: [{\ fromBlock: "0x0",\ toBlock: "latest", // Fetch results up to the latest block\ fromAddress: address, // Filter results to only include transfers from the specified address\ excludeZeroValue: false, // Include transfers with a value of 0\ category: ["external"], // Filter results to only include external transfers\ ...(pageKey && { pageKey }) // Add pageKey if it exists\ }] }; const response = await fetch(baseURL, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(requestBody) }); const data = await response.json(); if (data.error) { console.error("Error:", data.error); break; } transfers.push(...data.result.transfers); pageKey = data.result.pageKey; } while (pageKey); // Filter the transfers to only include contract deployments (where 'to' is null) const deployments = transfers.filter((transfer) => transfer.to === null); const txHashes = deployments.map((deployment) => deployment.hash); // Fetch the transaction receipts for each of the deployment transactions const promises = txHashes.map(async (hash) => { const requestBody = { jsonrpc: "2.0", id: 1, method: "eth_getTransactionReceipt", params: [hash] }; const response = await fetch(baseURL, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(requestBody) }); const data = await response.json(); return data.result; }); // Wait for all the transaction receipts to be fetched const receipts = await Promise.all(promises); const contractAddresses = receipts.map((receipt) => receipt?.contractAddress).filter(Boolean); return contractAddresses; } // Define the main function that will execute the script async function main() { const address = "0x7Be8076f4EA4A4AD08075C2508e481d6C946D12b"; // Replace with the address you want to query the deployed contracts for try { // Call the findContractsDeployed function to retrieve the array of deployed contracts const contractAddresses = await findContractsDeployed(address); // Log the contract addresses in a readable format by looping through the array console.log(`The following contracts were deployed by ${address}:`); for (let i = 0; i < contractAddresses.length; i++) { console.log(`${i + 1}. ${contractAddresses[i]}`); } } catch (error) { console.error("Error:", error); } } // Call the main function to start the script main(); Let's break down the code in bullet points: * The script defines the Alchemy API URL and uses fetch to make direct HTTP requests to Alchemy's endpoints. * Then, it defines an asynchronous function `findContractsDeployed` that accepts a wallet address as its argument. * Inside the `findContractsDeployed` function, it fetches the transaction history of the wallet address using Alchemy's [`getAssetTransfers`](https://www.alchemy.com/docs/reference/sdk-getassettransfers) method. * The script paginates through the results and aggregates them in the `transfers` array. * It then filters the transfers to only include contract deployments by checking if the `"to"` property is `null`. * Then it maps the filtered deployments to their corresponding transaction hashes and fetches the transaction receipts for each of the deployment transactions using Alchemy's [`getTransactionReceipt`](https://www.alchemy.com/docs/reference/sdk-gettransactionreceipt) method. * Finally, the script waits for all the transaction receipts to be fetched and maps them to their respective deployed contract addresses using the `contractAddress` property in the transaction receipt. * The function then returns the array of these contract addresses. * The main function initializes the wallet address and calls the `findContractsDeployed` function to get the array of contract addresses deployed by the given wallet address. * It then loops through the array to display the contract addresses in a readable format. If you are facing the `"ENS name not configured"` error, try replacing the `"demo"` API key with your own API key that you copied in the ["Create an Alchemy App"](https://www.alchemy.com/docs/how-to-get-all-the-contracts-deployed-by-a-wallet#create-an-alchemy-app) section. * * * Testing the Script ------------------ Now let's test our script to verify if it's working properly. Run your script using the command below: shell node main.js You should see an output listing the contract addresses deployed by the given wallet address: output The following contracts were deployed by opensea.eth: 1. 0x05a3d4001e0b116f1B93AB4C2B2CA6FDC5E959D8 2. 0xE1Fb91513f0B2B8627027B2702E1828F73Ad7bC5 3. 0xfe32125731d36b91569Df1Ac14343890b5D068EE 4. 0x1f52b87C3503e537853e160adBF7E330eA0Be7C4 5. 0xB841F548C6C91AD85A3a2231A255a27D55928B3b 6. 0x4F1E7894ae94AB7794b852Acbc3C692b6640AE92 7. 0x65FdBc96Dd1dA4556b259dba3b64C9e60D59E4AA 8. 0x23B45c658737b12f1748CE56E9B6784B5e9f3fF8 9. 0xD6cbA47Db4e200f40857f99e1912EaA8ee016c53 10. 0x78997E9e939DAfFE7EB9ed114FBF7128D0cfcD39 11. 0x6556D909BcC60F7a749D8075f500A6e86AD5A535 12. 0x35f7319878556806E9f5B66F9d3B4506c16D3BBb 13. 0x50Db780cD7eF57BC1f982aFc7C6388f8eF758D2A 14. 0x9073A39dCeF76658d17f0EBaAA355c8fB988e2bE 15. 0x5e30B1d6f920364c847512E2528efdAdF72a97A9 16. 0xc2ae41bbC013a90000Cba1100B0695ECbD86D5f4 17. 0x495f947276749Ce646f68AC8c248420045cb7b5e * * * Conclusion ========== In this tutorial, we learned how to programmatically retrieve all the contracts deployed by a wallet address. By following the code and explanations provided, you should now be able to adapt this script to suit your specific needs or integrate it into a larger project. If you have any questions or feedback, please contact us at [\[email protected\]](https://www.alchemy.com/cdn-cgi/l/email-protection#9be8eeebebf4e9efdbfaf7f8f3fef6e2b5f8f4f6) or open a ticket in the dashboard. Was this page helpful? YesNo --- # How to Get Contract Deployment Transactions in a Block | Alchemy Docs Copy page How to Get Contract Deployment Transactions in a Block ====================================================== Learn how to get all the contract creation transactions from a block Don’t have an API key? Sign up to get access. [Get started for free](https://dashboard.alchemy.com/signup?utm_source=docs&utm_medium=referral&utm_content=how-to-get-contract-deployment-transactions-in-a-block) This tutorial uses the [getBlockWithTransactions](https://www.alchemy.com/docs/reference/sdk-getblockwithtransactions) and [getBlock](https://www.alchemy.com/docs/reference/sdk-getblock) endpoints. * * * Introduction ============ A transaction that represents the creation of a new smart contract is called a _**contract deployment transaction**_. These transactions provide valuable information about the creation of new contracts, such as the address of the contract, the code, and the parameterss passed to the contract's constructor. Apps like **Opensea** use contract deployment transactions to monitor the deployment of new NFT contracts on the network. In this tutorial, we will be using Viem and Ethers.js to retrieve contract deployment transactions in a specific block on the Ethereum blockchain. The same applies to any EVM blockchain. So, let's get started by setting up the developer environment! Developer Environment Setup =========================== Step 1: Install Node and NPM ---------------------------- In case you haven't already, [install node and npm](https://nodejs.org/en/download/) on your local machine. Make sure that node is at least **v14 or higher** by typing the following in your terminal: shell node -v * * * Step 2: Create an Alchemy App ----------------------------- In case you haven't already, [sign up for a free Alchemy account](https://dashboard.alchemy.com/signup?utm_source=docs&utm_medium=referral&utm_content=how-to-get-contract-deployment-transactions-in-a-block) . ![2880](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764192918%2Fdocs%2Ftutorials%2Ftransactions%2Funderstanding-transactions%2F06c375a-Screenshot_2022-11-04_at_10.36.40_PM.png&w=3840&q=75 "Screenshot 2022-11-04 at 10.36.40 PM.png") Alchemy's account dashboard where developers can create a new app on the Ethereum blockchain. Next, navigate to the [Alchemy Dashboard](https://dashboard.alchemy.com/signup?utm_source=docs&utm_medium=referral&utm_content=how-to-get-contract-deployment-transactions-in-a-block) and [create a new app](https://www.alchemy.com/docs/alchemy-quickstart-guide) . Make sure you set the chain to Ethereum and the network to Mainnet. Once the app is created, click on your app's _View Key_ button on the dashboard. Take note of the **API KEY**. You will need this later. * * * Step 3: Create a Node Project ----------------------------- Let's now create an empty repository and install all the node dependencies. shell mkdir get-contractDeployments && get-contractDeployments npm init -y npm install viem ethers touch main.js This will create a repository named `get-contractDeployments` that holds all your files and dependencies. Next, open this repo in your favorite code editor. We will write our code in the `main.js` file. * * * Getting Contract Deployment Transactions ======================================== We will look at two ways in which we can find the contract deployment transactions in a block: * The first approach uses the fact that there is no `to` address for a contract deployment transaction. This is true because when a contract is deployed, it does not have an address yet, as it does not exist on the blockchain. Therefore, the `to` field in the transaction is set to `null`. * The second approach identifies a contract deployment transaction by looking at the type of `OPCODE` for the transaction. If the `type` is `CREATE` or `CREATE2` then it is a contract deployment transaction, otherwise not. CREATE and CREATE2 are OPCODES that are observed during a contract deployment. CREATE is the original way of creating a new smart contract. It deploys a smart contract by creating a new contract address. The contract address is determined by the contract creator's address and the nonce of the creator's account. CREATE2, on the other hand, is a more recent addition to the Ethereum protocol, introduced in the Constantinople hard fork. It allows for the creation of contracts at a specified address, determined by the combination of a salt value and the contract code's keccak256 hash. This allows for more flexibility when creating smart contracts. For more information read Alchemy's guide on [deriving contract addresses using CREATE2](https://www.alchemy.com/docs/create2-an-alternative-to-deriving-contract-addresses) . Both CREATE and CREATE2 transactions have the `to` field set to null because the contract address is not known at the time of deployment. Approach 1: The `to` address ---------------------------- ### Writing the script Add the following code to the `main.js` file. Here's an overview of what the code is doing (also explained in the comments): 1. The code imports the necessary modules from Viem and Ethers.js. 2. Configures the API Key and network to interact with the Ethereum blockchain. 3. Creates a new instance of the Alchemy class using the previously defined settings to interact with the SDK. 4. Declares a variable `blockHashOrNumber` and assigns it a block number or hash. 5. Uses the `getBlockWithTransactions` method to retrieve information about the block and its transactions. 6. Retrieves the transactions in the block. 7. Creates an array `contractDeploymentTxHashes` to store the transaction hashes of contract deployment transactions. 8. Loops through the transactions in the block, checking if each transaction is a contract deployment by checking if the `to` address is `null`. 9. If the transaction is a contract deployment, add its tx hash to the array of contract deployment transaction hashes. 10. Logs the array of contract deployment transaction hashes. Viem Ethers.js import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' // Replace with your Alchemy API Key const apiKey = "demo"; const client = createPublicClient({ chain: mainnet, transport: http(`https://eth-mainnet.g.alchemy.com/v2/${apiKey}`) }) async function main() { try { // Block number to get contract deployment transactions from const blockNumber = BigInt(15530600); // Getting the block with transactions const block = await client.getBlock({ blockNumber: blockNumber, includeTransactions: true }); // Creating an array to store the tx hashes of contract deployment transactions const contractDeploymentTxHashes = []; // Looping through the transactions and checking if they are contract deployments for (const tx of block.transactions) { // Checking if the transaction is a contract deployment (to address is null) if (tx.to === null) { contractDeploymentTxHashes.push(tx.hash); } } // Logging the array of contract deployment transaction hashes console.log('Contract deployment transaction hashes:'); console.log(contractDeploymentTxHashes); } catch (error) { console.error('Error:', error); } } main(); * * * ### Testing the Script Run the script using the following command: terminal node main.js You should see an array containing the transaction hashes of contract deployment transactions in the block as the output. json [\ '0x38a071a0282808c67a8a046f34f5e3dc1145789b6af1118e3b060f9293cb0408'\ ] In this case, we only had 1 contract deployment transaction in the given block. You can check out this transaction on [Etherscan](https://etherscan.io/tx/0x38a071a0282808c67a8a046f34f5e3dc1145789b6af1118e3b060f9293cb0408) . ![1950](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764192925%2Fdocs%2Ftutorials%2Ftransactions%2Ftransaction-history%2F4a9e44f-contract-deployment-tx.png&w=3840&q=75 "contract-deployment-tx.png") * * * Approach 2: OPCODES ------------------- ### Writing the script Add the following code to the `main.js` file. Here's an overview of what the code is doing (also explained in the comments): 1. The code imports the necessary modules from Viem and Ethers.js. 2. Configures the API Key and network to interact with the Ethereum blockchain. 3. Creates a new instance of the Alchemy class using the previously defined settings to interact with the SDK. 4. Declares a variable `blockHashOrNumber` and assigns it a block number or hash. 5. Uses the `getBlock` method to retrieve information about the block. 6. Extracts the transaction hashes of all the transactions in the block. 7. Creates an array `contractDeploymentTxHashes` to store the transaction hashes of contract deployment transactions. 8. Loops through the transaction hashes in the block. 9. For each transaction hash it uses the `traceTransaction` method of `debug` namespace to get the traces for that transaction. 10. Checking if the transaction is a contract deployment by checking the type of transaction, if it is "CREATE" or "CREATE2". 11. If the transaction is a contract deployment, add its tx hash to the array of contract deployment transaction hashes. 12. Logs the array of contract deployment transaction hashes. main.js // Note: This approach uses debug_traceTransaction which requires archive node access // and is significantly slower than Approach 1 async function main() { // Replace with your Alchemy API Key const apiKey = "demo"; const url = `https://eth-mainnet.g.alchemy.com/v2/${apiKey}`; // Block number to get contract deployment transactions from const blockNumber = 15530600; // First get the block to extract transaction hashes const blockResponse = await fetch(url, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ jsonrpc: '2.0', id: 1, method: 'eth_getBlockByNumber', params: [`0x${blockNumber.toString(16)}`, false] }) }); const blockData = await blockResponse.json(); const blockTxHashes = blockData.result.transactions; // Creating an array to store the tx hashes of contract deployment transactions const contractDeploymentTxHashes = []; console.log("getting the contract deployment transactions..."); // Looping through the transactions of block and for each transaction checking if it is a contract deployment transaction for (const txHash of blockTxHashes) { try { // Using the debug_traceTransaction method to get the trace of the transaction const traceResponse = await fetch(url, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ jsonrpc: '2.0', id: 1, method: 'debug_traceTransaction', params: [txHash, { tracer: 'callTracer' }] }) }); const traceData = await traceResponse.json(); if (traceData.result) { // Checking if the transaction is a contract deployment (because CREATE and CREATE2 OPCODES are used for contract deployments) const isContractDeployment = traceData.result.type === "CREATE" || traceData.result.type === "CREATE2"; // If the transaction is a contract deployment, add its tx hash to the array of contract deployment transaction hashes if (isContractDeployment) { contractDeploymentTxHashes.push(txHash); } } } catch (error) { console.error(`Error tracing transaction ${txHash}:`, error); } } // Logging the array of contract deployment transaction hashes console.log('Contract deployment transaction hashes:'); console.log(contractDeploymentTxHashes); } // Calling the main function to run the code main().catch(console.error); * * * ### Testing the Script Run the script using the following command: terminal node main.js You should see an array containing the transaction hashes of contract deployment transactions in the block as the output. terminal getting the contract deployment transactions... [\ '0x38a071a0282808c67a8a046f34f5e3dc1145789b6af1118e3b060f9293cb0408'\ ] Comparing the Two Approaches ---------------------------- 1. **Number of API Calls:** In terms of API calls, [Approach 1](https://www.alchemy.com/docs/how-to-get-contract-deployment-transactions-in-a-block#approach-1-the-to-address) (checking if the `to` address is `null`) is better than [Approach 2](https://www.alchemy.com/docs/how-to-get-contract-deployment-transactions-in-a-block#approach-2-opcodes) (checking for `CREATE` and `CREATE2` OPCODES) because in the first method, we are only making one API call to the `getBlockWithTransactions` endpoint but in the second approach, we first get the transaction hashes for all the transactions in the block using the `getBlock` method and then for each transaction hash we call the `traceTransaction` method to get the traces for that transaction. So, if there are `n` transactions in the block, we are making `n + 1` API calls in the second approach but only 1 using the first approach. 2. **Speed:** It takes time to make an API call as the request is sent to the server and the response is returned over the network. Due to more API calls, the second approach becomes slower than the first. Therefore, generally, you would prefer the first approach but there might be cases when you are already making those API calls for doing some other stuff in your code, in those cases, you can use the second approach as well. Conclusion ========== Congratulations! You now know how to get contract deployment transactions in a block 🎉 If you have any questions or feedback, please contact us at [\[email protected\]](https://www.alchemy.com/cdn-cgi/l/email-protection#fc8f898c8c938e88bc9d909f94999185d29f9391) or open a ticket in the dashboard. Was this page helpful? YesNo --- # Batch Requests | Alchemy Docs Copy page Batch Requests ============== Best practices for making batch json-rpc requests on Ethereum, Polygon, Optimism, and Arbitrum. What is a batch request? ------------------------ Batch requests are a single HTTP request that contain multiple API calls nested within it. Clients can send several request objects together at the same time, filled within an array, will get a corresponding array of response objects from the server. The server processes all requests of this batch RPC call concurrently, in any order. The response objects returned from a batch RPC can be in any order, the client should match contexts of request objects to response objects based on `id` member of each object. Also, In several use-cases which contains different JSON-RPC endpoints, the batching approach can get easily complicated. Due to these above-mentioned reasons, Alchemy does not recommend using batch requests as they can be less reliable compared to individual API calls. What is the batch requests limit over HTTP? ------------------------------------------- The batch request limit over HTTP for all methods and chains is **1000 requests per batch**, above this limit requests are likely to be less reliable. What is the batch requests limit over WebSockets? ------------------------------------------------- The maximum size of a JSON-RPC `batch` request that can be sent over a WebSocket connection is 20. Unsupported batch request APIs ------------------------------ Batch requests are currently not supported on some of the Alchemy's Enhanced APIs and Trace/Debug APIs, this includes the APIs listed below: * [Transfers API](https://www.alchemy.com/docs/reference/transfers-api-quickstart) * [Transact APIs](https://www.alchemy.com/docs/reference/transact-api-quickstart) * [Transaction Receipts API](https://www.alchemy.com/docs/reference/transaction-receipts-endpoints) * [Token APIs](https://www.alchemy.com/docs/reference/token-api-quickstart) * [Subscription APIs](https://www.alchemy.com/docs/reference/subscription-api) (except [`newPendingTransactions`](https://www.alchemy.com/docs/reference/newpendingtransactions) [`newHeads`](https://www.alchemy.com/docs/reference/newheads) and [`logs`](https://www.alchemy.com/docs/reference/logs) ) * [Trace APIs](https://www.alchemy.com/docs/reference/trace-api-quickstart) * [Debug APIs](https://www.alchemy.com/docs/reference/debug-api-quickstart) How do you make a batch request? -------------------------------- Batch requests are formatted the same as individual API requests however, the body of the request is an array containing the individual API calls you wish to make, rather than the single API call. Check out the example with [eth\_blockNumber](https://www.alchemy.com/docs/reference/eth-blocknumber) below: #### Single eth\_blockNumber request curl Javascript curl https://eth-mainnet.g.alchemy.com/v2/your-api-key \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":0}' #### Batch eth\_blockNumber request curl javascript curl https://eth-mainnet.g.alchemy.com/v2/your-api-key \ -X POST \ -H "Content-Type: application/json" \ -d '[{"jsonrpc": "2.0", "id": 1, "method": "eth_blockNumber", "params": []},\ {"jsonrpc": "2.0", "id": 2, "method": "eth_blockNumber", "params": []},\ {"jsonrpc": "2.0", "id": 3, "method": "eth_blockNumber", "params": []},\ {"jsonrpc": "2.0", "id": 4, "method": "eth_blockNumber", "params": []}]' How do you make batch requests over REST? ----------------------------------------- Batch Requests are usually for JSON-RPC endpoints, but Alchemy provides support for batch requests over REST as well. It currently only supports one type of REST API for batch requests: [getNFTMetadataBatch](https://www.alchemy.com/docs/reference/getnftmetadatabatch) . Check example code below. curl javascript curl --request POST \ --url https://eth-mainnet.g.alchemy.com/nft/v2/demo/getNFTMetadataBatch \ --header 'accept: application/json' \ --header 'content-type: application/json' --data '[{"0x5180db8F5c931aaE63c74266b211F580155ecac8","1590"},\ {"0x5280db8F5c931aaE63c74266b211F580155ecac8","1591"}]' Handling errors in batch requests --------------------------------- Batch requests always return a `200` HTTP status code, even if some or all requests within the batch fail. Therefore, it is important to parse the [JSON-RPC error codes](https://www.alchemy.com/docs/reference/error-reference#standard-json-rpc-errors) in the response to determine if the individual requests within the batch succeeded or failed. Was this page helpful? YesNo --- # Trace API vs. Debug API | Alchemy Docs Copy page Trace API vs. Debug API ======================= The differences between the Trace API by Openethereum and the Debug API by Geth Prerequisites ============= Before reading this article you should know about [Ethereum Clients](https://www.alchemy.com/overviews/execution-layer-and-consensus-layer-node-clients) and [EVM Traces](https://www.alchemy.com/docs/reference/what-are-evm-traces) . Introduction ============ Geth and Openethereum are two popular Ethereum clients. In this article, we'll compare and contrast the [debug API](https://www.alchemy.com/docs/reference/debug-api-endpoints) offered by Geth with the [trace API](https://www.alchemy.com/docs/reference/trace-api-quickstart) offered by Openethereum and Erigon. Debug API ========= The [Debug API](https://www.alchemy.com/docs/reference/debug-api-endpoints) is a set of RPC methods developed by the Go-Ethereum team that provide deeper insights into transaction processing. Some common debug API methods are: 1. [debug\_traceTransaction](https://www.alchemy.com/docs/reference/debug-tracetransaction) 2. [debug\_traceCall](https://www.alchemy.com/docs/reference/debug-tracecall) 3. [debug\_traceBlockByNumber](https://www.alchemy.com/docs/reference/debug-traceblockbynumber) 4. [debug\_traceBlockByHash](https://www.alchemy.com/docs/reference/debug-traceblockbyhash) Trace API ========= [Trace API Quickstart](https://www.alchemy.com/docs/reference/trace-api-quickstart) is Openethereum's equivalent to Geth's Debug API. It is also a set of RPC methods that provide deeper insights into transaction processing. Some common Trace API methods are: 1. [trace\_transaction](https://www.alchemy.com/docs/reference/trace-transaction) 2. [trace\_call](https://www.alchemy.com/docs/reference/trace-call) 3. [trace\_block](https://www.alchemy.com/docs/reference/trace-block) 4. [trace\_filter](https://www.alchemy.com/docs/reference/trace-filter) 5. [trace\_get](https://www.alchemy.com/docs/reference/trace-get) 6. [trace\_rawTransaction](https://www.alchemy.com/docs/reference/trace-rawtransaction) 7. [trace\_replayBlockTransactions](https://www.alchemy.com/docs/reference/trace-replayblocktransactions) 8. [trace\_replayTransaction](https://www.alchemy.com/docs/reference/trace-replaytransaction) Difference between Trace API and Debug API ========================================== 1. Geth offers debug API while Trace API is offered by Openethereum and Erigon. 2. Debug API has more methods than Trace API. [Here](https://geth.ethereum.org/docs/rpc/ns-debug) you can find a list of all the methods that Debug API supports. 3. Debug API is more accessible than Trace API as the majority of the Ethereum nodes run the Geth client. 4. Trace API does not include calls to the 9 precompiled contracts specified in the Ethereum chain specification, while debug API does. Precompiled contracts are a feature of the Ethereum Virtual Machine (EVM) that allow for efficient execution of certain computationally expensive operations. These contracts are built into the EVM and can be called by other contracts to perform specific tasks. They are specified as a part of the Ethereum chain specification, and their addresses are hardcoded into the EVM. Currently, there are nine precompiled contracts in the Ethereum network. These precompiled contracts can be called by other smart contracts, and the gas cost of executing them is determined by the size of the input data, which is fixed and known in advance. It means that the execution cost of these contracts is constant, regardless of the specific input provided. This is useful for operations that are known to be computationally expensive, such as elliptic curve operations, modular exponentiation, and hash calculations. 5. Trace API includes REWARDS for miners in the trace, but debug API does not. 6. The representation of the callstack is different between Trace and Debug API, trace API includes a field called [traceAddress](https://www.alchemy.com/docs/reference/what-are-evm-traces#how-to-read-traceaddress) which gives the exact location of the call trace, while the call stack is nested in the response in debug API. 7. The way error handling is done is different in Trace and Debug API, trace API uses [custom](https://github.com/ledgerwatch/erigon/blob/devel/cmd/rpcdaemon/commands/trace_adhoc.go#L390) error handling while debug API uses [predefined constants](https://github.com/ethereum/go-ethereum/blob/1fa91729f2a591df2baf2dc77e81711a6e61c028/core/vm/errors.go) to represent errors that can occur during EVM execution. ![6144](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764192958%2Fdocs%2Fapi-reference%2Ftrace-api%2Ftrace-api-resources%2F65b8e7b-eth-nodes-illustration.png&w=3840&q=75 "eth-nodes-illustration.png") Was this page helpful? YesNo --- # Yellowstone gRPC Quickstart | Alchemy Docs Copy page Yellowstone gRPC Quickstart =========================== Quickstart Guide ================ This guide will walk you through making your first Yellowstone gRPC connection and streaming real-time Solana data. Prerequisites ------------- Before you begin, ensure you have: * **Alchemy Team with PAYG or Enterprise Plan**: Yellowstone gRPC is only available to PAYG (Pay-As-You-Go) and Enterprise teams * **Create an Alchemy App**: You'll need to create an app in your Alchemy dashboard to get your endpoint URL and API key * **Get your API Key**: Your Alchemy API key will be used as the `X-Token` header for authentication * Basic understanding of gRPC concepts * Understanding of Solana's slot and commitment level concepts Authentication -------------- Get your endpoint URL and API key from your Alchemy dashboard. ![](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764192955%2Fdocs%2Fapi-reference%2Fyellowstone%2Fyellowstone-get_api_key.png&w=3840&q=75 "Yellowstone Get API Key") **Important**: Your Alchemy API Key must be passed as the `X-Token` header in your gRPC requests (not in the URL). let endpoint = "https://solana-mainnet.g.alchemy.com"; let x_token = "ALCHEMY_API_KEY"; let client = GeyserGrpcClient::build_from_shared(endpoint)? .tls_config(ClientTlsConfig::new().with_native_roots())? .x_token(Some(x_token))? .connect() .await?; Your First Connection --------------------- ### Rust Example Below is a basic example of connecting to Yellowstone gRPC with Rust and streaming all transactions. use anyhow::Result; use futures::{sink::SinkExt, stream::StreamExt}; use solana_signature::Signature; use std::collections::HashMap; use yellowstone_grpc_client::{ClientTlsConfig, GeyserGrpcClient}; use yellowstone_grpc_proto::geyser::{ CommitmentLevel, SubscribeRequest, SubscribeRequestFilterTransactions, subscribe_update::UpdateOneof, }; #[tokio::main] async fn main() -> Result<()> { // Set up connection parameters let endpoint = "https://solana-mainnet.g.alchemy.com"; let x_token = "ALCHEMY_API_KEY"; // Replace with your Alchemy API key // Build and connect the gRPC client with TLS and authentication let mut client = GeyserGrpcClient::build_from_shared(endpoint)? .tls_config(ClientTlsConfig::new().with_native_roots())? .x_token(Some(x_token))? // API key passed as X-Token header .connect() .await?; // Create a bidirectional stream for subscribing to updates let (mut tx, mut stream) = client.subscribe().await?; // Send subscription request to filter for non-vote, non-failed transactions tx.send(SubscribeRequest { transactions: HashMap::from([(\ "all_transactions".to_string(),\ SubscribeRequestFilterTransactions {\ vote: Some(false), // Exclude vote transactions\ failed: Some(false), // Exclude failed transactions\ ..Default::default()\ },\ )]), commitment: Some(CommitmentLevel::Confirmed as i32), // Use confirmed commitment level ..Default::default() }) .await?; // Process incoming transaction updates while let Some(Ok(msg)) = stream.next().await { if let Some(UpdateOneof::Transaction(tx)) = msg.update_oneof { // Extract and display transaction signature let sig = tx .transaction .and_then(|t| Some(Signature::try_from(t.signature.as_slice()).unwrap())) .unwrap_or_default(); println!("Slot: {} | Signature: {}", tx.slot, sig); } } Ok(()) } ### Other Languages Yellowstone gRPC supports multiple programming languages. Choose the client that fits your stack: **Official Examples Available:** * **Rust** - [Official Rust Example](https://github.com/rpcpool/yellowstone-grpc/tree/master/examples/rust) * **Python** - [Official Python Example](https://github.com/rpcpool/yellowstone-grpc/tree/master/examples/python) * **TypeScript/JavaScript** - [Official TypeScript Example](https://github.com/rpcpool/yellowstone-grpc/tree/master/examples/typescript) * **Go** - [Official Go Example](https://github.com/rpcpool/yellowstone-grpc/tree/master/examples/golang) Next Steps ---------- Now that you've established your first connection, explore: * [API Reference](https://www.alchemy.com/docs/reference/yellowstone-grpc-api-overview) - Detailed documentation of all filters and options * [Code Examples](https://www.alchemy.com/docs/reference/yellowstone-grpc-examples) - See complete working examples * [Best Practices](https://www.alchemy.com/docs/reference/yellowstone-grpc-best-practices) - Learn production patterns and optimization tips Was this page helpful? YesNo --- # Subscribe to Slots | Alchemy Docs Copy page Subscribe to Slots ================== Subscribe to Slots ================== Slot subscriptions provide real-time updates about Solana's slot progression. This is essential for understanding chain state, tracking confirmations, and synchronizing your application with the blockchain. Overview -------- A slot represents a period of time (400ms) during which a leader can produce a block. Slot subscriptions notify you as slots progress through different states: * When a slot is first created * When a slot becomes frozen (no more transactions can be added) * When a slot reaches different commitment levels * Parent-child relationships between slots Filter Structure ---------------- message SubscribeRequestFilterSlots { optional bool filter_by_commitment = 1; optional bool interslot_updates = 2; } Filter Options -------------- ### Filter by Commitment Control whether to receive updates only for specific commitment levels. **Field**: `filter_by_commitment` **Type**: `bool` **Default**: `false` **When `false`**: * Receive updates for all slot state changes * Most comprehensive view of chain progression **When `true`**: * Only receive updates matching the commitment level specified in the main `SubscribeRequest` * Reduces update volume * Useful when you only care about confirmed or finalized slots ### Interslot Updates Control whether to receive updates during slot progression (before slot completion). **Field**: `interslot_updates` **Type**: `optional bool` **Default**: `false` **When `true`**: * Receive multiple updates as slot progresses through different states * More granular view of slot lifecycle * Higher update volume **When `false`**: * Receive updates only at major slot state transitions * Lower update volume Response Structure ------------------ Slot updates arrive as `SubscribeUpdateSlot` messages: message SubscribeUpdateSlot { uint64 slot = 1; optional uint64 parent = 2; SlotStatus status = 3; optional string dead_error = 4; } enum SlotStatus { SLOT_PROCESSED = 0; SLOT_CONFIRMED = 1; SLOT_FINALIZED = 2; SLOT_FIRST_SHRED_RECEIVED = 3; SLOT_COMPLETED = 4; SLOT_CREATED_BANK = 5; SLOT_DEAD = 6; } ### Fields **`slot`**: The slot number **`parent`**: Parent slot number (optional) **`status`**: Current status of the slot (see SlotStatus enum) **`dead_error`**: If present, error message indicating why the slot is dead/skipped ### Slot Status Values **`SLOT_PROCESSED`** (0): Slot has been processed by the validator **`SLOT_CONFIRMED`** (1): Slot has received supermajority confirmation **`SLOT_FINALIZED`** (2): Slot is finalized and cannot be rolled back **`SLOT_FIRST_SHRED_RECEIVED`** (3): First shred (data fragment) of the slot received **`SLOT_COMPLETED`** (4): Slot has been completed **`SLOT_CREATED_BANK`** (5): Bank (account state) created for this slot **`SLOT_DEAD`** (6): Slot has been marked as dead/skipped Was this page helpful? YesNo --- # newPendingTransactions | Alchemy Docs Copy page newPendingTransactions ====================== Emits transaction hashes that are sent to the network and marked as \\pending\\. The `newPendingTransactions` subscription type subscribes to all pending transactions via WebSockets (regardless if you sent them or not), and returns their transaction hashes. When listening to pending transactions with this endpoint, you will only get pending transactions in Alchemy mempool. We highly recommend using `alchemy_pendingTransactions` instead of `newPendingTransactions` to receive more detailed information like full transaction objects as well as filtering on `from` and `to` addresses for pending transactions. Supported Networks ================== Check the [Chains](https://dashboard.alchemy.com/chains?utm_source=docs&utm_medium=referral&utm_content=reference_newpendingtransactions) page for details about product and chain support! ![](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764179964%2Fdocs%2Fapi-reference%2Falchemy-transact%2Ftransaction-simulation%2F523fb8a9a9d899921ee1046d0ff1b389967a9976d1c6112ebbbe071ddd1ef374-image.png&w=3840&q=75) Returns the hash for all transactions that are added to the pending state (regardless if you sent them or not). Parameters ========== None Returns ======= * `result`: `string` - transaction hash for pending transaction * `subscription`: `string` - subscription ID Request ======= wscat alchemyweb3.js // initiate websocket stream first wscat -c wss://eth-mainnet.g.alchemy.com/v2/demo // then call subscription {"jsonrpc":"2.0","id": 2, "method": "eth_subscribe", "params": ["newPendingTransactions"]} Result ====== result {"id":1,"result":"0xc3b33aa549fb9a60e95d21862596617c","jsonrpc":"2.0"} { "jsonrpc":"2.0", "method":"eth_subscription", "params":{ "subscription":"0xc3b33aa549fb9a60e95d21862596617c", "result":"0xd6fdc5cc41a9959e922f30cb772a9aef46f4daea279307bc5f7024edc4ccd7fa" } } Was this page helpful? YesNo --- # Subscribe to Accounts | Alchemy Docs Copy page Subscribe to Accounts ===================== Subscribe to Accounts ===================== Account subscriptions allow you to monitor changes to Solana accounts in real-time. This is essential for tracking token balances, program state changes, and any other on-chain data stored in accounts. Overview -------- Account subscriptions provide real-time updates whenever an account's data, lamports, or owner changes. You can filter accounts by: * Specific account addresses * Account owner (program) * Data size * Memory comparisons (byte patterns at specific offsets) Filter Structure ---------------- message SubscribeRequestFilterAccounts { repeated string account = 2; repeated string owner = 3; repeated SubscribeRequestFilterAccountsFilter filters = 4; optional bool nonempty_txn_signature = 5; } message SubscribeRequestFilterAccountsFilter { oneof filter { SubscribeRequestFilterAccountsFilterMemcmp memcmp = 1; uint64 datasize = 2; bool token_account_state = 3; SubscribeRequestFilterAccountsFilterLamports lamports = 4; } } message SubscribeRequestFilterAccountsFilterMemcmp { uint64 offset = 1; oneof data { bytes bytes = 2; string base58 = 3; string base64 = 4; } } message SubscribeRequestFilterAccountsFilterLamports { oneof cmp { uint64 eq = 1; uint64 ne = 2; uint64 lt = 3; uint64 gt = 4; } } Filter Options -------------- ### Account Address Filter Monitor specific accounts by their public key addresses. **Field**: `account` **Type**: `repeated string` **Use Cases**: * Track a specific token account balance * Monitor a user's wallet * Watch a liquidity pool account * Track NFT metadata accounts ### Owner Filter Subscribe to all accounts owned by a specific program. **Field**: `owner` **Type**: `repeated string` **Use Cases**: * Monitor all accounts for a specific program * Track all token accounts (Token Program owned) * Watch all accounts for a custom program * Monitor DEX program accounts ### Memcmp Filter Filter accounts by matching byte patterns at specific offsets in the account data. **Field**: `memcmp` (within `filters`) **Type**: `SubscribeRequestFilterAccountsFilterMemcmp` **Use Cases**: * Filter token accounts for a specific mint * Match accounts with specific discriminators * Find accounts containing specific pubkeys ### Data Size Filter Filter accounts by their data size. **Field**: `datasize` (within `filters`) **Type**: `uint64` **Use Cases**: * Filter by account type based on size * Optimize bandwidth by excluding large accounts * Target specific program account types ### Token Account State Filter Filter only for token accounts. **Field**: `token_account_state` (within `filters`) **Type**: `bool` ### Lamports Filter Filter accounts by their lamport balance. **Field**: `lamports` (within `filters`) **Type**: `SubscribeRequestFilterAccountsFilterLamports` **Comparison operators**: * `eq` - Equal to * `ne` - Not equal to * `lt` - Less than * `gt` - Greater than **Use Cases**: * Find accounts with specific balance * Monitor accounts above/below threshold * Filter out empty accounts ### Nonempty Transaction Signature Only receive account updates that are associated with a transaction. **Field**: `nonempty_txn_signature` **Type**: `optional bool` Combining Filters ----------------- You can combine multiple filters to narrow your subscription to match specific patterns. Response Structure ------------------ When an account changes, you receive a `SubscribeUpdateAccount` message: message SubscribeUpdateAccount { SubscribeUpdateAccountInfo account = 1; uint64 slot = 2; bool is_startup = 3; } message SubscribeUpdateAccountInfo { bytes pubkey = 1; uint64 lamports = 2; bytes owner = 3; bool executable = 4; uint64 rent_epoch = 5; bytes data = 6; uint64 write_version = 7; optional bytes txn_signature = 8; } Was this page helpful? YesNo --- # Subscribe Request | Alchemy Docs Copy page Subscribe Request ================= Subscribe Request ================= The `SubscribeRequest` message is the foundation of all Yellowstone gRPC subscriptions. It defines what data you want to receive and how you want to filter it. Request Structure ----------------- A `SubscribeRequest` contains multiple subscription types that can be combined in a single request: message SubscribeRequest { map accounts = 1; map slots = 2; map transactions = 3; map transactions_status = 10; map blocks = 4; map blocks_meta = 5; map entry = 8; optional CommitmentLevel commitment = 6; repeated SubscribeRequestAccountsDataSlice accounts_data_slice = 7; optional SubscribeRequestPing ping = 9; optional uint64 from_slot = 11; } Key Parameters -------------- ### `accounts` Map of account subscription filters. The key is a user-defined identifier for the subscription. **Type**: `map` See [Subscribe to Accounts](https://www.alchemy.com/docs/reference/yellowstone-grpc-subscribe-accounts) for details. ### `slots` Map of slot subscription filters. The key is a user-defined identifier for the subscription. **Type**: `map` See [Subscribe to Slots](https://www.alchemy.com/docs/reference/yellowstone-grpc-subscribe-slots) for details. ### `transactions` Map of transaction subscription filters. The key is a user-defined identifier for the subscription. **Type**: `map` See [Subscribe to Transactions](https://www.alchemy.com/docs/reference/yellowstone-grpc-subscribe-transactions) for details. ### `blocks` Map of full block subscription filters. The key is a user-defined identifier for the subscription. **Type**: `map` See [Subscribe to Blocks](https://www.alchemy.com/docs/reference/yellowstone-grpc-subscribe-blocks) for details. ### `blocks_meta` Map of block metadata subscription filters. The key is a user-defined identifier for the subscription. **Type**: `map` ### `entry` Map of entry subscription filters. The key is a user-defined identifier for the subscription. **Type**: `map` Entries represent the unit of blockchain data between transactions and blocks. Entry subscriptions are advanced use cases for low-level block construction monitoring. ### `transactions_status` Map of transaction status subscription filters. Similar to transaction subscriptions but for transaction status updates. **Type**: `map` Transaction status updates provide information about transaction execution status separately from full transaction data. ### `commitment` The commitment level for the subscription. Controls when updates are sent based on Solana's confirmation status. **Type**: `optional CommitmentLevel` **Values**: * `PROCESSED` - Fastest updates, can be rolled back * `CONFIRMED` - Supermajority vote received (recommended for most use cases) * `FINALIZED` - Fully finalized, cannot be rolled back **Default**: `CONFIRMED` ### `accounts_data_slice` Specify which portions of account data to include in responses. Reduces bandwidth when you only need specific data ranges. **Type**: `repeated SubscribeRequestAccountsDataSlice` **Structure**: message SubscribeRequestAccountsDataSlice { uint64 offset = 1; uint64 length = 2; } Each slice specifies an offset and length to extract from account data. ### `from_slot` **Start streaming from a historical slot.** This allows you to replay up to 6000 slots of historical data. **Type**: `optional uint64` **Behavior**: * If specified, streaming begins from this slot number * All matching data from `from_slot` onwards will be sent * Historical data up to **6000 slots** back is available (~40 minutes) * If not specified, streaming begins from the current slot **Use Cases**: * Recover from application downtime * Backfill historical data * Test application logic against real historical events * Debug specific slot ranges ### `ping` Can be used to send a ping to the server to maintain connection health. **Type**: `optional SubscribeRequestPing` Filter Identifiers ------------------ Each filter map uses string keys that you define. These identifiers are included in `SubscribeUpdate` messages, allowing you to determine which filter matched the data. **Best Practices**: * Use descriptive identifiers (e.g., "usdc\_accounts", "swap\_transactions") * Keep identifiers consistent across your application * Use identifiers to route data to different handlers Combining Multiple Subscriptions -------------------------------- You can combine multiple subscription types in a single request: // Create a subscription request that combines multiple subscription types SubscribeRequest { // Subscribe to all slot updates // The key "all_slots" is a user-defined identifier that will be included in responses slots: HashMap::from([(\ "all_slots".to_string(),\ SubscribeRequestFilterSlots {\ // Use default filter settings to receive all slot updates\ ..Default::default()\ },\ )]), // Subscribe to transactions with specific filters // The key "all_transactions" identifies this subscription in responses transactions: HashMap::from([(\ "all_transactions".to_string(),\ SubscribeRequestFilterTransactions {\ vote: Some(false), // Exclude vote transactions to reduce data volume\ failed: Some(false), // Exclude failed transactions (only successful ones)\ // Use default values for other filter fields (no account/signature filters)\ ..Default::default()\ },\ )]), // Set commitment level to CONFIRMED for balance between speed and reliability // CONFIRMED means supermajority vote has been received commitment: Some(CommitmentLevel::Confirmed as i32), // Use default values for other subscription types (accounts, blocks, etc.) ..Default::default() } Response: SubscribeUpdate ------------------------- The server responds with a stream of `SubscribeUpdate` messages containing: message SubscribeUpdate { repeated string filters = 1; oneof update_oneof { SubscribeUpdateAccount account = 2; SubscribeUpdateSlot slot = 3; SubscribeUpdateTransaction transaction = 4; SubscribeUpdateTransactionStatus transaction_status = 10; SubscribeUpdateBlock block = 5; SubscribeUpdatePing ping = 6; SubscribeUpdatePong pong = 9; SubscribeUpdateBlockMeta block_meta = 7; SubscribeUpdateEntry entry = 8; } google.protobuf.Timestamp created_at = 11; } The `filters` field contains the identifiers of the filters that matched this update. Next Steps ---------- Explore specific subscription types: * [Subscribe to Accounts](https://www.alchemy.com/docs/reference/yellowstone-grpc-subscribe-accounts) - Real-time account updates * [Subscribe to Transactions](https://www.alchemy.com/docs/reference/yellowstone-grpc-subscribe-transactions) - Transaction streaming * [Subscribe to Slots](https://www.alchemy.com/docs/reference/yellowstone-grpc-subscribe-slots) - Slot progression tracking * [Subscribe to Blocks](https://www.alchemy.com/docs/reference/yellowstone-grpc-subscribe-blocks) - Full block data Was this page helpful? YesNo --- # Subscribe to Transactions | Alchemy Docs Copy page Subscribe to Transactions ========================= Subscribe to Transactions ========================= Transaction subscriptions allow you to monitor Solana transactions in real-time. This is crucial for DEX integrations, wallet monitoring, program event tracking, and transaction-based analytics. Overview -------- Transaction subscriptions provide real-time updates for transactions matching your filter criteria. You can filter by: * Transactions involving specific accounts * Transactions calling specific programs * Vote vs non-vote transactions * Failed vs successful transactions * Complex account inclusion/exclusion rules Filter Structure ---------------- message SubscribeRequestFilterTransactions { optional bool vote = 1; optional bool failed = 2; optional string signature = 3; repeated string account_include = 4; repeated string account_exclude = 5; repeated string account_required = 6; } Filter Options -------------- ### Vote Transactions Control whether to include vote transactions (validator voting). **Field**: `vote` **Type**: `optional bool` **Values**: * `true` - Only vote transactions * `false` - Only non-vote transactions * `null` (unset) - Both vote and non-vote transactions **Use Cases**: * Set to `false` for most application use cases (excludes validator voting spam) * Set to `true` only for validator monitoring or consensus analytics ### Failed Transactions Control whether to include failed transactions. **Field**: `failed` **Type**: `optional bool` **Values**: * `true` - Only failed transactions * `false` - Only successful transactions * `null` (unset) - Both successful and failed transactions **Use Cases**: * Set to `false` to monitor only successful transactions * Set to `true` to analyze failure patterns * Leave unset to see all transaction attempts ### Signature Filter Filter for a specific transaction signature. **Field**: `signature` **Type**: `optional string` **Use Cases**: * Track a specific transaction through confirmation stages * Monitor a transaction you just submitted * Verify transaction inclusion **Note**: This filter is rarely used in streaming contexts because you must know the transaction signature ahead of time. If you want to track the confirmation status of a transaction you are about to send (for example, a payment or program interaction), you can set up a subscription for the expected signature before submitting the transaction. This way, you will receive real-time updates as soon as the transaction is processed by the network. ### Account Include Receive transactions involving any of these accounts. **Field**: `account_include` **Type**: `repeated string` **Behavior**: Transaction matches if it involves **any** of the specified accounts. **Use Cases**: * Monitor a user's wallet for any activity * Track transactions for a set of token accounts * Watch multiple DEX programs ### Account Exclude Exclude transactions involving these accounts. **Field**: `account_exclude` **Type**: `repeated string` **Behavior**: Transaction is excluded if it involves **any** of these accounts. **Use Cases**: * Exclude noise from specific accounts * Filter out unwanted program interactions * Remove specific token account activity ### Account Required Require all of these accounts to be present. **Field**: `account_required` **Type**: `repeated string` **Behavior**: Transaction matches only if it involves **all** specified accounts. **Use Cases**: * Match specific program interactions (program + user account) * Find transactions involving multiple specific accounts * Narrow down to very specific transaction patterns Combining Account Filters ------------------------- Account filters work together: 1. Transaction must include at least one `account_include` (if specified) 2. Transaction must **not** include any `account_exclude` (if specified) 3. Transaction must include **all** `account_required` (if specified) **Example Logic**: if account_include is set: must match at least one if account_exclude is set: must match none if account_required is set: must match all Response Structure ------------------ Transaction updates arrive as `SubscribeUpdateTransaction` messages: message SubscribeUpdateTransaction { SubscribeUpdateTransactionInfo transaction = 1; uint64 slot = 2; } message SubscribeUpdateTransactionInfo { bytes signature = 1; bool is_vote = 2; solana.storage.ConfirmedBlock.Transaction transaction = 3; solana.storage.ConfirmedBlock.TransactionStatusMeta meta = 4; uint64 index = 5; } ### Key Fields **`signature`**: Transaction signature (unique identifier) **`is_vote`**: Whether this is a vote transaction **`meta`**: Transaction metadata including status, fees, logs, and account changes **`transaction`**: The full transaction data including instructions **`slot`**: Slot number where transaction was included **`index`**: Transaction index within the block Was this page helpful? YesNo --- # Subscribe to Blocks | Alchemy Docs Copy page Subscribe to Blocks =================== Subscribe to Blocks =================== Block subscriptions provide real-time access to complete Solana blocks, including all transactions, account updates, and metadata. This is ideal for indexers, analytics platforms, and applications that need comprehensive blockchain data. Overview -------- A block contains: * All transactions included in a slot * Block metadata (hash, parent, height, etc.) * Transaction ordering and execution results * Block rewards * Commitment status Block subscriptions give you the complete picture of what happened in each slot. Filter Structure ---------------- message SubscribeRequestFilterBlocks { repeated string account_include = 1; bool include_transactions = 2; bool include_accounts = 3; bool include_entries = 4; } Filter Options -------------- ### Account Include Filter blocks to only those containing transactions that involve specific accounts. **Field**: `account_include` **Type**: `repeated string` **Behavior**: * If empty/unset: Receive all blocks * If specified: Only receive blocks containing transactions involving at least one of these accounts **Use Cases**: * Index only blocks relevant to specific programs * Track blocks containing activity for watched accounts * Reduce data volume by filtering at the source ### Include Transactions Control whether full transaction data is included. **Field**: `include_transactions` **Type**: `bool` **Default**: `true` **When `true`**: * Full transaction details included in each block * Larger payload size * Complete transaction information available **When `false`**: * Only transaction signatures included * Smaller payload size * Useful when you only need block structure ### Include Accounts Control whether account update information is included. **Field**: `include_accounts` **Type**: `bool` **Default**: `false` **When `true`**: * Account state changes included * Shows which accounts were modified in each transaction * Larger payload size **When `false`**: * No account update information * Smaller payload size ### Include Entries Control whether entry data is included. **Field**: `include_entries` **Type**: `bool` **Default**: `false` **When `true`**: * Raw entry data included * Detailed block construction information * Largest payload size **When `false`**: * No entry data * Smaller payload size Response Structure ------------------ Block updates arrive as `SubscribeUpdateBlock` messages: message SubscribeUpdateBlock { uint64 slot = 1; string blockhash = 2; solana.storage.ConfirmedBlock.Rewards rewards = 3; solana.storage.ConfirmedBlock.UnixTimestamp block_time = 4; solana.storage.ConfirmedBlock.BlockHeight block_height = 5; uint64 parent_slot = 7; string parent_blockhash = 8; uint64 executed_transaction_count = 9; repeated SubscribeUpdateTransactionInfo transactions = 6; uint64 updated_account_count = 10; repeated SubscribeUpdateAccountInfo accounts = 11; uint64 entries_count = 12; repeated SubscribeUpdateEntry entries = 13; } ### Key Fields **`slot`**: The slot number for this block **`blockhash`**: Unique hash identifying this block **`rewards`**: Validator rewards for this block **`block_time`**: Unix timestamp when block was produced **`block_height`**: Block height in the ledger **`parent_slot`**: Previous slot number **`parent_blockhash`**: Hash of parent block **`executed_transaction_count`**: Number of transactions in this block **`transactions`**: Full transaction details (if `include_transactions=true`) **`updated_account_count`**: Number of accounts updated in this block **`accounts`**: Account update information (if `include_accounts=true`) **`entries_count`**: Number of entries in this block **`entries`**: Entry data (if `include_entries=true`) Block vs Block Meta ------------------- Choose between full blocks and block metadata: | Feature | Full Blocks | Block Meta | | --- | --- | --- | | **Size** | Large | Small | | **Transactions** | Full details | Count only | | **Use case** | Indexing, analytics | Monitoring, lightweight tracking | | **Bandwidth** | High | Low | Was this page helpful? YesNo --- # newHeads | Alchemy Docs Copy page newHeads ======== Emits new blocks that are added to the blockchain. The `newHeads` subscription type emits an event any time a new header (block) is added to the chain, including during a chain reorganization. When a chain reorganization occurs, this subscription will emit an event containing all new headers (blocks) for the new chain. This means that you may see multiple headers emitted with the same height (block number), and when this happens the later (highest) block number should be taken as the correct one after a reorganization. Supported Networks ================== Check the [Chains](https://dashboard.alchemy.com/chains?utm_source=docs&utm_medium=referral&utm_content=reference_newheads) page for details about product and chain support! ![](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764179964%2Fdocs%2Fapi-reference%2Falchemy-transact%2Ftransaction-simulation%2F523fb8a9a9d899921ee1046d0ff1b389967a9976d1c6112ebbbe071ddd1ef374-image.png&w=3840&q=75) Parameters ========== * None Response ======== * `result` * `number`: QUANTITY - The block number. Null when it's a pending block. * `parentHash`: DATA, 32 Bytes - Hash of the parent block. * `nonce`: DATA, 8 Bytes - Hash of the generated proof-of-work. Null when it's a pending block. * `sha3Uncles`: DATA, 32 Bytes - SHA3 of the uncles data in the block. * `logsBloom`: DATA, 256 Bytes - The bloom filter for the logs of the block. Null when it's a pending block. * `transactionsRoot`: DATA, 32 Bytes - The root of the transaction trie of the block. * `stateRoot`: DATA, 32 Bytes - The root of the final state trie of the block. * `receiptsRoot`: DATA, 32 Bytes - The root of the receipts trie of the block. * `miner`: DATA, 20 Bytes - The address of the beneficiary to whom the mining rewards were given. * `difficulty`: QUANTITY - Integer of the difficulty for this block. * `extraData`: DATA - The "extra data" field of this block. * `gasLimit`: QUANTITY - The maximum gas allowed in this block. * `gasUsed`: QUANTITY - The total used gas by all transactions in this block. * `timestamp`: QUANTITY - The Unix timestamp for when the block was collated. * `subscription`: `string` - Subscription ID Request ======= wscat Viem Ethers.js // initiate websocket stream first wscat -c wss://eth-mainnet.g.alchemy.com/v2/demo // then call subscription {"jsonrpc":"2.0","id": 1, "method": "eth_subscribe", "params": ["newHeads"]} Result ====== result {"jsonrpc":"2.0", "id":1, "result":"0x9ce59a13059e417087c02d3236a0b1cc"} { "jsonrpc": "2.0", "method": "eth_subscription", "params": { "result": { "difficulty": "0x15d9223a23aa", "extraData": "0xd983010305844765746887676f312e342e328777696e646f7773", "gasLimit": "0x47e7c4", "gasUsed": "0x38658", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": "0xf8b483dba2c3b7176a3da549ad41a48bb3121069", "nonce": "0x084149998194cc5f", "number": "0x1348c9", "parentHash": "0x7736fab79e05dc611604d22470dadad26f56fe494421b5b333de816ce1f25701", "receiptRoot": "0x2fab35823ad00c7bb388595cb46652fe7886e00660a01e867824d3dceb1c8d36", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "stateRoot": "0xb3346685172db67de536d8765c43c31009d0eb3bd9c501c9be3229203f15f378", "timestamp": "0x56ffeff8", "transactionsRoot": "0x0167ffa60e3ebc0b080cdb95f7c0087dd6c0e61413140e39d94d3468d7c9689f" }, "subscription": "0x9ce59a13059e417087c02d3236a0b1cc" } } Was this page helpful? YesNo --- # monadNewHeads | Alchemy Docs Copy page monadNewHeads ============= Fires a notification each time as soon as a block is Proposed and the node has a chance to speculatively execute. The `monadNewHeads` is the same as the [`newHeads`](https://www.alchemy.com/docs/reference/newheads) subscription type, but the notification emits as soon as the block is `Proposed` and the node has a chance to [speculatively execute](https://docs.monad.xyz/monad-arch/realtime-data/spec-realtime) . Supported Networks ================== Check the [Chains](https://dashboard.alchemy.com/chains?utm_source=docs&utm_medium=referral&utm_content=reference_monadnewheads) page for details about product and chain support! ![](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764179964%2Fdocs%2Fapi-reference%2Falchemy-transact%2Ftransaction-simulation%2F523fb8a9a9d899921ee1046d0ff1b389967a9976d1c6112ebbbe071ddd1ef374-image.png&w=3840&q=75) Parameters ========== * None Response ======== A `monadNewHeads` update looks the same as a `newHeads` update except that it contains the additional `blockId` and `commitState` fields: * `result` * `blockId`: DATA, 32 Bytes - The unique identifier of the block. Example: "0x71ce47f39a1eb490354166f762d78bf6e2acaf80b24b4bcd756118d93ef81be0" * `commitState`: string - The current state of the block. Example: "Proposed" * `number`: QUANTITY - The block number. Null when it's a pending block. * `parentHash`: DATA, 32 Bytes - Hash of the parent block. * `nonce`: DATA, 8 Bytes - Hash of the generated proof-of-work. Null when it's a pending block. * `sha3Uncles`: DATA, 32 Bytes - SHA3 of the uncles data in the block. * `logsBloom`: DATA, 256 Bytes - The bloom filter for the logs of the block. Null when it's a pending block. * `transactionsRoot`: DATA, 32 Bytes - The root of the transaction trie of the block. * `stateRoot`: DATA, 32 Bytes - The root of the final state trie of the block. * `receiptsRoot`: DATA, 32 Bytes - The root of the receipts trie of the block. * `miner`: DATA, 20 Bytes - The address of the beneficiary to whom the mining rewards were given. * `difficulty`: QUANTITY - Integer of the difficulty for this block. * `extraData`: DATA - The "extra data" field of this block. * `gasLimit`: QUANTITY - The maximum gas allowed in this block. * `gasUsed`: QUANTITY - The total used gas by all transactions in this block. * `timestamp`: QUANTITY - The Unix timestamp for when the block was collated. * `subscription`: `string` - Subscription ID Request ======= wscat Viem Ethers.js // initiate websocket stream first wscat -c wss://eth-mainnet.g.alchemy.com/v2/demo // then call subscription {"jsonrpc":"2.0","id": 1, "method": "eth_subscribe", "params": ["monadNewHeads"]} Result ====== result {"jsonrpc":"2.0", "id":1, "result":"0x9ce59a13059e417087c02d3236a0b1cc"} { "jsonrpc": "2.0", "method": "eth_subscription", "params": { "result": { "difficulty": "0x15d9223a23aa", "extraData": "0xd983010305844765746887676f312e342e328777696e646f7773", "gasLimit": "0x47e7c4", "gasUsed": "0x38658", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": "0xf8b483dba2c3b7176a3da549ad41a48bb3121069", "nonce": "0x084149998194cc5f", "number": "0x1348c9", "parentHash": "0x7736fab79e05dc611604d22470dadad26f56fe494421b5b333de816ce1f25701", "receiptRoot": "0x2fab35823ad00c7bb388595cb46652fe7886e00660a01e867824d3dceb1c8d36", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "stateRoot": "0xb3346685172db67de536d8765c43c31009d0eb3bd9c501c9be3229203f15f378", "timestamp": "0x56ffeff8", "transactionsRoot": "0x0167ffa60e3ebc0b080cdb95f7c0087dd6c0e61413140e39d94d3468d7c9689f" }, "subscription": "0x9ce59a13059e417087c02d3236a0b1cc" } } Was this page helpful? YesNo --- # What is trace_filter? | Alchemy Docs Copy page What is trace\_filter? ====================== Learn what the trace\_filter method is, how to use it on EVM blockchains, and test an example use case. Prerequisites ============= Before reading this article you should have a clear understanding of [EVM Traces](https://www.alchemy.com/docs/reference/what-are-evm-traces) . What is `trace_filter`? ======================= `trace_filter` is an RPC method exposed by the Openethereum and Erigon [Ethereum clients](https://www.alchemy.com/overviews/execution-layer-and-consensus-layer-node-clients) . It allows you to get the traces of multiple transactions in a single request based on the filters provided by you. You can specify the `from` and `to` block numbers, and the `from` and `to` addresses. This is useful for debugging purposes or for monitoring specific addresses. **Parameters** -------------- 1. `Object` - The filter object * `fromBlock`: `Quantity` or `Tag` - (optional) From this block. * `toBlock`: `Quantity` or `Tag` - (optional) To this block. * `fromAddress`: `Array` - (optional) Sent from these addresses. * `toAddress`: `Array` - (optional) Sent to these addresses. * `after`: `Quantity` - (optional) The offset trace number. * `count`: `Quantity` - (optional) Integer number of traces to return. Response -------- * `array` - Traces of transactions based on the given filters. How to use trace\_filter ======================== To use the [trace\_filter](https://www.alchemy.com/docs/reference/trace-filter) method you need to be in pay as you go or enterprise tier. [Sign up for Alchemy](https://dashboard.alchemy.com/signup?utm_source=docs&utm_medium=referral&utm_content=reference_what-is-trace_filter) or [upgrade your account](https://dashboard.alchemy.com/settings/billing?utm_source=docs&utm_medium=referral&utm_content=reference_what-is-trace_filter) . You can call the `trace_filter` method by passing a filter object as a parameter to it. An example request and response are given below: Request ------- This request will return traces of all the transactions sent by [0xEdC763b3e418cD14767b3Be02b667619a6374076](https://etherscan.io/txs?a=0xEdC763b3e418cD14767b3Be02b667619a6374076&f=2) address after the block number `0xccb942` (13416770). cURL postman ethers web3py curl https://eth-mainnet.g.alchemy.com/v2/your-api-key/ \ -X POST \ -H "Content-Type: application/json" \ --data '{"method":"trace_filter","params":[{"fromBlock":"0xccb942","toBlock":"latest","fromAddress":["0xEdC763b3e418cD14767b3Be02b667619a6374076"]}],"id":1,"jsonrpc":"2.0"}' Response -------- response [\ {\ "action": {\ "from": "0xedc763b3e418cd14767b3be02b667619a6374076",\ "callType": "call",\ "gas": "0x8462",\ "input": "0x095ea7b30000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",\ "to": "0x7ff4169a6b5122b664c51c95727d87750ec07c84",\ "value": "0x0"\ },\ "blockHash": "0x351e7c06ec010c8f7e7358eb580238dd23e1e129be96822aa93ebb6da08558e6",\ "blockNumber": 13416771,\ "result": {\ "gasUsed": "0x6009",\ "output": "0x0000000000000000000000000000000000000000000000000000000000000001"\ },\ "subtraces": 0,\ "traceAddress": [],\ "transactionHash": "0x054bbb9fbb855bf23f755e548c7409f45fc5eff8a824b2ad06380bc038d7b049",\ "transactionPosition": 54,\ "type": "call"\ },\ {\ "action": {\ "from": "0xedc763b3e418cd14767b3be02b667619a6374076",\ "callType": "call",\ "gas": "0x7063a",\ "input": "0x2440fdc2000000000000000000000000edc763b3e418cd14767b3be02b667619a6374076000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000003753ab94a123aa7960",\ "to": "0xd2f6b9225ed446c1b445ac0656c8ccc97d096fb8",\ "value": "0x0"\ },\ "blockHash": "0xa6c8748136b5d22aabff34f71357f85911eddc5e772258f48d7d14fe30d2f87f",\ "blockNumber": 13556916,\ "result": {\ "gasUsed": "0x4926c",\ "output": "0x00000000000000000000000000000000000000000000000000000000000009f7"\ },\ "subtraces": 1,\ "traceAddress": [],\ "transactionHash": "0x1ff276fd4bbf32623b83653eb07352f76c5adf258d42190693d46669168b227a",\ "transactionPosition": 237,\ "type": "call"\ },\ {\ "action": {\ "from": "0xedc763b3e418cd14767b3be02b667619a6374076",\ "callType": "call",\ "gas": "0x0",\ "input": "0x",\ "to": "0xdbb2126e69d73203024002f427758557d2994c5e",\ "value": "0x611e091b07f64f"\ },\ "blockHash": "0x47b76a1db0bc39efc5f3fe9b2fe7975c4fbaa7de7f767a2cd4c345eac18a1e99",\ "blockNumber": 15561356,\ "result": {\ "gasUsed": "0x0",\ "output": "0x"\ },\ "subtraces": 0,\ "traceAddress": [],\ "transactionHash": "0x1c668319a54e2fc73241ae6f930deb824a34e48738e79cd8f5391e3c9ce0154f",\ "transactionPosition": 98,\ "type": "call"\ }\ ] As you can see that only three transactions are sent by this address after the block number `13416770`, that's why only three traces are returned in the response which are traces of these three transactions. ![6144](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764192961%2Fdocs%2Fapi-reference%2Ftrace-api%2Ftrace-api-resources%2F3985069-transactions-sent.png&w=3840&q=75 "transactions-sent.png") Use Cases ========= The `trace_filter` method is useful for filtering traces based on certain criteria. You can use it to find traces that involve a particular address or to find traces that involve a particular contract. An example is given above in the ["How to use trace\_filter"](https://www.alchemy.com/docs/reference/what-is-trace_filter#how-to-use-trace_filter) section where we filter the traces of all the transactions sent by an address after a particular block number. Conclusion ========== In conclusion, the `trace_filter` method is a valuable tool that can be used for monitoring the on-chain activity of addresses. Was this page helpful? YesNo --- # What is trace_transaction? | Alchemy Docs Copy page What is trace\_transaction? =========================== Learn what the trace\_transaction method is, how to use it on EVM blockchains, and test an example use case. Prerequisites ============= Before reading this article you should have a clear understanding of [EVM Traces](https://www.alchemy.com/docs/reference/what-are-evm-traces) . What is `trace_transaction`? ============================ `trace_transaction` is an RPC method exposed by the Openethereum and Erigon [Ethereum clients](https://www.alchemy.com/overviews/execution-layer-and-consensus-layer-node-clients) . You can get the EVM traces of a previously executed transaction using this method. This can be useful for debugging purposes, or for understanding how a transaction works. Parameters ---------- This method only takes one parameter which is the transaction hash of the transaction whose traces you wish to get: 1. `Hash` - Transaction hash params params: ["0x17104ac9d3312d8c136b7f44d4b8b47852618065ebfa534bd2d3b5ef218ca1f3"] Response -------- This method returns the traces of the given transaction as a response: * `array` - Traces of the given transaction How to use trace\_transaction ============================= To use the [trace\_transaction](https://www.alchemy.com/docs/reference/trace-transaction) method you need to be in pay as you go or enterprise tier. [Sign up for Alchemy](https://dashboard.alchemy.com/signup?utm_source=docs&utm_medium=referral&utm_content=reference_what-is-trace_transaction) or [upgrade your account](https://dashboard.alchemy.com/settings/billing?utm_source=docs&utm_medium=referral&utm_content=reference_what-is-trace_transaction) . You can call the [trace\_transaction](https://www.alchemy.com/docs/reference/trace-transaction) method by providing the transaction hash of the transaction you wish to trace. You can find this by looking up the transaction on a block explorer. Once you have the transaction hash, you can call the "trace\_transaction" method with it as follows: Request ------- cURL postman ethers.js web3py curl https://eth-mainnet.g.alchemy.com/v2/your-api-key \ -X POST \ -H "Content-Type: application/json" \ -d '{"method":"trace_transaction","params":["0x17104ac9d3312d8c136b7f44d4b8b47852618065ebfa534bd2d3b5ef218ca1f3"],"id":1,"jsonrpc":"2.0"}' Response -------- response { "jsonrpc": "2.0", "result": [\ {\ "action": {\ "callType": "call",\ "from": "0x83806d539d4ea1c140489a06660319c9a303f874",\ "gas": "0x1a1f8",\ "input": "0x",\ "to": "0x1c39ba39e4735cb65978d4db400ddd70a72dc750",\ "value": "0x7a16c911b4d00000"\ },\ "blockHash": "0x7eb25504e4c202cf3d62fd585d3e238f592c780cca82dacb2ed3cb5b38883add",\ "blockNumber": 3068185,\ "result": {\ "gasUsed": "0x2982",\ "output": "0x"\ },\ "subtraces": 2,\ "traceAddress": [],\ "transactionHash": "0x17104ac9d3312d8c136b7f44d4b8b47852618065ebfa534bd2d3b5ef218ca1f3",\ "transactionPosition": 2,\ "type": "call"\ },\ {\ "action": {\ "callType": "call",\ "from": "0x1c39ba39e4735cb65978d4db400ddd70a72dc750",\ "gas": "0x13e99",\ "input": "0x16c72721",\ "to": "0x2bd2326c993dfaef84f696526064ff22eba5b362",\ "value": "0x0"\ },\ "blockHash": "0x7eb25504e4c202cf3d62fd585d3e238f592c780cca82dacb2ed3cb5b38883add",\ "blockNumber": 3068185,\ "result": {\ "gasUsed": "0x183",\ "output": "0x0000000000000000000000000000000000000000000000000000000000000001"\ },\ "subtraces": 0,\ "traceAddress": [\ 0\ ],\ "transactionHash": "0x17104ac9d3312d8c136b7f44d4b8b47852618065ebfa534bd2d3b5ef218ca1f3",\ "transactionPosition": 2,\ "type": "call"\ },\ {\ "action": {\ "callType": "call",\ "from": "0x1c39ba39e4735cb65978d4db400ddd70a72dc750",\ "gas": "0x8fc",\ "input": "0x",\ "to": "0x70faa28a6b8d6829a4b1e649d26ec9a2a39ba413",\ "value": "0x7a16c911b4d00000"\ },\ "blockHash": "0x7eb25504e4c202cf3d62fd585d3e238f592c780cca82dacb2ed3cb5b38883add",\ "blockNumber": 3068185,\ "result": {\ "gasUsed": "0x0",\ "output": "0x"\ },\ "subtraces": 0,\ "traceAddress": [\ 1\ ],\ "transactionHash": "0x17104ac9d3312d8c136b7f44d4b8b47852618065ebfa534bd2d3b5ef218ca1f3",\ "transactionPosition": 2,\ "type": "call"\ }\ ], "id": 0 } Here is the [link](https://etherscan.io/tx/0x17104ac9d3312d8c136b7f44d4b8b47852618065ebfa534bd2d3b5ef218ca1f3) to the transaction on Etherscan whose EVM trace is given above in the Response. Use Cases ========= ### **Understanding/Debugging a transaction** You can get the whole trace tree for a transaction and analyze what exactly happened during the transaction execution. The trace tree also returns the gas used for each action, the output values, and the revert reason (if the transaction failed). For example, in the trace image below you can see that the transaction failed due to an "Out of gas" exception, which means that there was not enough gas to complete the transaction. ![2000](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764192960%2Fdocs%2Fapi-reference%2Ftrace-api%2Ftrace-api-resources%2F1d84a56-gas-error.png&w=3840&q=75 "gas-error.png") Here is the [link](https://etherscan.io/tx/0xda8c0b80d8e240a83c8f6b067c4656babeb13e8e0ece4fd4292aa06252f1285c) to the above-defined transaction on Etherscan. ### **Transaction Tracers** As you can get the traces for a previously executed transaction using `trace_call`. Transaction tracers help us better understand the flow of a transaction. They extract the EVM traces for a transaction and display them in a way that’s readable by us. ![1998](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764192960%2Fdocs%2Fapi-reference%2Ftrace-api%2Ftrace-api-resources%2F3571567-txs-fyi.png&w=3840&q=75 "txs-fyi.png") As you can see it’s clear from the execution trace that the caller called the transfer function of the TetherToken contract and the contract transferred 285 USDT from the caller to the target address. ### **Contract Performance Analysis** Transaction traces can be used to analyze the performance of smart contracts by looking at the number of actions it takes for each transaction to be processed. This information can be used to identify bottlenecks and optimize the contract for better performance. Conclusion ========== In conclusion, the `trace_transaction` method is a valuable tool for debugging transactions. It provides a step-by-step record of the execution of a transaction and can be used to identify errors and optimize code. Was this page helpful? YesNo --- # trace_replayTransaction | Alchemy Docs Copy page trace\_replayTransaction ======================== POST https://eth-mainnet.g.alchemy.com/v2/{apiKey} Traces a call to eth\_sendRawTransaction without executing it, returning the traces. Path Parameters --------------- `apiKey`stringrequireddefaults to `docs-demo` For higher throughput, [create your own API key](https://dashboard.alchemy.com/signup?utm_source=docs&utm_medium=referral&utm_content=node_trace-api_trace-api-endpoints_trace-replay-transaction) Request ------- `transactionHash`string`format: "^0[xX][0-9A-Fa-f]{64}$"`required Transaction hash of the raw transaction to be replayed. `traceTypes`enum\[\]requireddefaults to `trace` Array of trace types to return. Valid values include "trace" and "stateDiff". Defaults to `["trace"]`. Responses --------- ### 200 Returns the trace result from replaying the transaction. Show 4 properties Was this page helpful? YesNo --- # trace_rawTransaction | Alchemy Docs Copy page trace\_rawTransaction ===================== POST https://eth-mainnet.g.alchemy.com/v2/{apiKey} Traces a call to eth\_sendRawTransaction without executing it, returning the traces. Path Parameters --------------- `apiKey`stringrequireddefaults to `docs-demo` For higher throughput, [create your own API key](https://dashboard.alchemy.com/signup?utm_source=docs&utm_medium=referral&utm_content=node_trace-api_trace-api-endpoints_trace-raw-transaction) Request ------- `rawTransaction`string`format: "^0x[0-9a-fA-F]*$"`required Raw transaction data. `traceTypes`enum\[\]requireddefaults to `trace` Array of trace types to return. Valid values include "trace" and "stateDiff". Defaults to `["trace"]`. Responses --------- ### 200 Returns the traces from the raw transaction call. Show 4 properties Was this page helpful? YesNo --- # trace_filter | Alchemy Docs Copy page trace\_filter ============= POST https://eth-mainnet.g.alchemy.com/v2/{apiKey} Returns traces matching a given filter. Path Parameters --------------- `apiKey`stringrequireddefaults to `docs-demo` For higher throughput, [create your own API key](https://dashboard.alchemy.com/signup?utm_source=docs&utm_medium=referral&utm_content=node_trace-api_trace-api-endpoints_trace-filter) Request ------- `filter`objectrequired Filter object for retrieving traces. Show 6 properties Responses --------- ### 200 Returns an array of traces that match the filter. Show 4 properties Was this page helpful? YesNo --- # trace_replayBlockTransactions | Alchemy Docs Copy page trace\_replayBlockTransactions ============================== POST https://eth-mainnet.g.alchemy.com/v2/{apiKey} Path Parameters --------------- `apiKey`stringrequireddefaults to `docs-demo` For higher throughput, [create your own API key](https://dashboard.alchemy.com/signup?utm_source=docs&utm_medium=referral&utm_content=node_trace-api_trace-api-endpoints_trace-replay-block-transactions) Request ------- `blockIdentifier`stringrequireddefaults to `finalized` Block identifier as a string. This can be a block hash, a block number (in hex), or a block tag (such as "latest", "finalized", etc.). `traceTypes`enum\[\]requireddefaults to `trace` Array of trace types to return. Valid values include "trace" and "stateDiff". Defaults to `["trace"]`. Responses --------- ### 200 Returns an array of trace objects for each transaction in the block. Show 9 properties Was this page helpful? YesNo --- # trace_transaction | Alchemy Docs Copy page trace\_transaction ================== POST https://eth-mainnet.g.alchemy.com/v2/{apiKey} Returns all traces of a given transaction. Path Parameters --------------- `apiKey`stringrequireddefaults to `docs-demo` For higher throughput, [create your own API key](https://dashboard.alchemy.com/signup?utm_source=docs&utm_medium=referral&utm_content=node_trace-api_trace-api-endpoints_trace-transaction) Request ------- `transactionHash`string`format: "^0[xX][0-9A-Fa-f]{64}$"`required 32 Bytes - Hash of a transaction. Responses --------- ### 200 Returns an array of trace objects for the given transaction. Show 9 properties Was this page helpful? YesNo --- # logs | Alchemy Docs Copy page logs ==== Emits logs attached to a new block that match certain topic filters. The `logs` subscription type emits logs that match a specified topic filter and are included in newly added blocks. To learn more about logs on Ethereum and other EVM chains, check out [Understanding Logs: Deep Dive into eth\_getLogs](https://www.alchemy.com/docs/deep-dive-into-eth_getlogs) . When a chain reorganization occurs, logs that are part of blocks on the old chain will be emitted again with the property removed set to `true`. Logs that are part of the blocks on the new chain are also emitted so it is possible to see logs for the same transaction multiple times in the case of a reorganization. If `removed` is not included in the response payload then the logs are still a part of the canonical chain. Supported Networks ================== Check the [Chains](https://dashboard.alchemy.com/chains?utm_source=docs&utm_medium=referral&utm_content=reference_logs) page for details about product and chain support! ![](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764179964%2Fdocs%2Fapi-reference%2Falchemy-transact%2Ftransaction-simulation%2F523fb8a9a9d899921ee1046d0ff1b389967a9976d1c6112ebbbe071ddd1ef374-image.png&w=3840&q=75) Parameters ========== An object with the following fields: * `address` (optional): `string`\] or `[array of strings]` Singular address or array of addresses. Only logs created from one of these addresses will be emitted. * `topics`: an array of topic specifiers (**up to 4 topics allowed per address**). * Each topic specifier is either `null`, a single string, or an array of strings. * For every non `null` topic, a log will be emitted when activity associated with that topic occurs. Request ======= javascript Viem Ethers.js // initiate websocket stream first wscat -c wss://eth-mainnet.g.alchemy.com/v2/demo // then call subscription {"jsonrpc":"2.0","id": 1, "method": "eth_subscribe", "params": ["logs", {"address": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", "topics": ["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"]}]} Result ====== result { "jsonrpc":"2.0", "method":"eth_subscription", "params": { "subscription":"0x4a8a4c0517381924f9838102c5a4dcb7", "result":{ "address":"0x8320fe7702b96808f7bbc0d4a888ed1468216cfd", "blockHash":"0x61cdb2a09ab99abf791d474f20c2ea89bf8de2923a2d42bb49944c8c993cbf04", "blockNumber":"0x29e87", "data":"0x00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000003", "logIndex":"0x0", "topics":["0xd78a0cb8bb633d06981248b816e7bd33c2a35a6089241d099fa519e361cab902"], "transactionHash":"0xe044554a0a55067caafd07f8020ab9f2af60bdfe337e395ecd84b4877a3d1ab4", "transactionIndex":"0x0" } } } Below you can find the explanation for individual properties of the response: * **`jsonrpc`**: The `jsonrpc` property specifies the version of the JSON-RPC protocol that is being used, which in this case is "2.0". * **`method`**: The `method` property specifies the method that was called, which in this case is `eth_subscription`. * **`params`**: The `params` property contains the parameters of the method call. In this case, it contains a `subscription` property, which specifies the subscription identifier, and a `result` property, which contains the result of the subscription. * **`result`**: The `result` property contains information about a specific transaction on the Ethereum blockchain. * **`address`**: The `address` property specifies the address from which this log originated. * **`blockhash`**: The `blockHash` property specifies the hash of the block in which the transaction was included. * **`blockNumber`**: The `blockNumber` property specifies the number of the block in which the transaction was included. It is encoded as a hexadecimal string. * **`data`**: Contains one or more 32 Bytes non-indexed arguments of the log. * **`logIndex`**: The `logIndex` property specifies the index or position of the log entry within the block. It is encoded as a hexadecimal string. * **`topics`**: An array of 0 to 4 32 bytes topic hashes of indexed log arguments (up to 4 topics allowed per address). * **`transactionHash`**: The `transactionHash` property specifies the hash of the transaction. * **`transactionIndex`**: The `transactionIndex` property specifies the index or position of the transaction within the block. It is encoded as a hexadecimal string. Was this page helpful? YesNo --- # debug_traceBlockByNumber | Alchemy Docs Copy page debug\_traceBlockByNumber ========================= POST https://eth-mainnet.g.alchemy.com/v2/{apiKey} Replays the block that is already present in the database. Path Parameters --------------- `apiKey`stringrequireddefaults to `docs-demo` For higher throughput, [create your own API key](https://dashboard.alchemy.com/signup?utm_source=docs&utm_medium=referral&utm_content=node_debug-api_debug-api-endpoints_debug-trace-block-by-number) Request ------- `Block number`string or enumrequired The block number or tag (e.g., "latest", "earliest"). Show 2 variants `Tracer`objectoptional Tracer object for the call. Show 2 properties Responses --------- ### 200 Array of block traces. Array of block traces. Show 11 properties Was this page helpful? YesNo --- # What is trace_block? | Alchemy Docs Copy page What is trace\_block? ===================== Learn what the trace\_block method is, how to use it on EVM blockchains, and test an example use case. Prerequisites ============= Before reading this article you should have a clear understanding of [EVM Traces](https://www.alchemy.com/docs/reference/what-are-evm-traces) . What is `trace_block`? ====================== `trace_block` is an RPC method exposed by the Openethereum and Erigon [Ethereum clients](https://www.alchemy.com/overviews/execution-layer-and-consensus-layer-node-clients) . It can be used to get a trace of all the transactions in a given block. This can be useful for debugging purposes or for analyzing the behavior of a blockchain. Parameters ---------- 1. `Quantity` or `Tag` - Integer formatted as a hex string that represents the block number, or the string `earliest`, `latest`, or `pending`. * `earliest`: The lowest numbered block the client has available. Intuitively, you can think of this as the first block created. * `latest`: The most recent block in the canonical chain observed by the client, this block may be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: A sample next block built by the client on top of the latest and containing the set of transactions usually taken from the local mempool. Intuitively, you can think of these as blocks that have not been mined yet. params params: ['0xccb93d'] Response -------- * `array` - An array of block traces. It includes the traces for every transaction in the given block. How to Use trace\_block ======================= To use the [trace\_block](https://www.alchemy.com/docs/reference/trace-block) method you need to be in pay as you go or enterprise tier. [Sign up for Alchemy](https://dashboard.alchemy.com/signup?utm_source=docs&utm_medium=referral&utm_content=reference_what-is-trace_block) or [upgrade your account](https://dashboard.alchemy.com/settings/billing?utm_source=docs&utm_medium=referral&utm_content=reference_what-is-trace_block) . You can call the [trace\_block](https://www.alchemy.com/docs/reference/trace-block) method, by providing an integer formatted as a hex string that represents the block number for which you wish to make the request. Once you have the block number (formatted as a hex string), you can call the "trace\_block" method with it as follows: Request ------- cURL postman ethers.js web3py curl https://eth-mainnet.g.alchemy.com/v2/your-api-key \ -X POST \ -H "Content-Type: application/json" \ -d '{"method":"trace_block","params":["0xccb93d"],"id":1,"jsonrpc":"2.0"}' Response -------- response { "id": 1, "jsonrpc": "2.0", "result": [\ {\ "action":{\ "from":"0xe860d18528def30f6351308e71629e37fdbea70c"\ "gas":"0x1e544e"\ "init":"0x60806040523480156200001157600080fd5b50604051620026e8380380620026e8833981810160405260408110156200003757600080fd5b508051602090910151600080546001600160a01b031916331790558162000067816001600160e01b036200008416565b506200007c816001600160e01b03620000f316565b505062000175565b60028054604080518082018252600161ffff80851691909101168082526001600160a01b0395909516602091820181905261ffff19909316851762010000600160b01b0319166201000084021790935560009384526004909252912080546001600160a01b0319169091179055565b6000546001600160a01b0316331462000153576040805162461bcd60e51b815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e657200000000000000000000604482015290519081900360640190fd5b600580546001600160a01b0319166001600160a01b0392909216919091179055565b61256380620001856000396000f3fe608060405234801561001057600080fd5b506004361061018d5760003560e01c80638f6b4d91116100e3578063bc43cbaf1161008c578063f2fde38b11610066578063f2fde38b1461042b578063f8a2abd31461045e578063feaf968c146104915761018d565b8063bc43cbaf146103fa578063c159730414610402578063e8c4be30146104235761018d565b8063a928c096116100bd578063a928c0961461038d578063b5ab58dc146103c0578063b633620c146103dd5761018d565b80638f6b4d911461032957806392eefe9b146103315780639a6fc8f5146103645761018d565b80636001ac531161014557806379ba50971161011f57806379ba50971461030f5780638205bf6a146103195780638da5cb5b146103215761018d565b80636001ac5314610222578063668a0f021461028a5780637284e416146102925761018d565b806350d25bcd1161017657806350d25bcd146101e157806354fd4d50146101fb57806358303b10146102035761018d565b8063245a7bfc14610192578063313ce567146101c3575b600080fd5b61019a610499565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b6101cb6104bb565b6040805160ff9092168252519081900360200190f35b6101e9610559565b60408051918252519081900360200190f35b6101e96106e0565b61020b61074d565b6040805161ffff9092168252519081900360200190f35b61024b6004803603602081101561023857600080fd5b503569ffffffffffffffffffff16610757565b6040805169ffffffffffffffffffff96871681526020810195909552848101939093526060840191909152909216608082015290519081900360a00190f35b6101e9610978565b61029a610af9565b6040805160208082528351818301528351919283929083019185019080838360005b838110156102d45781810151838201526020016102bc565b50505050905090810190601f1680156103015780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610317610c76565b005b6101e9610d78565b61019a610ef9565b61024b610f15565b6103176004803603602081101561034757600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611134565b61024b6004803603602081101561037a57600080fd5b503569ffffffffffffffffffff16611201565b610317600480360360208110156103a357600080fd5b503573ffffffffffffffffffffffffffffffffffffffff1661138b565b6101e9600480360360208110156103d657600080fd5b50356114ce565b6101e9600480360360208110156103f357600080fd5b5035611657565b61019a6117d9565b61019a6004803603602081101561041857600080fd5b503561ffff166117f5565b61019a61181d565b6103176004803603602081101561044157600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611839565b6103176004803603602081101561047457600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611935565b61024b611a02565b60025462010000900473ffffffffffffffffffffffffffffffffffffffff1690565b6000600260000160029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b15801561052857600080fd5b505afa15801561053c573d6000803e3d6000fd5b505050506040513d602081101561055257600080fd5b5051905090565b60055460009073ffffffffffffffffffffffffffffffffffffffff168015806106675750604080517f6b14daf8000000000000000000000000000000000000000000000000000000008152336004820181815260248301938452366044840181905273ffffffffffffffffffffffffffffffffffffffff861694636b14daf8946000939190606401848480828437600083820152604051601f9091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016909201965060209550909350505081840390508186803b15801561063a57600080fd5b505afa15801561064e573d6000803e3d6000fd5b505050506040513d602081101561066457600080fd5b50515b6106d257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4e6f206163636573730000000000000000000000000000000000000000000000604482015290519081900360640190fd5b6106da611b8b565b91505090565b6000600260000160029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166354fd4d506040518163ffffffff1660e01b815260040160206040518083038186803b15801561052857600080fd5b60025461ffff1690565b600554600090819081908190819073ffffffffffffffffffffffffffffffffffffffff1680158061086d5750604080517f6b14daf8000000000000000000000000000000000000000000000000000000008152336004820181815260248301938452366044840181905273ffffffffffffffffffffffffffffffffffffffff861694636b14daf8946000939190606401848480828437600083820152604051601f9091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016909201965060209550909350505081840390508186803b15801561084057600080fd5b505afa158015610854573d6000803e3d6000fd5b505050506040513d602081101561086a57600080fd5b50515b6108d857604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4e6f206163636573730000000000000000000000000000000000000000000000604482015290519081900360640190fd5b60035473ffffffffffffffffffffffffffffffffffffffff1661095c57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f4e6f2070726f706f7365642061676772656761746f722070726573656e740000604482015290519081900360640190fd5b61096587611bf8565b939b929a50909850965090945092505050565b60055460009073ffffffffffffffffffffffffffffffffffffffff16801580610a865750604080517f6b14daf8000000000000000000000000000000000000000000000000000000008152336004820181815260248301938452366044840181905273ffffffffffffffffffffffffffffffffffffffff861694636b14daf8946000939190606401848480828437600083820152604051601f9091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016909201965060209550909350505081840390508186803b158015610a5957600080fd5b505afa158015610a6d573d6000803e3d6000fd5b505050506040513d6020811015610a8357600080fd5b50515b610af157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4e6f206163636573730000000000000000000000000000000000000000000000604482015290519081900360640190fd5b6106da611d57565b6060600260000160029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16637284e4166040518163ffffffff1660e01b815260040160006040518083038186803b158015610b6657600080fd5b505afa158015610b7a573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526020811015610bc157600080fd5b8101908080516040519392919084640100000000821115610be157600080fd5b908301906020820185811115610bf657600080fd5b8251640100000000811182820188101715610c1057600080fd5b82525081516020918201929091019080838360005b83811015610c3d578181015183820152602001610c25565b50505050905090810190601f168015610c6a5780820380516001836020036101000a031916815260200191505b50604052505050905090565b60015473ffffffffffffffffffffffffffffffffffffffff163314610cfc57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e657200000000000000000000604482015290519081900360640190fd5b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b60055460009073ffffffffffffffffffffffffffffffffffffffff16801580610e865750604080517f6b14daf8000000000000000000000000000000000000000000000000000000008152336004820181815260248301938452366044840181905273ffffffffffffffffffffffffffffffffffffffff861694636b14daf8946000939190606401848480828437600083820152604051601f9091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016909201965060209550909350505081840390508186803b158015610e5957600080fd5b505afa158015610e6d573d6000803e3d6000fd5b505050506040513d6020811015610e8357600080fd5b50515b610ef157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4e6f206163636573730000000000000000000000000000000000000000000000604482015290519081900360640190fd5b6106da611e2e565b60005473ffffffffffffffffffffffffffffffffffffffff1681565b600554600090819081908190819073ffffffffffffffffffffffffffffffffffffffff1680158061102b5750604080517f6b14daf8000000000000000000000000000000000000000000000000000000008152336004820181815260248301938452366044840181905273ffffffffffffffffffffffffffffffffffffffff861694636b14daf8946000939190606401848480828437600083820152604051601f9091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016909201965060209550909350505081840390508186803b158015610ffe57600080fd5b505afa158015611012573d6000803e3d6000fd5b505050506040513d602081101561102857600080fd5b50515b61109657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4e6f206163636573730000000000000000000000000000000000000000000000604482015290519081900360640190fd5b60035473ffffffffffffffffffffffffffffffffffffffff1661111a57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f4e6f2070726f706f7365642061676772656761746f722070726573656e740000604482015290519081900360640190fd5b611122611e9b565b95509550955095509550509091929394565b60005473ffffffffffffffffffffffffffffffffffffffff1633146111ba57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e657200000000000000000000604482015290519081900360640190fd5b600580547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b600554600090819081908190819073ffffffffffffffffffffffffffffffffffffffff168015806113175750604080517f6b14daf8000000000000000000000000000000000000000000000000000000008152336004820181815260248301938452366044840181905273ffffffffffffffffffffffffffffffffffffffff861694636b14daf8946000939190606401848480828437600083820152604051601f9091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016909201965060209550909350505081840390508186803b1580156112ea57600080fd5b505afa1580156112fe573d6000803e3d6000fd5b505050506040513d602081101561131457600080fd5b50515b61138257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4e6f206163636573730000000000000000000000000000000000000000000000604482015290519081900360640190fd5b61096587611fe4565b60005473ffffffffffffffffffffffffffffffffffffffff16331461141157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e657200000000000000000000604482015290519081900360640190fd5b60035473ffffffffffffffffffffffffffffffffffffffff82811691161461149a57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f496e76616c69642070726f706f7365642061676772656761746f720000000000604482015290519081900360640190fd5b600380547fffffffffffffffffffffffff00000000000000000000000000000000000000001690556114cb81612117565b50565b60055460009073ffffffffffffffffffffffffffffffffffffffff168015806115dc5750604080517f6b14daf8000000000000000000000000000000000000000000000000000000008152336004820181815260248301938452366044840181905273ffffffffffffffffffffffffffffffffffffffff861694636b14daf8946000939190606401848480828437600083820152604051601f9091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016909201965060209550909350505081840390508186803b1580156115af57600080fd5b505afa1580156115c3573d6000803e3d6000fd5b505050506040513d60208110156115d957600080fd5b50515b61164757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4e6f206163636573730000000000000000000000000000000000000000000000604482015290519081900360640190fd5b611650836121de565b9392505050565b60055460009073ffffffffffffffffffffffffffffffffffffffff168015806117655750604080517f6b14daf8000000000000000000000000000000000000000000000000000000008152336004820181815260248301938452366044840181905273ffffffffffffffffffffffffffffffffffffffff861694636b14daf8946000939190606401848480828437600083820152604051601f9091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016909201965060209550909350505081840390508186803b15801561173857600080fd5b505afa15801561174c573d6000803e3d6000fd5b505050506040513d602081101561176257600080fd5b50515b6117d057604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4e6f206163636573730000000000000000000000000000000000000000000000604482015290519081900360640190fd5b611650836122d8565b60055473ffffffffffffffffffffffffffffffffffffffff1681565b60046020526000908152604090205473ffffffffffffffffffffffffffffffffffffffff1681565b60035473ffffffffffffffffffffffffffffffffffffffff1681565b60005473ffffffffffffffffffffffffffffffffffffffff1633146118bf57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e657200000000000000000000604482015290519081900360640190fd5b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60005473ffffffffffffffffffffffffffffffffffffffff1633146119bb57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e657200000000000000000000604482015290519081900360640190fd5b600380547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b600554600090819081908190819073ffffffffffffffffffffffffffffffffffffffff16801580611b185750604080517f6b14daf8000000000000000000000000000000000000000000000000000000008152336004820181815260248301938452366044840181905273ffffffffffffffffffffffffffffffffffffffff861694636b14daf8946000939190606401848480828437600083820152604051601f9091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016909201965060209550909350505081840390508186803b158015611aeb57600080fd5b505afa158015611aff573d6000803e3d6000fd5b505050506040513d6020811015611b1557600080fd5b50515b611b8357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4e6f206163636573730000000000000000000000000000000000000000000000604482015290519081900360640190fd5b61112261239b565b6000600260000160029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166350d25bcd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561052857600080fd5b600354600090819081908190819073ffffffffffffffffffffffffffffffffffffffff16611c8757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f4e6f2070726f706f7365642061676772656761746f722070726573656e740000604482015290519081900360640190fd5b600354604080517f9a6fc8f500000000000000000000000000000000000000000000000000000000815269ffffffffffffffffffff89166004820152905173ffffffffffffffffffffffffffffffffffffffff90921691639a6fc8f59160248082019260a092909190829003018186803b158015611d0457600080fd5b505afa158015611d18573d6000803e3d6000fd5b505050506040513d60a0811015611d2e57600080fd5b508051602082015160408301516060840151608090940151929a91995097509195509350915050565b6000611d61612516565b5060408051808201825260025461ffff81168083526201000090910473ffffffffffffffffffffffffffffffffffffffff16602080840182905284517f668a0f0200000000000000000000000000000000000000000000000000000000815294519394611e1c9463668a0f0292600480840193919291829003018186803b158015611deb57600080fd5b505afa158015611dff573d6000803e3d6000fd5b505050506040513d6020811015611e1557600080fd5b50516124b8565b69ffffffffffffffffffff1691505090565b6000600260000160029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638205bf6a6040518163ffffffff1660e01b815260040160206040518083038186803b15801561052857600080fd5b600354600090819081908190819073ffffffffffffffffffffffffffffffffffffffff16611f2a57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f4e6f2070726f706f7365642061676772656761746f722070726573656e740000604482015290519081900360640190fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663feaf968c6040518163ffffffff1660e01b815260040160a06040518083038186803b158015611f9257600080fd5b505afa158015611fa6573d6000803e3d6000fd5b505050506040513d60a0811015611fbc57600080fd5b5080516020820151604083015160608401516080909401519299919850965091945092509050565b60008060008060008060006120048869ffffffffffffffffffff166124d8565b61ffff821660009081526004602081905260408083205481517f9a6fc8f500000000000000000000000000000000000000000000000000000000815267ffffffffffffffff86169381019390935290519496509294509092839283928392839273ffffffffffffffffffffffffffffffffffffffff1691639a6fc8f59160248083019260a0929190829003018186803b1580156120a057600080fd5b505afa1580156120b4573d6000803e3d6000fd5b505050506040513d60a08110156120ca57600080fd5b508051602082015160408301516060840151608090940151929850909650945090925090506120fd85858585858c6124e0565b9b509b509b509b509b505050505050505091939590929450565b60028054604080518082018252600161ffff808516919091011680825273ffffffffffffffffffffffffffffffffffffffff9590951660209182018190527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000090931685177fffffffffffffffffffff0000000000000000000000000000000000000000ffff166201000084021790935560009384526004909252912080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169091179055565b600069ffffffffffffffffffff8211156121fa575060006122d3565b600080612206846124d8565b61ffff8216600090815260046020526040902054919350915073ffffffffffffffffffffffffffffffffffffffff168061224657600093505050506122d3565b8073ffffffffffffffffffffffffffffffffffffffff1663b5ab58dc836040518263ffffffff1660e01b8152600401808267ffffffffffffffff16815260200191505060206040518083038186803b1580156122a157600080fd5b505afa1580156122b5573d6000803e3d6000fd5b505050506040513d60208110156122cb57600080fd5b505193505050505b919050565b600069ffffffffffffffffffff8211156122f4575060006122d3565b600080612300846124d8565b61ffff8216600090815260046020526040902054919350915073ffffffffffffffffffffffffffffffffffffffff168061234057600093505050506122d3565b8073ffffffffffffffffffffffffffffffffffffffff1663b633620c836040518263ffffffff1660e01b8152600401808267ffffffffffffffff16815260200191505060206040518083038186803b1580156122a157600080fd5b60008060008060006123ab612516565b5060408051808201825260025461ffff8116825262010000900473ffffffffffffffffffffffffffffffffffffffff166020820181905282517ffeaf968c0000000000000000000000000000000000000000000000000000000081529251919260009283928392839283929163feaf968c9160048083019260a0929190829003018186803b15801561243c57600080fd5b505afa158015612450573d6000803e3d6000fd5b505050506040513d60a081101561246657600080fd5b5080516020820151604083015160608401516080909401518a5193995091975095509193509091506124a190869086908690869086906124e0565b9a509a509a509a509a505050505050509091929394565b67ffffffffffffffff1660409190911b69ffff0000000000000000161790565b604081901c91565b60008060008060006124f2868c6124b8565b8a8a8a6124ff8a8c6124b8565b939f929e50909c509a509098509650505050505050565b60408051808201909152600080825260208201529056fea2646970667358221220c6148a0e63011d3b8b4f67078be31115256b163e26351db6fe3b70d7faf433f964736f6c6343000606003300000000000000000000000049f955caecefad202e5ee002387bee3303b6a7450000000000000000000000000000000000000000000000000000000000000000"\ "value":"0x0"\ }\ "blockHash":"0x2df44a0952881cdb7469324d63f174b92ca9231f3e59d713fc4c5a3340e31d7e"\ "blockNumber":15947694\ "result":{\ "address":"0xc8f19128c2cc35d66d90aa2a5b3254f01f9bfe77"\ "code":"0x608060405234801561001057600080fd5b506004361061018d5760003560e01c80638f6b4d91116100e3578063bc43cbaf1161008c578063f2fde38b11610066578063f2fde38b1461042b578063f8a2abd31461045e578063feaf968c146104915761018d565b8063bc43cbaf146103fa578063c159730414610402578063e8c4be30146104235761018d565b8063a928c096116100bd578063a928c0961461038d578063b5ab58dc146103c0578063b633620c146103dd5761018d565b80638f6b4d911461032957806392eefe9b146103315780639a6fc8f5146103645761018d565b80636001ac531161014557806379ba50971161011f57806379ba50971461030f5780638205bf6a146103195780638da5cb5b146103215761018d565b80636001ac5314610222578063668a0f021461028a5780637284e416146102925761018d565b806350d25bcd1161017657806350d25bcd146101e157806354fd4d50146101fb57806358303b10146102035761018d565b8063245a7bfc14610192578063313ce567146101c3575b600080fd5b61019a610499565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b6101cb6104bb565b6040805160ff9092168252519081900360200190f35b6101e9610559565b60408051918252519081900360200190f35b6101e96106e0565b61020b61074d565b6040805161ffff9092168252519081900360200190f35b61024b6004803603602081101561023857600080fd5b503569ffffffffffffffffffff16610757565b6040805169ffffffffffffffffffff96871681526020810195909552848101939093526060840191909152909216608082015290519081900360a00190f35b6101e9610978565b61029a610af9565b6040805160208082528351818301528351919283929083019185019080838360005b838110156102d45781810151838201526020016102bc565b50505050905090810190601f1680156103015780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610317610c76565b005b6101e9610d78565b61019a610ef9565b61024b610f15565b6103176004803603602081101561034757600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611134565b61024b6004803603602081101561037a57600080fd5b503569ffffffffffffffffffff16611201565b610317600480360360208110156103a357600080fd5b503573ffffffffffffffffffffffffffffffffffffffff1661138b565b6101e9600480360360208110156103d657600080fd5b50356114ce565b6101e9600480360360208110156103f357600080fd5b5035611657565b61019a6117d9565b61019a6004803603602081101561041857600080fd5b503561ffff166117f5565b61019a61181d565b6103176004803603602081101561044157600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611839565b6103176004803603602081101561047457600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611935565b61024b611a02565b60025462010000900473ffffffffffffffffffffffffffffffffffffffff1690565b6000600260000160029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b15801561052857600080fd5b505afa15801561053c573d6000803e3d6000fd5b505050506040513d602081101561055257600080fd5b5051905090565b60055460009073ffffffffffffffffffffffffffffffffffffffff168015806106675750604080517f6b14daf8000000000000000000000000000000000000000000000000000000008152336004820181815260248301938452366044840181905273ffffffffffffffffffffffffffffffffffffffff861694636b14daf8946000939190606401848480828437600083820152604051601f9091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016909201965060209550909350505081840390508186803b15801561063a57600080fd5b505afa15801561064e573d6000803e3d6000fd5b505050506040513d602081101561066457600080fd5b50515b6106d257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4e6f206163636573730000000000000000000000000000000000000000000000604482015290519081900360640190fd5b6106da611b8b565b91505090565b6000600260000160029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166354fd4d506040518163ffffffff1660e01b815260040160206040518083038186803b15801561052857600080fd5b60025461ffff1690565b600554600090819081908190819073ffffffffffffffffffffffffffffffffffffffff1680158061086d5750604080517f6b14daf8000000000000000000000000000000000000000000000000000000008152336004820181815260248301938452366044840181905273ffffffffffffffffffffffffffffffffffffffff861694636b14daf8946000939190606401848480828437600083820152604051601f9091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016909201965060209550909350505081840390508186803b15801561084057600080fd5b505afa158015610854573d6000803e3d6000fd5b505050506040513d602081101561086a57600080fd5b50515b6108d857604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4e6f206163636573730000000000000000000000000000000000000000000000604482015290519081900360640190fd5b60035473ffffffffffffffffffffffffffffffffffffffff1661095c57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f4e6f2070726f706f7365642061676772656761746f722070726573656e740000604482015290519081900360640190fd5b61096587611bf8565b939b929a50909850965090945092505050565b60055460009073ffffffffffffffffffffffffffffffffffffffff16801580610a865750604080517f6b14daf8000000000000000000000000000000000000000000000000000000008152336004820181815260248301938452366044840181905273ffffffffffffffffffffffffffffffffffffffff861694636b14daf8946000939190606401848480828437600083820152604051601f9091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016909201965060209550909350505081840390508186803b158015610a5957600080fd5b505afa158015610a6d573d6000803e3d6000fd5b505050506040513d6020811015610a8357600080fd5b50515b610af157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4e6f206163636573730000000000000000000000000000000000000000000000604482015290519081900360640190fd5b6106da611d57565b6060600260000160029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16637284e4166040518163ffffffff1660e01b815260040160006040518083038186803b158015610b6657600080fd5b505afa158015610b7a573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526020811015610bc157600080fd5b8101908080516040519392919084640100000000821115610be157600080fd5b908301906020820185811115610bf657600080fd5b8251640100000000811182820188101715610c1057600080fd5b82525081516020918201929091019080838360005b83811015610c3d578181015183820152602001610c25565b50505050905090810190601f168015610c6a5780820380516001836020036101000a031916815260200191505b50604052505050905090565b60015473ffffffffffffffffffffffffffffffffffffffff163314610cfc57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e657200000000000000000000604482015290519081900360640190fd5b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b60055460009073ffffffffffffffffffffffffffffffffffffffff16801580610e865750604080517f6b14daf8000000000000000000000000000000000000000000000000000000008152336004820181815260248301938452366044840181905273ffffffffffffffffffffffffffffffffffffffff861694636b14daf8946000939190606401848480828437600083820152604051601f9091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016909201965060209550909350505081840390508186803b158015610e5957600080fd5b505afa158015610e6d573d6000803e3d6000fd5b505050506040513d6020811015610e8357600080fd5b50515b610ef157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4e6f206163636573730000000000000000000000000000000000000000000000604482015290519081900360640190fd5b6106da611e2e565b60005473ffffffffffffffffffffffffffffffffffffffff1681565b600554600090819081908190819073ffffffffffffffffffffffffffffffffffffffff1680158061102b5750604080517f6b14daf8000000000000000000000000000000000000000000000000000000008152336004820181815260248301938452366044840181905273ffffffffffffffffffffffffffffffffffffffff861694636b14daf8946000939190606401848480828437600083820152604051601f9091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016909201965060209550909350505081840390508186803b158015610ffe57600080fd5b505afa158015611012573d6000803e3d6000fd5b505050506040513d602081101561102857600080fd5b50515b61109657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4e6f206163636573730000000000000000000000000000000000000000000000604482015290519081900360640190fd5b60035473ffffffffffffffffffffffffffffffffffffffff1661111a57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f4e6f2070726f706f7365642061676772656761746f722070726573656e740000604482015290519081900360640190fd5b611122611e9b565b95509550955095509550509091929394565b60005473ffffffffffffffffffffffffffffffffffffffff1633146111ba57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e657200000000000000000000604482015290519081900360640190fd5b600580547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b600554600090819081908190819073ffffffffffffffffffffffffffffffffffffffff168015806113175750604080517f6b14daf8000000000000000000000000000000000000000000000000000000008152336004820181815260248301938452366044840181905273ffffffffffffffffffffffffffffffffffffffff861694636b14daf8946000939190606401848480828437600083820152604051601f9091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016909201965060209550909350505081840390508186803b1580156112ea57600080fd5b505afa1580156112fe573d6000803e3d6000fd5b505050506040513d602081101561131457600080fd5b50515b61138257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4e6f206163636573730000000000000000000000000000000000000000000000604482015290519081900360640190fd5b61096587611fe4565b60005473ffffffffffffffffffffffffffffffffffffffff16331461141157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e657200000000000000000000604482015290519081900360640190fd5b60035473ffffffffffffffffffffffffffffffffffffffff82811691161461149a57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f496e76616c69642070726f706f7365642061676772656761746f720000000000604482015290519081900360640190fd5b600380547fffffffffffffffffffffffff00000000000000000000000000000000000000001690556114cb81612117565b50565b60055460009073ffffffffffffffffffffffffffffffffffffffff168015806115dc5750604080517f6b14daf8000000000000000000000000000000000000000000000000000000008152336004820181815260248301938452366044840181905273ffffffffffffffffffffffffffffffffffffffff861694636b14daf8946000939190606401848480828437600083820152604051601f9091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016909201965060209550909350505081840390508186803b1580156115af57600080fd5b505afa1580156115c3573d6000803e3d6000fd5b505050506040513d60208110156115d957600080fd5b50515b61164757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4e6f206163636573730000000000000000000000000000000000000000000000604482015290519081900360640190fd5b611650836121de565b9392505050565b60055460009073ffffffffffffffffffffffffffffffffffffffff168015806117655750604080517f6b14daf8000000000000000000000000000000000000000000000000000000008152336004820181815260248301938452366044840181905273ffffffffffffffffffffffffffffffffffffffff861694636b14daf8946000939190606401848480828437600083820152604051601f9091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016909201965060209550909350505081840390508186803b15801561173857600080fd5b505afa15801561174c573d6000803e3d6000fd5b505050506040513d602081101561176257600080fd5b50515b6117d057604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4e6f206163636573730000000000000000000000000000000000000000000000604482015290519081900360640190fd5b611650836122d8565b60055473ffffffffffffffffffffffffffffffffffffffff1681565b60046020526000908152604090205473ffffffffffffffffffffffffffffffffffffffff1681565b60035473ffffffffffffffffffffffffffffffffffffffff1681565b60005473ffffffffffffffffffffffffffffffffffffffff1633146118bf57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e657200000000000000000000604482015290519081900360640190fd5b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60005473ffffffffffffffffffffffffffffffffffffffff1633146119bb57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e657200000000000000000000604482015290519081900360640190fd5b600380547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b600554600090819081908190819073ffffffffffffffffffffffffffffffffffffffff16801580611b185750604080517f6b14daf8000000000000000000000000000000000000000000000000000000008152336004820181815260248301938452366044840181905273ffffffffffffffffffffffffffffffffffffffff861694636b14daf8946000939190606401848480828437600083820152604051601f9091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016909201965060209550909350505081840390508186803b158015611aeb57600080fd5b505afa158015611aff573d6000803e3d6000fd5b505050506040513d6020811015611b1557600080fd5b50515b611b8357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4e6f206163636573730000000000000000000000000000000000000000000000604482015290519081900360640190fd5b61112261239b565b6000600260000160029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166350d25bcd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561052857600080fd5b600354600090819081908190819073ffffffffffffffffffffffffffffffffffffffff16611c8757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f4e6f2070726f706f7365642061676772656761746f722070726573656e740000604482015290519081900360640190fd5b600354604080517f9a6fc8f500000000000000000000000000000000000000000000000000000000815269ffffffffffffffffffff89166004820152905173ffffffffffffffffffffffffffffffffffffffff90921691639a6fc8f59160248082019260a092909190829003018186803b158015611d0457600080fd5b505afa158015611d18573d6000803e3d6000fd5b505050506040513d60a0811015611d2e57600080fd5b508051602082015160408301516060840151608090940151929a91995097509195509350915050565b6000611d61612516565b5060408051808201825260025461ffff81168083526201000090910473ffffffffffffffffffffffffffffffffffffffff16602080840182905284517f668a0f0200000000000000000000000000000000000000000000000000000000815294519394611e1c9463668a0f0292600480840193919291829003018186803b158015611deb57600080fd5b505afa158015611dff573d6000803e3d6000fd5b505050506040513d6020811015611e1557600080fd5b50516124b8565b69ffffffffffffffffffff1691505090565b6000600260000160029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638205bf6a6040518163ffffffff1660e01b815260040160206040518083038186803b15801561052857600080fd5b600354600090819081908190819073ffffffffffffffffffffffffffffffffffffffff16611f2a57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f4e6f2070726f706f7365642061676772656761746f722070726573656e740000604482015290519081900360640190fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663feaf968c6040518163ffffffff1660e01b815260040160a06040518083038186803b158015611f9257600080fd5b505afa158015611fa6573d6000803e3d6000fd5b505050506040513d60a0811015611fbc57600080fd5b5080516020820151604083015160608401516080909401519299919850965091945092509050565b60008060008060008060006120048869ffffffffffffffffffff166124d8565b61ffff821660009081526004602081905260408083205481517f9a6fc8f500000000000000000000000000000000000000000000000000000000815267ffffffffffffffff86169381019390935290519496509294509092839283928392839273ffffffffffffffffffffffffffffffffffffffff1691639a6fc8f59160248083019260a0929190829003018186803b1580156120a057600080fd5b505afa1580156120b4573d6000803e3d6000fd5b505050506040513d60a08110156120ca57600080fd5b508051602082015160408301516060840151608090940151929850909650945090925090506120fd85858585858c6124e0565b9b509b509b509b509b505050505050505091939590929450565b60028054604080518082018252600161ffff808516919091011680825273ffffffffffffffffffffffffffffffffffffffff9590951660209182018190527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000090931685177fffffffffffffffffffff0000000000000000000000000000000000000000ffff166201000084021790935560009384526004909252912080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169091179055565b600069ffffffffffffffffffff8211156121fa575060006122d3565b600080612206846124d8565b61ffff8216600090815260046020526040902054919350915073ffffffffffffffffffffffffffffffffffffffff168061224657600093505050506122d3565b8073ffffffffffffffffffffffffffffffffffffffff1663b5ab58dc836040518263ffffffff1660e01b8152600401808267ffffffffffffffff16815260200191505060206040518083038186803b1580156122a157600080fd5b505afa1580156122b5573d6000803e3d6000fd5b505050506040513d60208110156122cb57600080fd5b505193505050505b919050565b600069ffffffffffffffffffff8211156122f4575060006122d3565b600080612300846124d8565b61ffff8216600090815260046020526040902054919350915073ffffffffffffffffffffffffffffffffffffffff168061234057600093505050506122d3565b8073ffffffffffffffffffffffffffffffffffffffff1663b633620c836040518263ffffffff1660e01b8152600401808267ffffffffffffffff16815260200191505060206040518083038186803b1580156122a157600080fd5b60008060008060006123ab612516565b5060408051808201825260025461ffff8116825262010000900473ffffffffffffffffffffffffffffffffffffffff166020820181905282517ffeaf968c0000000000000000000000000000000000000000000000000000000081529251919260009283928392839283929163feaf968c9160048083019260a0929190829003018186803b15801561243c57600080fd5b505afa158015612450573d6000803e3d6000fd5b505050506040513d60a081101561246657600080fd5b5080516020820151604083015160608401516080909401518a5193995091975095509193509091506124a190869086908690869086906124e0565b9a509a509a509a509a505050505050509091929394565b67ffffffffffffffff1660409190911b69ffff0000000000000000161790565b604081901c91565b60008060008060006124f2868c6124b8565b8a8a8a6124ff8a8c6124b8565b939f929e50909c509a509098509650505050505050565b60408051808201909152600080825260208201529056fea2646970667358221220c6148a0e63011d3b8b4f67078be31115256b163e26351db6fe3b70d7faf433f964736f6c63430006060033"\ "gasUsed":"0x1e4bb5"\ }\ "subtraces":0\ "traceAddress":[]\ "transactionHash":"0xfc7345c62b23f39d36ada799dd7cd7fc3a8392365f855be22e1a40e7eecdea33"\ "transactionPosition":0\ "type":"create"\ },\ { ... }\ ] } The full response can't be included here due to it being so big since it contains the traces for all the transactions included in the given block. If you wish to inspect the full response you can do so on the [Alchemy Composer](https://composer.alchemy.com/?composer_state=%7B%22network%22%3A0%2C%22methodName%22%3A%22trace_transaction%22%2C%22paramValues%22%3A%5B%220x17104ac9d3312d8c136b7f44d4b8b47852618065ebfa534bd2d3b5ef218ca1f3%22%5D%7D) . Use Case ======== The `trace_block` method is used to analyze the behavior of a blockchain. For example, you can find the average `gasPrice` for a block by getting the traces of all the transactions in the block (traces contain the `gasPrice` for transactions). Then you can get the average `gasPrice` block by block and form a graph to visualize how the `gasPrice` has changed over time. Graphing the average gas prices over time has already been done by websites like YCHARTS. Conclusion ========== In conclusion, the `trace_block` method is a valuable tool that can be used for analyzing the behavior of an EVM-compatible blockchain. Was this page helpful? YesNo --- # monadLogs | Alchemy Docs Copy page monadLogs ========= Returns logs (that match a given filter) as soon as the block is Proposed. The `monadLogs` subscription type emits logs that match a specified topic filter as soon as the block is Proposed and the node has speculatively executed the transactions. This provides earlier access to log data compared to regular [`logs`](https://www.alchemy.com/docs/reference/logs) subscriptions which wait for block finalization. Supported Networks ================== Check the [Chains](https://dashboard.alchemy.com/chains?utm_source=docs&utm_medium=referral&utm_content=reference_monadlogs) page for details about product and chain support! ![](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764179964%2Fdocs%2Fapi-reference%2Falchemy-transact%2Ftransaction-simulation%2F523fb8a9a9d899921ee1046d0ff1b389967a9976d1c6112ebbbe071ddd1ef374-image.png&w=3840&q=75) Parameters ========== An object with the following fields: * `address` (optional): `string` or `array of strings` Singular address or array of addresses. Only logs created from one of these addresses will be emitted. * `topics`: an array of topic specifiers (**up to 4 topics allowed per address**). * Each topic specifier is either `null`, a single string, or an array of strings. * For every non `null` topic, a log will be emitted when activity associated with that topic occurs. Request ======= javascript Viem Ethers.js // initiate websocket stream first wscat -c wss://eth-mainnet.g.alchemy.com/v2/demo // then call subscription {"jsonrpc":"2.0","id": 1, "method": "eth_subscribe", "params": ["logs", {"address": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", "topics": ["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"]}]} Result ====== result { "jsonrpc":"2.0", "method":"eth_subscription", "params": { "subscription":"0x4a8a4c0517381924f9838102c5a4dcb7", "result":{ "blockId": "0x71ce47f39a1eb490354166f762d78bf6e2acaf80b24b4bcd756118d93ef81be0", "commitState": "Proposed", "address":"0x8320fe7702b96808f7bbc0d4a888ed1468216cfd", "blockHash":"0x61cdb2a09ab99abf791d474f20c2ea89bf8de2923a2d42bb49944c8c993cbf04", "blockNumber":"0x29e87", "data":"0x00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000003", "logIndex":"0x0", "topics":["0xd78a0cb8bb633d06981248b816e7bd33c2a35a6089241d099fa519e361cab902"], "transactionHash":"0xe044554a0a55067caafd07f8020ab9f2af60bdfe337e395ecd84b4877a3d1ab4", "transactionIndex":"0x0" } } } Below you can find the explanation for individual properties of the response: * **`jsonrpc`**: The `jsonrpc` property specifies the version of the JSON-RPC protocol that is being used, which in this case is "2.0". * **`method`**: The `method` property specifies the method that was called, which in this case is `eth_subscription`. * **`params`**: The `params` property contains the parameters of the method call. In this case, it contains a `subscription` property, which specifies the subscription identifier, and a `result` property, which contains the result of the subscription. * **`result`**: The `result` property contains information about a specific transaction on the Ethereum blockchain. * **`address`**: The `address` property specifies the address from which this log originated. * **`blockhash`**: The `blockHash` property specifies the hash of the block in which the transaction was included. * **`blockNumber`**: The `blockNumber` property specifies the number of the block in which the transaction was included. It is encoded as a hexadecimal string. * **`data`**: Contains one or more 32 Bytes non-indexed arguments of the log. * **`logIndex`**: The `logIndex` property specifies the index or position of the log entry within the block. It is encoded as a hexadecimal string. * **`topics`**: An array of 0 to 4 32 bytes topic hashes of indexed log arguments (up to 4 topics allowed per address). * **`transactionHash`**: The `transactionHash` property specifies the hash of the transaction. * **`transactionIndex`**: The `transactionIndex` property specifies the index or position of the transaction within the block. It is encoded as a hexadecimal string. Was this page helpful? YesNo --- # alchemy_minedTransactions | Alchemy Docs Copy page alchemy\_minedTransactions ========================== Emits full transaction objects or hashes that are mined on the network based on provided filters and block tags. The `alchemy_minedTransactions` subscription type subscribes to mined transactions via WebSockets, and filters those transactions based on specified `from` and/or `to` addresses. The subscription will return either full transaction objects or just transaction hashes depending on the request. It will also optionally include re-orged or removed transactions if specified. Supported Networks ================== Check the [Chains](https://dashboard.alchemy.com/chains?utm_source=docs&utm_medium=referral&utm_content=reference_alchemy-minedtransactions) page for details about product and chain support! ![](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764179964%2Fdocs%2Fapi-reference%2Falchemy-transact%2Ftransaction-simulation%2F523fb8a9a9d899921ee1046d0ff1b389967a9976d1c6112ebbbe071ddd1ef374-image.png&w=3840&q=75) Parameters ========== * `addresses` (optional): \[`array of objects`\] list of addresses to filter mined transactions for specified by `to` or `from` in the following format: `[{"to": "string", "from": "string"}]`. Limit of 1000 total addresses. * `includeRemoved` (optional): `boolean` specifier to include transactions that have been removed from the cannonical chain (or [re-orged](https://www.alchemy.com/docs/ethereum-developer-guide-to-the-merge#what-is-a-re-org-re-organization) ). * `hashesOnly` (optional): `boolean` default value is `false`, where the response will return a full transaction object (matches the payload of [eth\_getTransactionByHash](https://www.alchemy.com/docs/reference/eth-gettransactionbyhash) ) . If set to `true`, the payload returned contains only the _hashes_ of the transactions that are mined. Excluding all parameters returns the transaction information for **all transactions** that are mined on chain. Returns ======= Mined transactions are returned once they are mined in the `latest` block. In the future we may add support to specify a given block tag confirmation. With `hashesOnly` = `true` * `result`: * `removed` - `boolean` specifier if the transaction has been removed (re-orged) * `transaction` - transaction object for mined transaction * `hash` - `string` transaction hash * `subscription`: `string` - subscription ID With `hashesOnly` = `false` * `result`: * `removed` - `boolean` specifier if the transaction has been removed (re-orged) * `transaction` - transaction object for mined transaction \*`blockHash`: `DATA`, 32 Bytes - hash of block that the transaction was mined in \*`blockNumber`: `QUANTITY` - `null` when it's pending. \*`from`: `DATA`, 20 Bytes - address of the sender. \*`gas`: `QUANTITY` - gas provided by the sender. \*`gasPrice`: `QUANTITY` - gas price provided by the sender in Wei. \*`hash`: `DATA`, 32 Bytes - hash of the transaction. \*`input`: `DATA` - the data send along with the transaction. \*`nonce`: `QUANTITY` - the number of transactions made by the sender prior to this one. \*`to`: `DATA`, 20 Bytes - address of the receiver. `null` when it's a contract creation transaction. \*`transactionIndex`: `QUANTITY` - `null` when its pending. \*`value`: `QUANTITY` - value transferred in Wei. \*`v`: `QUANTITY` - ECDSA recovery id \*`r`: `DATA`, 32 Bytes - ECDSA signature r \*`s`: `DATA`, 32 Bytes - ECDSA signature s * `subscription`: `string` - subscription ID ### Request wscat Viem Ethers.js // initiate websocket stream first wscat -c wss://eth-mainnet.g.alchemy.com/v2/demo // no param specification - return all mined txs {"jsonrpc":"2.0","id": 2, "method": "eth_subscribe", "params": ["alchemy_minedTransactions"]} // to and from filters, hashesOnly = true { "jsonrpc": "2.0", "method": "eth_subscribe", "params": [\ "alchemy_minedTransactions",\ {\ "addresses": [\ {\ "to": "0x9f3ce0ad29b767d809642a53c2bccc9a130659d7",\ "from": "0x228f108fd09450d083bb33fe0cc50ae449bc7e11"\ },\ {\ "to": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"\ }\ ],\ "includeRemoved": false,\ "hashesOnly": true\ }\ ], "id": 1 } ### Result results {"id":1,"result":"0xf13f7073ddef66a8c1b0c9c9f0e543c3","jsonrpc":"2.0"} // hashesOnly = true { "jsonrpc": "2.0", "method": "eth_subscription", "params": { "result": { "removed": false "transaction": { "hash":"0xa8f2cf69e302da6c8100b80298ed77c37b6e75eed1177ca22acd5772c9fb9876", } }, "subscription": "0xf13f7073ddef66a8c1b0c9c9f0e543c3" } } // hashesOnly = false { "jsonrpc": "2.0", "method": "eth_subscription", "params": { "result": { "removed": false "transaction": { "blockHash":"0xbe847be2bceb74e660daf96b3f0669d58f59dc9101715689a00ef864a5408f43", "blockNumber":"0x5b8d80", "hash":"0xa8f2cf69e302da6c8100b80298ed77c37b6e75eed1177ca22acd5772c9fb9876", "from":"0x2a9847093ad514639e8cdec960b5e51686960291", "gas":"0x4f588", "gasPrice":"0xc22a75840", "input":"0x000101d521928b4146", "nonce":"0x9a2", "r":"0xb5889c55a0ebbf86627524affc9c4fdedc4608bee7a0f9880b5ec965d58e4264", "s":"0x2da32e817e2483ec2199ec0121b93384ac820049a75e11b40d152fc7558a5d72", "to":"0xc7ed8919c70dd8ccf1a57c0ed75b25ceb2dd22d1", "transactionIndex":"0x14", "type":"0x0", "v":"0x1c", "value":"0x0" } }, "subscription": "0xf13f7073ddef66a8c1b0c9c9f0e543c3" } } Was this page helpful? YesNo --- # debug_getRawBlock | Alchemy Docs Copy page debug\_getRawBlock ================== POST https://eth-mainnet.g.alchemy.com/v2/{apiKey} Returns an RLP-encoded block. Path Parameters --------------- `apiKey`stringrequireddefaults to `docs-demo` For higher throughput, [create your own API key](https://dashboard.alchemy.com/signup?utm_source=docs&utm_medium=referral&utm_content=node_debug-api_debug-api-endpoints_debug-get-raw-block) Request ------- `BlockNumberOrTag`string or enumrequired The block number or tag (e.g., "latest", "earliest"). Show 2 variants Responses --------- ### 200 RLP-encoded block as a hexadecimal string RLP-encoded block as a hexadecimal string Was this page helpful? YesNo --- # debug_traceBlockByHash | Alchemy Docs Copy page debug\_traceBlockByHash ======================= POST https://eth-mainnet.g.alchemy.com/v2/{apiKey} Replays the block that is already present in the database. Path Parameters --------------- `apiKey`stringrequireddefaults to `docs-demo` For higher throughput, [create your own API key](https://dashboard.alchemy.com/signup?utm_source=docs&utm_medium=referral&utm_content=node_debug-api_debug-api-endpoints_debug-trace-block-by-hash) Request ------- `Block hash`string`format: "^0x[0-9a-f]{64}$"`required Block hash for the block to be traced. `Tracer`objectoptional Tracer object for the call. Show 2 properties Responses --------- ### 200 Array of block traces. Array of block traces. Show 11 properties Was this page helpful? YesNo --- # debug_traceCall | Alchemy Docs Copy page debug\_traceCall ================ POST https://eth-mainnet.g.alchemy.com/v2/{apiKey} Runs an eth\_call within the context of the given block execution using the final state of parent block as the base. Path Parameters --------------- `apiKey`stringrequireddefaults to `docs-demo` For higher throughput, [create your own API key](https://dashboard.alchemy.com/signup?utm_source=docs&utm_medium=referral&utm_content=node_debug-api_debug-api-endpoints_debug-trace-call) Request ------- `Transaction Object`objectrequired The transaction call object. Show 6 properties `Block identifier`string or enumrequired Block hash, block number (in hex), or block tag. Show 3 variants `Options`objectoptional Options for the call including tracer and state overrides. Show 2 properties Responses --------- ### 200 Array of call traces. Array of block traces. Show 11 properties Was this page helpful? YesNo --- # alchemy_pendingTransactions | Alchemy Docs Copy page alchemy\_pendingTransactions ============================ The `alchemy_pendingTransactions` subscription type subscribes to pending transactions via WebSockets, and filters those transactions based on specified `from` and/or `to` addresses. The subscription will return either full transaction objects or just transaction hashes depending on the request. It will also optionally include re-orged or removed transactions if specified. When listening to pending transactions with this endpoint, you will only get pending transactions in Alchemy mempool. Supported Networks ================== Please note that `alchemy_pendingTransactions` is only supported on **ETH Mainnet**, **ETH Sepolia** and **Matic Mainnet.** Limits ====== A maximum of 1000 addresses can be added in the addresses filter for `alchemy_pendingTransactions`. Parameters ========== * `fromAddress` (optional): `string` or \[`array of strings`\] * Singular address or array of addresses to receive pending transactions sent **from** this address. * `toAddress` (optional): `string` or \[`array of strings`\] * Singular address or array of addresses to receive pending transactions **to** this address * `hashesOnly` (optional): `boolean` default value is `false`, where the response matches the payload of [eth\_getTransactionByHash](https://www.alchemy.com/docs/reference/eth-gettransactionbyhash) . If set to `true`, the payload returned contains _only the hashes of the transactions_ that are added to the pending state, which matches the payload of [newPendingTransactions](https://www.alchemy.com/docs/reference/newpendingtransactions) **Note: Parameter Specification** 1. There is an address limit of 1k unique addresses (combination of `fromAddress` and `toAddress` lists) 2. Excluding all parameters returns the transaction information for all transactions that are added to the pending state. 3. If `fromAddress` and `toAddress` are both present, then this subscription will include transactions sent from the `fromAddress` OR received by the `toAddress`. Returns ======= With `hashesOnly` = `true` * `result`: _**\[string\]**_\- transaction hash for pending transaction * `subscription`: _**\[string\]**_ - subscription ID With `hashesOnly` = `false` * `result` - _**\[object\]**_ A transaction object: * `blockHash`: `DATA`, 32 Bytes - `null` when it's pending. * `blockNumber`: `QUANTITY` - `null` when it's pending. * `from`: `DATA`, 20 Bytes - address of the sender. * `gas`: `QUANTITY` - gas provided by the sender. * `gasPrice`: `QUANTITY` - gas price provided by the sender in Wei. * `hash`: `DATA`, 32 Bytes - hash of the transaction. * `input`: `DATA` - the data send along with the transaction. * `nonce`: `QUANTITY` - the number of transactions made by the sender prior to this one. * `to`: `DATA`, 20 Bytes - address of the receiver. `null` when it's a contract creation transaction. * `transactionIndex`: `QUANTITY` - `null` when its pending. * `value`: `QUANTITY` - value transferred in Wei. * `v`: `QUANTITY` - ECDSA recovery id * `r`: `DATA`, 32 Bytes - ECDSA signature r * `s`: `DATA`, 32 Bytes - ECDSA signature s * `subscription` - _**\[string\]**_ subscription ID ### Request wscat Viem Ethers.js // initiate websocket stream first wscat -c wss://eth-mainnet.g.alchemy.com/v2/demo // then call subscription {"jsonrpc":"2.0","id": 2, "method": "eth_subscribe", "params": ["alchemy_pendingTransactions", {"toAddress": ["0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", "0xdAC17F958D2ee523a2206206994597C13D831ec7"], "hashesOnly": false}]} ### Result results { "id": 1, "result": "0xf13f7073ddef66a8c1b0c9c9f0e543c3", "jsonrpc": "2.0" } { "jsonrpc": "2.0", "method": "eth_subscription", "params": { "result": { "blockHash": null, "blockNumber": null, "from": "0x098bdcdc84ab11a57b7c156557dca8cef853523d", "gas": "0x1284a", "gasPrice": "0x6fc23ac00", "hash": "0x10466101bd8979f3dcba18eb72155be87bdcd4962527d97c84ad93fc4ad5d461", "input": "0xa9059cbb00000000000000000000000054406f1ec84f89532f83768f3f159b73b237257f0000000000000000000000000000000000000000000000000000000001c9c380", "nonce": "0x11", "to": "0xdac17f958d2ee523a2206206994597c13d831ec7", "transactionIndex": null, "value": "0x0", "type": "0x0", "v": "0x26", "r": "0x93ddd646056f365352f7e53dfe5dc81bde53f5b7c7bbe5deea555a62540d6995", "s": "0x79ed82a681930feb11eb68feccd1df2e53e1b96cf9171ae4ffcf53e9b2a40e8e" }, "subscription": "0xf13f7073ddef66a8c1b0c9c9f0e543c3" } } Was this page helpful? YesNo --- # debug_traceTransaction | Alchemy Docs Copy page debug\_traceTransaction ======================= POST https://eth-mainnet.g.alchemy.com/v2/{apiKey} Attempts to run the transaction in the exact same manner as it was executed on the network. Path Parameters --------------- `apiKey`stringrequireddefaults to `docs-demo` For higher throughput, [create your own API key](https://dashboard.alchemy.com/signup?utm_source=docs&utm_medium=referral&utm_content=node_debug-api_debug-api-endpoints_debug-trace-transaction) Request ------- `Transaction hash`string`format: "^0x[0-9a-f]{64}$"`required Hash of the transaction to be traced. `Options`objectoptional Options for the call. Show 3 properties Responses --------- ### 200 Trace for the transaction. Array of block traces. Show 11 properties Was this page helpful? YesNo --- # How to Create Access Keys | Alchemy Docs Copy page How to Create Access Keys ========================= Learn how to create access keys and use them to make requests to Alchemy APIs Introduction to Access Keys --------------------------- You must be a billing or team admin to create and manage access keys. If you don't have the required permissions, contact your team admin to request access. Access keys serve as authentication tokens needed to interact with a subset of Alchemy's suite of APIs. They enable you to access JSON-RPC APIs, NFT API and Gas Manager Admin API. Unlike API keys, access keys can be used in the [authentication header](https://www.alchemy.com/docs/how-to-use-api-keys-in-http-headers) of API requests for added security. Generating Access Keys ---------------------- Follow these steps to create a new access key: 1. Log in to your [Alchemy Dashboard](https://dashboard.alchemy.com/signup?utm_source=docs&utm_medium=referral&utm_content=how-to-create-access-keys) . 2. Click the `Security` option in the sidebar. This will take you to the access keys menu where you can see all your existing access keys and create new ones. ![](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1758911257%2Fdocs%2FScreenshot_2025-09-26_at_11.27.33_AM_qwjave.png&w=3840&q=75) 3. Click on "Create Access Key" to initiate the process. ![](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764180207%2Fdocs%2Ftutorials%2Fgetting-started%2Fapi-security-and-authentication%2Fcc05340-image.png&w=3840&q=75) 4. Fill out the form: 1. **Name**: Choose a unique identifier for your access key, limited to 50 characters. 2. **Permissions**: Select the permissions for your access key. If you plan to make JSON-RPC & NFT API requests using this key, select that option and associate it with an Alchemy app. Select the Gas Manager permissions as required (Read or Read & Write). 3. **Expiry Date**: Optionally, specify when the access key should expire. After this date, the key will become invalid. ![](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1758911257%2Fdocs%2FScreenshot_2025-09-26_at_11.27.33_AM_qwjave.png&w=3840&q=75) 5. Once the details are filled in, click "Create". 6. After creation, the access key will be displayed. Be sure to save it securely — it's only shown once. ![](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764180208%2Fdocs%2Ftutorials%2Fgetting-started%2Fapi-security-and-authentication%2F9ad941c-image.png&w=3840&q=75) 7. Your access key will then be displayed in the access keys menu from where you can delete it if required. ![](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764180209%2Fdocs%2Ftutorials%2Fgetting-started%2Fapi-security-and-authentication%2F7557f3d-image.png&w=3840&q=75) Using Access Keys ----------------- ### Using as Path Param When making requests to the APIs, you can use your access key similar to how you would use an API key (as path params), for example: ![](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764180209%2Fdocs%2Ftutorials%2Fgetting-started%2Fapi-security-and-authentication%2F96820cf-image.png&w=3840&q=75) ### Using as Auth Header In addition to using access keys as path params, you also have the option to use them in authentication header of API requests for added security, for example: ![](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764180211%2Fdocs%2Ftutorials%2Fgetting-started%2Fapi-security-and-authentication%2Fefc9927-image.png&w=3840&q=75) Refer to the guide on [HTTP Header-Based API Requests](https://www.alchemy.com/docs/how-to-use-api-keys-in-http-headers) for detailed information on this approach and why this is more secure than using access keys as path params. That concludes this tutorial! With these steps, you can now successfully create and use access keys for making requests to Alchemy APIs! Was this page helpful? YesNo --- # Integrating Simulation with 1 line of code | Alchemy Docs Copy page Integrating Simulation with 1 line of code ========================================== Learn how to effortlessly integrate Alchemy's Simulation APIs in your code base using just one line of code. Implementing Simulation APIs is as easy as adding 1 line to your code base. If you are already signing transactions via `eth_signTransaction` or any calling any other method that takes an unsigned transaction object, all you need to do is pass the object to `alchemy_simulateAssetChanges`. eth\_signTransaction -------------------- eth\_signTransaction { "jsonrpc": "2.0", "method": "eth_signTransaction", "id": 1, "params": [\ {\ "from": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",\ "to": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",\ "value": "0x0",\ "data": "0xa9059cbb000000000000000000000000fc43f5f9dd45258b3aff31bdbe6561d97e8b71de00000000000000000000000000000000000000000000000000000000000f4240"\ }\ ] } Replace `eth_signTransaction` with `alchemy_simulateAssetChanges` to get simulation results. alchemy\_simulateAssetChanges { "jsonrpc": "2.0", "method": "alchemy_simulateAssetChanges", "id": 1, "params": [\ {\ "from": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",\ "to": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",\ "value": "0x0",\ "data": "0xa9059cbb000000000000000000000000fc43f5f9dd45258b3aff31bdbe6561d97e8b71de00000000000000000000000000000000000000000000000000000000000f4240"\ }\ ] } That's it! ethers.js --------- Coming soon 👀 Was this page helpful? YesNo --- # How to simulate a transaction on Ethereum | Alchemy Docs Copy page How to simulate a transaction on Ethereum ========================================= Learn how to simulate your transactions on the Ethereum network using Alchemy's Simulation APIs Introduction ------------ Understanding the impact of a transaction before execution is important in today's crypto landscape. With Alchemy's Simulation APIs, you can empower your dapp users to see exactly what a transaction will do, providing a clear picture and protecting them from potential scams. This tutorial will guide you on how to simulate Ethereum transactions using these powerful APIs. Let's get started. Table of Contents ----------------- 1. [Understanding the Transaction Object](https://www.alchemy.com/docs/how-to-simulate-a-transaction-on-ethereum#Understanding-the-Transaction-Object) 2. [Simulating a Transaction with Alchemy](https://www.alchemy.com/docs/how-to-simulate-a-transaction-on-ethereum#Simulating-a-Transaction-with-Alchemy) 3. [Conclusion](https://www.alchemy.com/docs/how-to-simulate-a-transaction-on-ethereum#conclusion) Understanding the Transaction Object ------------------------------------ The transaction object is the main part of Ethereum transactions. This object contains the details of the transaction that you're trying to execute or simulate. Here are the primary parameters of this object: * `from`: This is the address from which you are sending the transaction. * `to`: This is the address to which you are sending the transaction. * `value`: The amount of ether to send, represented in wei (1 ETH = 1e18 wei). * `data`: The data field is a hexadecimal string that holds the contract interaction details, such as the function to call and parameter information. For instance, consider the following example of a transaction object: json { "from": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045", "to": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", "value": "0x0", "data": "0xa9059cbb000000000000000000000000fc43f5f9dd45258b3aff31bdbe6561d97e8b71de00000000000000000000000000000000000000000000000000000000000f4240" } Alchemy's simulation API method called [`alchemy_simulateAssetChanges`](https://www.alchemy.com/docs/reference/alchemy-simulateassetchanges) accept this transaction object as input to simulate the given transaction and measure its impact before it's executed on-chain. Simulating a Transaction with Alchemy ------------------------------------- Simulating a transaction using Alchemy's simulation APIs is a straightforward process. It involves sending a transaction object to [`alchemy_simulateAssetChanges`](https://www.alchemy.com/docs/reference/alchemy-simulateassetchanges) API method for the transaction to be simulated. Here's how: json { "jsonrpc": "2.0", "method": "alchemy_simulateAssetChanges", "id": 1, "params": [\ {\ "from": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",\ "to": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",\ "value": "0x0",\ "data": "0x3d7403a30000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000b4e6577206d657373616765000000000000000000000000000000000000000000"\ }\ ] } When you send this request, it will provide a simulation of the transaction, showing you the result without affecting the actual Ethereum network. For example: json { "jsonrpc": "2.0", "id": 1, "result": { "changes": [\ {\ "assetType": "ERC20",\ "changeType": "TRANSFER",\ "from": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045",\ "to": "0xfc43f5f9dd45258b3aff31bdbe6561d97e8b71de",\ "rawAmount": "1000000",\ "contractAddress": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",\ "tokenId": null,\ "decimals": 6,\ "symbol": "USDC",\ "name": "USD Coin",\ "logo": "https://alchemyapi-res.cloudinary.com/image/upload/v1764179958/docs/api-reference/alchemy-transact/transaction-simulation/3408.png",\ "amount": "1"\ }\ ], "gasUsed": "0xbd81", "error": null } } Here the result is telling us that the transaction is an ERC20 transfer, it's transferring 1 USDC from the `from` address to the `to` address. It is also giving us some additional information about the transfer like the gas used for transaction and decimals, symbol, name, logo link of the ERC20 token being transferred. Conclusion ---------- That's all there is to it! By simply sending a transaction object to [`alchemy_simulateAssetChanges`](https://www.alchemy.com/docs/reference/alchemy-simulateassetchanges) API method, you can simulate the given transaction on the Ethereum network without executing it. Alchemy's simulation APIs are a powerful tool to understand and predict the impact of your transactions, helping you build safer and more efficient decentralized applications. Was this page helpful? YesNo --- # How To Use JWTs For API Requests | Alchemy Docs Copy page How To Use JWTs For API Requests ================================ Learn how to use JWTs ( JSON Web Tokens ) for making secure API requests with Alchemy. Introduction ------------ Welcome to this comprehensive guide on how to use JSON Web Tokens (JWTs) for API requests. JWTs can be used as a secure and flexible method for authorizing API requests, and they offer a range of features that make them ideal for this purpose. In this guide we will walk you through what JWTs are, why you should use them, and how to generate and use JWTs for making API requests. * * * What are JWTs ------------- JWTs, or JSON Web Tokens, are a means of representing claims to be transferred between two parties. In simpler terms, they are a way for encoding information in a JSON format and upholding its integrity and authenticity through a digital signature. JWTs consist of three parts: a header, a payload, and a signature ( `header.payload.signature` ). The header and payload are `Base64Url` encoded JSON strings, and they're separated by a period (.). The signature is generated by hashing the header and payload using a private key. This signature is verified with the associated public key. Here's why JWTs are a great choice for making API requests: 1. **Security:** The signature in the JWT ensures that the token hasn't been tampered with during transit. When a server receives a JWT, it can verify the signature to ensure the token integrity and verify its signer. 2. **Self-contained:** JWTs can contain all the necessary information in themselves. They can carry all the necessary data like the permissions and authorizations granted to the token, the time when the token was created, the expiry date and time and other details. 3. **Compact:** Due to their compact size, JWTs can be sent through an HTTP header. Furthermore, the small size means less processing load on the server. 4. **Flexibility:** JWTs can be configured with expiration times, allowing for short lived tokens that get rotated regularly. This reduces the time valid tokens are exposed for before they get invalidated. To learn more about JWTs and how they work, you can visit [jwt.io](https://jwt.io/) . * * * How do JWTs Work with Alchemy? ------------------------------ If you've previously used Alchemy, you are probably in the habit of using API keys. However, with JSON Web Tokens (JWTs) the process changes slightly, providing you with more control and flexibility. In this setup, you generate your own JWTs which act as your API keys. To do this, you will need to run your own backend server. The server will be responsible for generating and signing JWTs using your private key pair. Don't worry if this sounds complicated, we will guide you step-by-step through the process in the upcoming sections. One key difference to remember when using JWTs with Alchemy: while API keys can be used either as a path parameter in the URL or [in the HTTP request header](https://www.alchemy.com/docs/how-to-use-api-keys-in-http-headers) , JWTs can only be used in the HTTP request header. This is a measure for enhanced security. In the next sections we'll provide detailed instructions on setting up your server, generating JWTs, and making API requests to Alchemy using JWTs. * * * Setting up the Project ---------------------- Before we proceed with generating JWTs, we need to set up a basic Node.js project where we can write and execute our code. Here's how to do it: 1. **Install Node.js**: If you haven't installed Node.js on your system, you can download and install it from the official [Node.js website](https://nodejs.org/en) . 2. **Create a new project**: Create a new directory for your project and initialize the project by running the following commands in your terminal: bash mkdir alchemy-tutorial cd alchemy-tutorial npm init -y These commands will initialize a Node.js project and create a `package.json` file with default values. 3. **Install necessary libraries**: To work with JWTs and to make API requests using them, you need the `jsonwebtoken` and `axios` JS libraries installed in your project. Install them using the command below: bash npm install axios jsonwebtoken You've now set up a simple Node.js project with the necessary dependencies installed. You're ready to start writing your code. * * * Generating a Public / Private Key Pair -------------------------------------- The first step is to generate a public/private key pair. The public key will be uploaded to Alchemy dashboard, and the private key will be used to sign our JWTs. We will use the Node.js built-in `crypto` module to generate the key pair. Create a new file called `generateKeyPair.js` and add the following code: generateKeyPair.js // Import the built-in crypto module for generating keys const crypto = require('crypto'); // Import the built-in fs module for writing keys to files const fs = require('fs'); // Define a function to generate the key pair function generateKeyPair() { // Generate a new key pair using RSA algorithm with a modulus length of 2048 bits ( size of the key ) // RSA is related to the RS256, RS384, RS512 algorithms. We support the following algorithms: RS256, RS384, RS512, ECDSA256, ECDSA384, ECDSA512. const { publicKey, privateKey } = crypto.generateKeyPairSync('rsa', { modulusLength: 2048, }); // Write the private key to a file named 'private_key.pem' // The export function exports the key in the specified format (in this case, PKCS #1) // PKCS#1 is a standard format that represents an RSA private key. It is widely used and compatible with many libraries and services. fs.writeFileSync('private_key.pem', privateKey.export({ type: 'pkcs1', format: 'pem' })); // Write the public key to a file named 'public_key.pem' // The export function exports the key in the specified format (in this case, SPKI) // We require the public key in 'spki' (Subject Public Key Info) format, as it's a standard format that // includes the algorithm identifier along with the key data , which is important for properly reading and using the key. fs.writeFileSync('public_key.pem', publicKey.export({ type: 'spki', format: 'pem' })); // Log that the key pair was generated and saved to files console.log('Key pair generated and saved to files "private_key.pem" and "public_key.pem".'); } // Execute the function to generate the key pair generateKeyPair(); This script generates an RSA public/private key pair and saves it to the `public_key.pem` and `private_key.pem` files respectively. We are using `.pem` file extension because `.pem` files are used to store cryptographic keys. Please note that generated public key must be in the `spki` format as shown above. To run this script, navigate to the directory containing the script in your terminal and run the command: terminal node generateKeyPair.js * * * Setting up the Public Key in Alchemy Dashboard ---------------------------------------------- The next step is to upload your public key onto the Alchemy dashboard. This is required because when you generate a new JWT (JSON Web Token) using your private key and then use it to make API requests, Alchemy will have the ability to confirm that the token was actually created by you. This confirmation is made by comparing your private key signature (used to generate the token) with the public key you've uploaded. Follow the steps listed below to set up your public key: 1. Navigate to your [Alchemy Dashboard apps page](https://dashboard.alchemy.com/apps?utm_source=docs&utm_medium=referral&utm_content=how-to-use-jwts-for-api-requests) to view all your apps. ![](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764180224%2Fdocs%2Ftutorials%2Fgetting-started%2Fapi-security-and-authentication%2Fapps.webp&w=3840&q=75) 2. Select the app for which you want to create JWT keys. This should be the app on the network where you will be making the API requests using the JWT token. ![](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764180225%2Fdocs%2Ftutorials%2Fgetting-started%2Fapi-security-and-authentication%2Fselect-app.webp&w=3840&q=75) 3. Once you're in the app page, click on the "Security" option in the left navigation bar. ![](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764180225%2Fdocs%2Ftutorials%2Fgetting-started%2Fapi-security-and-authentication%2Fsecurity.webp&w=3840&q=75) 4. Click "Import Public Key" and fill out the information about your public key: ![](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764180226%2Fdocs%2Ftutorials%2Fgetting-started%2Fapi-security-and-authentication%2Fjwt.webp&w=3840&q=75) * **Name**: Choose a name for your public key. * **Public Key**: Navigate to `public_key.pem` file in your project that contains the generated public key. Copy the contents of the file and paste in this field. Make sure there are no spaces or new line characters at the end. * **Test JWT ( optional )**: You can also generate a JWT and add it in this field to verify your public key. We will show you how to generate a JWT token in the next section so for now you can leave this field blank and hit the "create" button. Once your public key is set up you should see a "Key Id" for your public key. Take note of this key id as we will require this in the next section. ![](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764180227%2Fdocs%2Ftutorials%2Fgetting-started%2Fapi-security-and-authentication%2F62ce39e-image.png&w=3840&q=75) * * * Generating the JWT ------------------ After setting up the public key in your Alchemy dashboard you can start generating JWTs with your private key. For this, create a new file called `generateJWT.js` and add the following code to it: generateJWT.js // Import the built-in fs module for reading the private key from file const fs = require('fs'); // Import the jsonwebtoken library for creating JWTs. const jwt = require('jsonwebtoken'); // Key Id from Alchemy dashboard. const KEY_ID = 'KEY_ID'; // Replace with your own Key Id // Define a function to generate the JWT function generateJWT() { // Read the private key from our 'private_key.pem' file const privateKey = fs.readFileSync('private_key.pem'); // Define the options for signing the JWT // The "algorithm" field specifies the algorithm to use, which is 'RS256' (RSA with SHA-256) // This is one of the algorithms we support (others include RS384, RS512, ECDSA256, ECDSA384, ECDSA512) // The "expiresIn" field specifies when the token will expire, which is '10m' (10 minute) after being issued. // The shorter the expiration time, the more secure the token is. // In the "header" field we can add additional properties. In this case we're adding the "kid" filed which is the key id that is used by Alchemy to decided which public key should be used to verify the given JWT signature. // This should be the key id that you got from Alchemy Dashboard once you set up your key. const signOptions = { algorithm: 'RS256', expiresIn: '10m', header: { kid: KEY_ID, } }; // Sign an empty payload using the private key and the sign options ( empty payload because we are not sending any additional info in the JWT ) // The jwt.sign() function returns the JWT as a string const token = jwt.sign({}, privateKey, signOptions); // Log the newly created JWT console.log(token); } // Execute the function to generate the JWT generateJWT(); Remember to replace `KEY_ID` with the key id from your public key details in Alchemy dashboard. This script generates a new JWT with the expiration time of 10 minute using the `jsonwebtoken` library. The JWT is signed using the private key we generated before and the signing algorithm used is `RS256`. The key id from public key details is also included in the header of JWT, this key id is used by Alchemy to decide which public key should be used to verify the JWT signature, since you can set up multiple public keys in your account. Please note, while we are using `RS256` algorithm to sign JWT in the script given above, Alchemy supports all of the following signing algorithms: `RS256`, `RS384`, `RS512`, `ECDSA256`, `ECDSA384` and `ECDSA512`. In the previous step ( while setting up your public key in the Alchemy dashboard ) if you wanted to add a test JWT to verify your public key, you could have generated a JWT in the same way as defined above. Only thing you need to change in that case is to remove the header containing key id from signing options as we are explicitly providing the public key so a key id is not required to identify the public key. Additionally, you will not even have a key id at that point because it is created when you set up the public key. Run this script using the following command: terminal node generateJWT.js This will create a new JWT with the expiration period of 10 minute and log it to console. It should look something like this: terminal eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c You can then use this JWT to make API requests by including it in the request header. An example of this is given in the next section. * * * Testing the JWT ( Optional ) ---------------------------- Now that we have generated a JWT, we can test it to verify the app that this token is valid for. To do this, navigate to your "[Alchemy Dashboard](https://dashboard.alchemy.com/signup?utm_source=docs&utm_medium=referral&utm_content=how-to-use-jwts-for-api-requests) " → "[JWT Public Keys](https://dashboard.alchemy.com/signup?utm_source=docs&utm_medium=referral&utm_content=how-to-use-jwts-for-api-requests) " and paste the token in the "Test JWT" section, then press "Test JWT". ![](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764180227%2Fdocs%2Ftutorials%2Fgetting-started%2Fapi-security-and-authentication%2Ff7670e1-image.png&w=3840&q=75) You will see the name of the app for which this token is valid. This is generally used for debugging your JWTs. In case, you have multiple apps associated with JWTs and you end up mixing your JWTs, you can always check the correct app here. In addition to that, you can also check the validity of JWTs. * * * Making an API Request with JWT ------------------------------ Finally, we are ready to make an API request using the generated JWT. For demo purposes, we will call the `eth_blockNumber` API on Ethereum Sepolia testnet ( the network our associated app is set up on ) using the JWT. Create a new file called `requestData.js` and add the following code: javascript const axios = require('axios'); // Import axios library const JWT = "JWT"; // Replace with your JWT // Set up data object for the request const data = { method: 'eth_blockNumber', // Set request method params: [], // No parameters are required for eth_blockNumber id: 1, jsonrpc: "2.0" } // Set up headers object for the request const headers = { 'Content-Type': 'application/json', // Needed for a JSON-RPC request 'Authorization': `Bearer ${JWT}`, } // Send POST request using axios axios.post('https://eth-sepolia.g.alchemy.com/v2', data, { headers: headers }) .then(response => console.log(response.data.result)) // Log response data .catch(error => console.error(error)); // Log any errors Remember to replace `JWT` with the JWT generated in the previous steps. The script makes a request to the `eth_blockNumber` API method using `axios`. It includes JWT in the `authorization` header of the request to authenticate API calls. Finally it logs the response to console, which is number of the most recently mined block on network, represented as a hexadecimal string. If you find this header-based approach confusing, you can check out our [guide on sending header-based requests](https://www.alchemy.com/docs/how-to-use-api-keys-in-http-headers) that explains the benefits of this approach and how to use it in detail. Finally run the script using the following command: terminal node requestData.js It should log the most recently mined block number ( as a hexadecimal string ) to the console: terminal 0x3d2329 Congratulations! You've successfully tested your scripts. By seeing the correct output in your terminal, you can confirm that your scripts are working as expected. * * * How do I avoid JWTs interfering with users experience connecting via Wallet Connect? ------------------------------------------------------------------------------------ When the remaining time in the old JWT is no longer sufficient for UX reasons, create and rotate in a new JWT. Conclusion ---------- In this guide we walked you through the process of creating a public/private key pair, setting up the public key in Alchemy dashboard and generating JWTs to be used for API requests. JWTs provide additional security and flexibility options like expiration periods and the ability to create unlimited of them. This method requires a bit more work on your side but can be worth it if you need enhanced security. Was this page helpful? YesNo --- # How To Make HTTP Header-Based API Requests | Alchemy Docs Copy page How To Make HTTP Header-Based API Requests ========================================== Learn how to use your Alchemy API keys in HTTP headers for enhanced security when calling blockchain APIs Introduction ------------ When working with RPC providers, including API keys directly in the request URL is a common practice but this is a security risk as the keys are exposed in server logs, browser history, and cached data. This goes against the best practice of putting API keys in the request `Authorization` header where they can be properly secured and omitted from logs. In line with this best practice, we expanded our API key handling methods to accept API keys in request `Authorization` header, while still maintaining compatibility with the URL method. In this guide we'll discuss why this update was needed, its security benefits, and provide a detailed walkthrough on how to use your Alchemy API keys in HTTP headers for blockchain API requests. ![](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764180211%2Fdocs%2Ftutorials%2Fgetting-started%2Fapi-security-and-authentication%2F03e9567-image.png&w=3840&q=75) * * * Why HTTP Header Based Requests? ------------------------------- HTTP requests consist of three parts: a request line, headers, and optionally a body. The request line specifies the method of the request (GET, POST, etc.), the request URI, and the HTTP version. Headers carry additional information like content type and authorization details. The body, which is optional and mostly used with methods like POST and PUT, contains the data that is intended to be sent. In a URL-based request approach, data like an API key is sent as a part of the URL itself. An example of this is the given request url: text https://eth-mainnet.g.alchemy.com/v2/your_api_key However, this approach can expose your API key to risks, such as being logged in server logs, appearing in browser history, or accidentally being exposed through sharing of URLs. HTTP header-based requests send the API key or Access key in HTTP `Authorization` header rather than in the URL. This method is generally safer because the header information isn't exposed in browser history or server logs by default. In the next two sections we will show you how you can get an Alchemy API key and setup a project to make header based requests. If you already have a project setup and an Alchemy API key, please skip to the [Implementation](https://www.alchemy.com/docs/how-to-use-api-keys-in-http-headers#making-the-api-requests) section. You can make requests using either an Alchemy API Key or an Access Key in the Auth header. However, in this tutorial we will use API Key for simplicity. Check out the guide on [creating Access Keys](https://www.alchemy.com/docs/how-to-create-access-keys) ! * * * Getting Your API Key -------------------- The first step to using HTTP header-based requests with Alchemy is to get your API key. Here's how to do it: 1. Navigate to your Alchemy dashboard and click on the "Apps" tab. ![](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764180212%2Fdocs%2Ftutorials%2Fgetting-started%2Fapi-security-and-authentication%2F4b53077-image.png&w=3840&q=75) 2. Grab the API from one of the existing apps by clicking the "API key" button or create a new app for your brand new project by clicking the "Create new app" button on the top-right. ![](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764180214%2Fdocs%2Ftutorials%2Fgetting-started%2Fapi-security-and-authentication%2F1a652f4-image.png&w=3840&q=75) 3. Fill out the details for your new app, this includes the app name, description ( optional ) and network. The network will be the network on which you want to make the requests. ![](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764180215%2Fdocs%2Ftutorials%2Fgetting-started%2Fapi-security-and-authentication%2F6f2c7af-image.png&w=3840&q=75) 4. Once the app is created, click on the "API key" button to get your API key for the given app. And that's it! You should now have an API key that you can use in your project. ![](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764180221%2Fdocs%2Ftutorials%2Fgetting-started%2Fapi-security-and-authentication%2Fd473044-image.png&w=3840&q=75) * * * Setting up the Project ---------------------- Before we proceed with making HTTP header-based requests using the API key, we need to set up a basic Node.js project where we can write and execute our code. Here's how you can do it: 1. **Install Node.js**: If you haven't installed Node.js on your system, you can download and install it from the official [Node.js website](https://nodejs.org/en) . 2. **Create a new project**: Create a new directory for your project and initialize the project by running the following commands in your terminal: bash mkdir alchemy-tutorial cd alchemy-tutorial npm init -y These commands will initialize a Node.js project and create a `package.json` file with default values. 3. **Install necessary libraries**: To work with our HTTP header-based requests, we need a library to make those requests. In this tutorial we will show you how you can make requests using the two most popular libraries namely: axios and ethers.js. So install these libraries by running the command below: bash npm install axios ethers This command adds Axios and Ethers.js to your project and updates the `package.json` file to include these dependencies. You'll see how we use these libraries in the next section. 4. **Create a new file for your code**: You can now create new JavaScript files in your project directory which will hold the actual code for making these requests. Create two new files called: `axiosScript.js` and `ethersScript.js` ( or just a single file for the library you're interested in ). You've now set up a simple Node.js project with the necessary dependencies installed. You're ready to start writing your code. Please note that while we're using a basic Node.js project here for demonstration purposes, you can certainly use this approach in other types of projects, such as those built with Next.js, React, etc. The method of making HTTP header-based requests using the API key remains the same; the project setup and configuration will differ based on the framework or library you're using. * * * Making the API Requests ----------------------- With your API key at hand and the project set up, you can now start making HTTP header-based requests. To demonstrate the process, we'll use two major JavaScript libraries: Axios and Ethers.js. We'll make requests to the [`eth_getBalance`](https://www.alchemy.com/docs/reference/eth-getbalance) method (JSON-RPC API) and [getNFTsForOwner](https://www.alchemy.com/docs/reference/nft-api-endpoints/nft-api-endpoints/nft-ownership-endpoints/get-nf-ts-for-owner-v-3) NFT API method (Enhanced API) for showcasing. ### Using Axios (JSON-RPC API) Axios is a widely adopted JavaScript library for HTTP requests. Below is how you would use your Alchemy API key/Access Key in an HTTP header with Axios: javascript const axios = require('axios'); // Import axios library // Set up data object for the request const data = { method: 'eth_getBalance', // Set request method params: ['0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045'], // Insert the EVM address id: 1, jsonrpc: "2.0" } // Set up headers object for the request const headers = { 'Authorization': `Bearer YOUR_API_KEY`, // Insert API key/Access Key in Authorization header } // Send POST request using axios to base request url ( you can get the base request url from your Alchemy dashboard ) axios.post('https://eth-mainnet.g.alchemy.com/v2', data, { headers: headers }) .then(response => console.log(response.data.result)) // Log response data .catch(error => console.error(error)); // Log any errors Add the code given above to your `axiosScript.js` file and remember to replace `YOUR_API_KEY` with your actual Alchemy API key and `'0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045'` with the EVM address whose balance you want to check. This code: * Imports the Axios library. * Sets up a data object containing the JSON-RPC method to call and its params. * Creates a header object containing the authorization header for the request. This also includes the API key. This is used for authenticating the request. * Finally it sends the request through axios using the Alchemy base request url and the two objects ( header and data ) defined before. The base request url should correspond to the network you're making requests on. You can get this url from your app details in the Alchemy dashboard as shown below: ![](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764180222%2Fdocs%2Ftutorials%2Fgetting-started%2Fapi-security-and-authentication%2Ffc9cad8-image.png&w=3840&q=75) * If it's a successful response the result is logged to the console, if not, the errors are logged. ### Using Axios (Enhanced API) Similarly for Enhanced APIs like NFT API, you can include the API Key/Access Key in the header and omit the `apiKey` from path: ![](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764180223%2Fdocs%2Ftutorials%2Fgetting-started%2Fapi-security-and-authentication%2F011be99-image.png&w=3840&q=75) Here's the code demonstrating this: javascript const axios = require("axios"); // Import axios library // Set up headers object for the request const headers = { Authorization: `Bearer YOUR_API_KEY`, // Insert API key/Access Key in Authorization header }; // Send GET request using axios to the request URL omitting api key from it axios .get( "https://eth-mainnet.g.alchemy.com/nft/v3/getNFTsForOwner?owner=0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045&withMetadata=true&pageSize=1", { headers: headers } ) .then((response) => console.log(response.data)) // Log response data .catch((error) => console.error(error)); // Log any errors We can make the same request using cURL as following: shell curl --location 'https://eth-mainnet.g.alchemy.com/nft/v3/getNFTsForOwner?owner=0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045' \ --header 'Authorization: Bearer YOUR_API_KEY' Again, it's following the same principle of removing API Key/Access Key from path and including it in Auth header. ### Using Ethers.js Ethers.js is a commonly used JavaScript library in blockchain development. Here's how to use your Alchemy API key in an HTTP header with Ethers.js: javascript // Import the FetchRequest class from ethers const { FetchRequest } = require('ethers'); // Define an asynchronous function to get the balance of EVM address async function getBalance() { // The base request URL ( you can get this from your app details in Alchemy dashboard ) const url = 'https://eth-mainnet.g.alchemy.com/v2'; // The EVM address that we want to get the balance of const address = '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045'; // Replace with the address you're interested in // Alchemy API Key const apiKey = 'YOUR_API_KEY'; // Replace with your actual API key // Create a new FetchRequest instance with the specified URL let req = new FetchRequest(url); // Set the Content-Type header to 'application/json' req.setHeader('Content-Type', 'application/json'); // Set the Authorization header with the API key req.setHeader('Authorization', `Bearer ${apiKey}`); // Set the request body with a JSON string containing the JSON-RPC request req.body = JSON.stringify({ jsonrpc: '2.0', id: 1, method: 'eth_getBalance', params: [address] }); // Set the HTTP method to POST req.method = 'POST'; // Send the request and wait for the response let resp = await req.send(); // Parse the response body as JSON and extract the result field let result = JSON.parse(resp.bodyText).result; // Log the result to the console console.log(result); } // Call the getBalance function and log any errors to the console getBalance().catch(console.error); Add the code given above to your `ethersScript.js` file and remember to replace `YOUR_API_KEY` with your actual Alchemy API key and `'0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045'` with the EVM address whose balance you want to check. This code: * Imports the `FetchRequest` class from the Ethers library that can be used for making custom HTTP requests. * Defines an asynchronous function `getBalance` to handle the entire process of fetching balance. * Specifies the base request URL, the EVM address whose balance needs to be fetched, and the Alchemy API key. The base request URL should correspond to the network you're making the requests on. You can get it from your app details in the Alchemy dashboard as shown below: ![](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764180224%2Fdocs%2Ftutorials%2Fgetting-started%2Fapi-security-and-authentication%2F261c5f7-image.png&w=3840&q=75) * Creates a new `FetchRequest` instance using the base request URL. * Sets the 'Content-Type' header of the request to 'application/json' using the `setHeader` method. * Sets the 'Authorization' header of the request to include the API key using the `setHeader` method. * Specifies the body of the request with a stringified JSON object representing the JSON-RPC request for `eth_getBalance` method. * Sets the HTTP method of the request to `'POST'`. * Sends the request to the Alchemy endpoint using the `send` method and waits for the response. * Parses the response body as a JSON object using `JSON.parse`, and retrieves the `result` field from the parsed object, which contains the hex formatted balance of the EVM address in Wei. * Logs the result (the balance) to the console. * Executes the `getBalance` function and provides error handling. If an error occurs during execution, it's caught and logged to the console. Conclusion ---------- In this guide you learned how to make HTTP header-based API requests. We recommend moving your Alchemy API keys from the URL to HTTP headers as it enhances the security of your projects. With our support for header-based requests, this transition is seamless and easy. If you have any questions or feedback, please contact us at [\[email protected\]](https://www.alchemy.com/cdn-cgi/l/email-protection#6a191f1a1a05181e2a0b0609020f071344090507) or open a ticket in the dashboard. Was this page helpful? YesNo --- # How to Send Transactions on Ethereum | Alchemy Docs Copy page How to Send Transactions on Ethereum ==================================== This is a beginner's guide for sending Ethereum transactions in web3. There are three main steps in order to send a transaction to the Ethereum blockchain: create, sign, and broadcast. We'll go through all three, hopefully answering any questions you might have! In this tutorial, we'll be using [Alchemy](https://dashboard.alchemy.com/signup?utm_source=docs&utm_medium=referral&utm_content=how-to-send-transactions-on-ethereum) to send our transactions to the Ethereum chain. You can [create a free Alchemy account here.](https://alchemy.com/?r=affiliate:9efcc9a2-ef89-4a2b-a5f3-1dd52ad32c4c) This guide is for signing your transactions on the _backend_ for your app, if you want to integrate signing your transactions on the frontend, you'll need to integrate a [browser provider with Web3](https://www.alchemy.com/docs/how-to-send-transactions-on-ethereum#with-a-browser-provider) . The Basics ---------- Like most blockchain developers when they first start, you might have done some research on how to send a transaction (something that should be pretty simple) and ran into a plethora of guides, each saying different things and leaving you a bit overwhelmed and confused. If you're in that boat, don't worry; we all were at some point! So, before we start, let's get a few things straight: ### 1\. Alchemy does not store your private keys * This means that Alchemy's servers cannot sign and send transactions on your behalf. The reason for this is security purposes. Alchemy will never ask you to share your private key, and you should never share your private key with a hosted node (or anyone for that matter). * However, you can use modern Web3 libraries like Viem or Ethers.js to sign your transactions. These wallets exist only on your machine running the code, and cannot share your private key with anyone else. * You can read from the blockchain using Alchemy's RPC API, but to write to it you'll need to use Web3 libraries or an external wallet to sign your transactions before sending them through Alchemy. ### 2\. What is a "signer"? * Signers will sign transactions for you using your private key. In this tutorial, we'll be using Viem and Ethers.js to sign our transaction, but you could also use any other web3 library. * In the frontend, an excellent example of a signer would be [Metamask](https://metamask.io/) , which will sign and send transactions on your behalf. ### 3\. Why do I need to sign my transactions? * Every user that wants to send a transaction on the Ethereum network must sign the transaction first in order to validate that the origin of the transaction is who it claims to be. * It is super important to protect this private key, since having access to it grants full control over your Ethereum account, allowing you (or anyone with access) to perform transactions on your behalf. ### 4\. How do I protect my private key? * There are many ways to protect your private key and to use it to send off transactions. In this tutorial, we will be using a `.env` file. However, you could also use a separate provider that stores private keys, use a Keystore file, or other options. ### 5\. What is the web3 library? * Modern Web3 libraries like Viem and Ethers.js are wrapper libraries around the standard JSON-RPC calls that are quite common to use in Ethereum development. * There are many different web3 libraries for different languages. In this tutorial, we'll use Viem and Ethers.js which are written in JavaScript. Okay, now that we have a few of these questions out of the way, let's move onto the tutorial. Feel free to contact us at [\[email protected\]](https://www.alchemy.com/cdn-cgi/l/email-protection#daa9afaaaab5a8ae9abbb6b9b2bfb7a3f4b9b5b7) or open a ticket in the dashboard. This guide assumes you have an Alchemy account, an Ethereum address or Metamask wallet, Node.js, and npm installed. If not, follow these steps: Steps to Sending Your Transaction --------------------------------- ### 1\. Create an Alchemy app on the Sepolia testnet Navigate to your [Alchemy Dashboard](https://dashboard.alchemy.com/?utm_source=docs&utm_medium=referral&utm_content=how-to-send-transactions-on-ethereum) and create a new app, choosing Sepolia for your network. (In practice, you could use any testnet of your choice, but for this guide, we're sticking to Sepolia.) Use [Sepolia testnet](https://www.alchemy.com/overviews/sepolia-testnet) for testing. The Ethereum Foundation has deprecated Goerli, Ropsten, Rinkeby, and Kovan testnets. Get free testnet ETH from the [Alchemy Sepolia faucet](https://www.alchemy.com/faucets/ethereum-sepolia) . ### 2\. Request Eth from the [Alchemy Sepolia faucet](https://www.alchemy.com/faucets/ethereum-sepolia) Follow the instructions on the faucet homepage to receive Eth. Make sure to include your **Sepolia** Ethereum address (from Metamask) and not another network. After following the instructions, double-check that you've received the Eth in your wallet. ### 3\. Create a new project directory and `cd` into it Create a new project directory from the [command line](https://www.computerhope.com/jargon/c/commandi.htm) (terminal for macs) and navigate into it: shell mkdir sendtx-example cd sendtx-example ### 4\. Install Viem/Ethers.js and dotenv Run the following command in your project directory: shell npm init --yes npm install viem ethers dotenv ### 5\. Create the .env file We'll use a `.env` file to safely store our API key and private key. We make a .env file to securely store private environmental variables in our local machine that we may access from other files (some of which we can make public). If you want to check out how `dotenv` actually works in the context of a conventional NodeJS server file, check out this helpful [video](https://www.youtube.com/watch?v=5WFyhsnU4Ik) ! Create a .env file (make sure the file is literally just named `.env`, nothing more) in your project directory and add the following (replacing `your-api-key` and `your-private-key`, keeping both within the quotation marks): * To find your Alchemy API Key, navigate to the app details page of the app you just created on your Alchemy dashboard, click "View Key" in the top right corner, and grab the Api Key. * To find your private key using Metamask, check out this [guide](https://metamask.zendesk.com/hc/en-us/articles/360015289632-How-to-Export-an-Account-Private-Key) . .env API_KEY = "your-api-key" PRIVATE_KEY = "your-private-key" ### 6\. Create `sendTx.js` file Great, now that we have our sensitive data protected in a `.env` file, let's start coding. For our send transaction example, we'll be sending Eth back to the Sepolia faucet. Create a `sendTx.js` file, which is where we will configure and send our example transaction, and add the following lines of code to it: Viem Ethers.js import { createWalletClient, createPublicClient, http, parseEther, parseGwei } from 'viem' import { privateKeyToAccount } from 'viem/accounts' import { sepolia } from 'viem/chains' import dotenv from 'dotenv' dotenv.config() const { API_KEY, PRIVATE_KEY } = process.env const account = privateKeyToAccount(`0x${PRIVATE_KEY}`) const walletClient = createWalletClient({ account, chain: sepolia, transport: http(`https://eth-sepolia.g.alchemy.com/v2/${API_KEY}`) }) const publicClient = createPublicClient({ chain: sepolia, transport: http(`https://eth-sepolia.g.alchemy.com/v2/${API_KEY}`) }) async function main() { const hash = await walletClient.sendTransaction({ to: "0xa238b6008Bc2FBd9E386A5d4784511980cE504Cd", value: parseEther("0.001"), gas: 21000n, maxPriorityFeePerGas: parseGwei("5"), maxFeePerGas: parseGwei("20") }) console.log("Sent transaction", hash) // Wait for confirmation const receipt = await publicClient.waitForTransactionReceipt({ hash }) console.log("Transaction confirmed", receipt) } main() Now, before we jump into running this code, let's talk about some of the components here. * **Wallet/Account**: This object stores your private key, and can be used to sign transactions. In Viem, we create an account from a private key. In Ethers.js, we create a Wallet instance. * **Clients**: Viem uses separate clients for wallet operations (sending transactions) and public operations (reading blockchain data). Ethers.js combines these in the provider and wallet objects. * **Transaction**: The transaction object has a few aspects we need to specify: * `to`: This is the address we want to send Eth to. In this case, we are sending Eth back to the [Sepolia faucet](https://sepoliafaucet.com/) we initially requested from. * `gas`/`gasLimit`: This is the maximum amount of gas you are willing to consume on a transaction. Standard limit is 21000 units. * `value`: This is the amount we wish to send, specified in wei where 10^18 wei = 1 ETH * `maxFeePerGas`: This is the total amount you are willing to pay per gas for the transaction to execute. Since EIP 1559, this field or the `maxPriorityFeePerGas` field is required. * `nonce`: Automatically handled by the libraries but can be manually specified if needed. * \[OPTIONAL\] `data`: Used for sending additional information with your transfer, or calling a smart contract, not required for balance transfers. * **Transaction Signing and Sending**: Both libraries handle signing and sending automatically when using `sendTransaction`. The libraries automatically calculate the nonce and handle EIP-1559 fee structures. * `sendTransaction`: Once we have a signed transaction, we can send it off to be included in a subsequent block by using `sendTransaction` There are two main types of transactions that can be sent in Ethereum. ### 7\. Run the code using `node sendTx.js` Navigate back to your terminal or command line and run: shell node sendTx.js ### 8\. See your transaction in the Mempool Open up the [Mempool page](https://dashboard.alchemy.com/mempool?utm_source=docs&utm_medium=referral&utm_content=how-to-send-transactions-on-ethereum) in your Alchemy dashboard and filter by the app you created to find your transaction. This is where we can watch our transaction transition from pending state to mined state (if successful) or dropped state if unsuccessful. Make sure to keep it on "All" so that you capture "mined", "pending", and "dropped" transactions. You can also search for your transaction by looking for transactions sent to address `0x31b98d14007bdee637298086988a0bbd31184523` To view the details of your transaction once you've found it, select the tx hash, which should take you to a view that looks like this: ![2504](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764192918%2Fdocs%2Ftutorials%2Ftransactions%2Fsending-transactions%2F6edf8ed-Mempool.png&w=3840&q=75 "Mempool.png") View your transaction on the Alchemy Mempool Watcher From there you can view your transaction on Etherscan by clicking on the icon circled in red! ### Yippieeee! You just sent your first Ethereum transaction using Alchemy 🎉 Once you complete this tutorial, let us know how your experience was or if you have any feedback by tagging us on Twitter [@Alchemy](https://twitter.com/Alchemy) ! If you have any questions or feedback, please contact us at [\[email protected\]](https://www.alchemy.com/cdn-cgi/l/email-protection#ea999f9a9a85989eaa8b8689828f8793c4898587) or open a ticket in the dashboard. \_Not sure what to do next? As a final test of your skills, get your hands dirty with some solidity programming by implementing our [Hello World Smart Contract](https://www.alchemy.com/docs/hello-world-smart-contract) tutorial. Was this page helpful? YesNo --- # How to Get On-chain Events on Ethereum | Alchemy Docs Copy page How to Get On-chain Events on Ethereum ====================================== Learn how to use the eth\_getLogs method to query blockchain events Learn how to use the `eth_getLogs` method to query blockchain events Introduction ============ The ability to understand when and what events happened on a blockchain is a core part of web3 or decentralized applications. These events can trigger updates or notifications within the application that are then communicated to users. The Ethereum Virtual Machine (EVM) keeps an event log on the transactions of every block to allow users to easily access data about these events from outside of the blockchain. The [`eth_getLogs`](https://www.alchemy.com/docs/reference/eth-getlogs) JSON-RPC method is used to read and understand these logs. To know more about `eth_getLogs` and logs in general, check out: [Understanding Logs: Deep Dive into eth\_getLogs](https://www.alchemy.com/docs/deep-dive-into-eth_getlogs) Parameters ========== The [`eth_getLogs`](https://www.alchemy.com/docs/reference/eth-getlogs) method takes in an object as a parameter that has the following optional filter properties: * `fromBlock`: `QUANTITY | TAG` - (optional, default: `latest`) Integer block number encoded as hexadecimal, or `latest` for the last mined block or `pending`, `earliest` for not yet mined transactions. * `toBlock`: `QUANTITY | TAG` - (optional, default: "`latest`) Integer block number encoded as hexadecimal, or `latest` for the last mined block or `pending`, `earliest` for not yet mined transactions. * `address`: `DATA | Array` - (optional) Contract address or a list of addresses from which logs should originate. * `topics`: `Array of DATA` - (optional) Array of 32 Bytes DATA topics. If you want to query logs for a specific event then the first element of the `topics` array is the keccak256 hash of the event signature and the following three elements are hashes of indexed log arguments. Learn more about the event signature and the `topics` property [here](https://www.alchemy.com/docs/deep-dive-into-eth_getlogs#eth_getlogs-example) . * `blockhash`: `DATA, 32 Bytes` - (optional, future) With the addition of EIP-234, blockHash will be a new filter option which restricts the logs returned to the single block with the 32-byte hash blockHash. Using blockHash is equivalent to `fromBlock = toBlock = the block number with hash blockHash`. If blockHash is present in the filter criteria, then neither fromBlock nor toBlock are allowed. Response ======== The `eth_getLogs` method returns an array of log objects with the following properties: * `removed` - Boolean `true` if log was removed, due to a chain reorganization. `false` if it's a valid log. * `logindex` - Integer of log index position in the block encoded as hexadecimal. null if pending. * `transactionindex` - Integer of transactions index position log was created from. null if pending. * `transactionhash` - Hash of the transactions this log was created from. null if pending. * `blockhash` - Hash of the block where this log was in. null if pending. * `blocknumber` - The block number where this log was, encoded as hexadecimal. null if pending. * `address` - The address from which this log originated. * `data` - Contains one or more 32 Bytes non-indexed arguments of the log. Learn more about it [here](https://www.alchemy.com/docs/deep-dive-into-eth_getlogs#deciphering-the-response) . * `topics` - Array of 0 to 4 32 Bytes of indexed log arguments. Querying Events =============== To understand how to query events, we're going to look at an example: getting [`transfer`](https://www.alchemy.com/docs/deep-dive-into-eth_getlogs#what-are-transfers) events on an ERC20 token contract. The `Transfer` event is emitted when the `transfer` function on the ERC20 contract is executed. Step 1: Install Node and NPM ---------------------------- In case you haven't already, [install node and npm](https://nodejs.org/en/download/) on your local machine. Make sure that node is at least **v14 or higher** by typing the following in your terminal: shell node -v Step 2: Create an Alchemy app ----------------------------- * * * In case you haven't already, [sign up for a free Alchemy account](https://dashboard.alchemy.com/signup?utm_source=docs&utm_medium=referral&utm_content=how-to-get-on-chain-events) . ![2880](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764192918%2Fdocs%2Ftutorials%2Ftransactions%2Funderstanding-transactions%2F06c375a-Screenshot_2022-11-04_at_10.36.40_PM.png&w=3840&q=75 "Screenshot 2022-11-04 at 10.36.40 PM.png") Alchemy's account dashboard where developers can create a new app on the Ethereum blockchain. Next, navigate to the [Alchemy Dashboard](https://dashboard.alchemy.com/signup?utm_source=docs&utm_medium=referral&utm_content=how-to-get-on-chain-events) and create a new app. Make sure you set the chain to Ethereum and the network to Mainnet. Once the app is created, click on your app's _View Key_ button on the dashboard. Take note of the **HTTP URL**. The URL will be in this form: `https://eth-mainnet.g.alchemy.com/v2/xxxxxxxxx` You will need this later. * * * Step 3: Create a node project ----------------------------- Let's now create an empty repository and install all node dependencies. To make requests, we will use modern Web3 libraries like Viem or Ethers.js. Viem Ethers.js mkdir my-project && cd my-project npm init -y npm install --save viem touch main.js This will create a repository named `my-project` that holds all your files and dependencies. Next, open this repo in your favorite code editor. We will be writing all our code in the `main.js` file. Step 4: Get the event logs -------------------------- To get the event logs, we will use the [getLogs](https://www.alchemy.com/docs/reference/sdk-getlogs) method. Which takes in an object as a parameter with the properties defined in [parameters](https://www.alchemy.com/docs/how-to-get-on-chain-events#parameters) . Add the following code to the `main.js` file. Viem Ethers.js import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const apiKey = "<-- ALCHEMY API KEY -->"; const client = createPublicClient({ chain: mainnet, transport: http(`https://eth-mainnet.g.alchemy.com/v2/${apiKey}`) }) const main = async () => { const logs = await client.getLogs({ fromBlock: 0x429d3bn, toBlock: 0x429d3bn, address: "0xb59f67a8bff5d8cd03f6ac17265c550ed8f33907", topics: [\ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",\ "0x00000000000000000000000000b46c2526e227482e2ebb8f4c69e4674d262e75",\ "0x00000000000000000000000054a2d42a40f51259dedd1978f6c118a0f0eff078",\ ], }); console.log(logs); }; const runMain = async () => { try { await main(); process.exit(0); } catch (error) { console.log(error); process.exit(1); } }; runMain(); In our `params` here we have specified the `fromBlock` , `toBlock` , `address`, and `topics`. The `fromBlock` and `toBlock` params specify the start and end block numbers to restrict the search by, these are important to specify so we search over the correct blocks. The `address` field represents the address of the contract emitting the log. `Topics` is an ordered array of data. The first item in the `topics` field is the [_event signature_](https://www.alchemy.com/docs/deep-dive-into-eth_getlogs#what-are-event-signatures) of our `Transfer(address,address,uint256)` event. This means we are specifically querying for a Transfer event between address `0x00b46c2526e227482e2ebb8f4c69e4674d262e75` and `0x0054a2d42a40f51259dedd1978f6c118a0f0eff078` (the second and third elements in topics). To make the request, run the script using the following command or make the request using `cURL`: bash cURL node main.js If all goes well, you should see an output that looks like this: json { "id": 0, "jsonrpc": "2.0", "result": [\ {\ "address": "0xb59f67a8bff5d8cd03f6ac17265c550ed8f33907",\ "blockHash": "0x8243343df08b9751f5ca0c5f8c9c0460d8a9b6351066fae0acbd4d3e776de8bb",\ "blockNumber": "0x429d3b",\ "data": "0x000000000000000000000000000000000000000000000000000000012a05f200",\ "logIndex": "0x56",\ "removed": false,\ "topics": [\ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",\ "0x00000000000000000000000000b46c2526e227482e2ebb8f4c69e4674d262e75",\ "0x00000000000000000000000054a2d42a40f51259dedd1978f6c118a0f0eff078"\ ],\ "transactionHash": "0xab059a62e22e230fe0f56d8555340a29b2e9532360368f810595453f6fdd213b",\ "transactionIndex": "0xac"\ }\ ] } The interesting fields to point out here are the "`data`", and "`topics`". **Topics** The `topics` field can contain up to 4 topics. The first topic is required and will always contain the _keccak 256_ hash of the _**event signature**_. The other three topics are optional and typically used for indexing and provide a faster lookup time than using the **data** field described below. **Data** The data field is an unlimited field for encoding hex data that is relevant to the specific event. By default if information does not get indexed into the remaining topics field, it will automatically go into the data field. This requires more work for parsing out individual information from the hex string rather than having them as separate indexed topics. However since it has no storage limit it's less expensive in regards to the gas cost for storing data like arrays and strings. So how do we figure out what all of this means? We can start by looking at the [ABI reference](https://www.alchemy.com/docs/deep-dive-into-eth_getlogs#what-are-abis) for this specific transfer method: json { "anonymous": false, "inputs": [\ {\ "indexed": true,\ "name": "from",\ "type": "address"\ },\ {\ "indexed": true,\ "name": "to",\ "type": "address"\ },\ {\ "indexed": false,\ "name": "value",\ "type": "uint256"\ }\ ], "name": "Transfer", "type": "event" }, Notice that the "`from`" and "`to`" inputs have `"indexed": true`. This means that these addresses will be stored in the `topics` field rather than the `data` field when the event gets fired off. Remember, the first topic is the event signature for this log which means the other two topics are the `from` and `to` addresses (in that order). However, for the "`value`" input, the `uint256` will instead go into the `data` field since it has `"indexed":false` in the contract ABI. Since we know the `value` is of type `uint256`we can translate the data `0x12a05f200`to `5,000,000,000`. So this transaction reads: transfer `5,000,000,000` from address `0x00b46c2526e227482e2ebb8f4c69e4674d262e75` to address `0x54a2d42a40f51259dedd1978f6c118a0f0eff078`. One thing to note is that the values are always specified in the most basic unit, but each contract has a constant called `decimals` which indicates the conversion from the base unit to the more common unit or token, specifying how much you should divide by to get the actual value. In this case, the `decimals` value is 3 so you divide the given value by 10^3, which makes our true amount `5,000,000`. You can see the decimals value for this contract on [Etherscan](https://etherscan.io/address/0xb59f67a8bff5d8cd03f6ac17265c550ed8f33907#readContract) . And that's how you query event logs from the blockchain! Was this page helpful? YesNo --- # Understanding Logs: Deep Dive into eth_getLogs | Alchemy Docs Copy page Understanding Logs: Deep Dive into eth\_getLogs =============================================== This is a beginner-friendly guide into the commonly used eth\_getLogs JSON-RPC call and understanding logs on Ethereum. It discusses some key topics and goes into the complexities and usage of eth\_getLogs through an example. Understanding Logs: Deep Dive into eth\_getLogs =============================================== This is a beginner-friendly guide into the commonly used eth\_getLogs JSON-RPC call and understanding logs on Ethereum. It discusses some key topics and goes into the complexities and usage of eth\_getLogs through an example. New to `eth_getLogs` or want to learn more information about it? You are in the right place. `eth_getLogs` has many beneficial use cases that developers are often times unaware of. It also has some extreme vulnerabilities that can have huge consequences if you don't use it correctly. This page is a deep dive into the capabilities of `eth_getLogs` to help you improve your usage and understanding of this method! For details about the request/response specifications for `eth_getLogs`, check out our [JSON-RPC reference page](https://www.alchemy.com/docs/reference/eth-getlogs) . The best way to understand logs is through an example, but before we jump into the example there are a few things you need to understand: * [What is `eth_getLogs` Used for?](https://www.alchemy.com/docs/deep-dive-into-eth_getlogs#what-is-eth_getLogs-used-for?) * [What are Logs or Events?](https://www.alchemy.com/docs/deep-dive-into-eth_getlogs#what-are-logs-or-events?) * [What are Transfers?](https://www.alchemy.com/docs/deep-dive-into-eth_getlogs#what-are-transfers) * [Why use logs?](https://www.alchemy.com/docs/deep-dive-into-eth_getlogs#why-use-logs) * [What are ABIs](https://www.alchemy.com/docs/deep-dive-into-eth_getlogs#what-are-abis?) * [What are Event Signatures?](https://www.alchemy.com/docs/deep-dive-into-eth_getlogs#what-are-event-signatures) * * * What is `eth_getLogs` Used for? =============================== `eth_getLogs` allows you to view events that occurred on the blockchain. A core part of Web3 or decentralized applications (dApps) is the ability to understand when and what events happen on a blockchain. These events can trigger updates or notifications within the application that are then communicated to users. To allow users to easily access data about these events from outside of the blockchain, the [Ethereum Virtual Machine (EVM)](https://www.alchemy.com/overviews/what-is-the-ethereum-virtual-machine-evm) keeps an event log on the transactions of every block. To be able to read and understand these logs, we use the `eth_getLogs` JSON-RPC method. * * * What are Logs or Events? ======================== Logs and events are used synonymously—smart contracts generate logs by firing off events, so logs provide insights into events that occur within the smart contract. Logs can be found on transaction receipts. Anytime a transaction is mined, we can see event logs for that transaction by making a request to `eth_getLogs` and then take actions based off those results. For example, if a purchase is being made using crypto payments, we can use `eth_getLogs` to see if the sender successfully made the payment before providing the item purchased. * * * Why use logs? ============= An advantage of using event logs is that they are cheap compared to other functions of the EVM. This information can be read outside applications, and that data can then be used to perform an action, like updating a front-end. * * * What are ABIs? ============== Contract Application Binary Interface (ABI) is the interface that specifies how to interact with a specific Ethereum contract. This includes the method names, parameters, constants, data structures, event types (logs), and everything else you need to know about the contract. ![760](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764192927%2Fdocs%2Ftutorials%2Ftransactions%2Fon-chain-events%2Fce3e0c1-abi.png&w=3840&q=75 "abi.png") Source: [https://static.packt-cdn.com/products/9781789954111/graphics/assets/fe0f2ffc-2f3c-4615-9cb5-43c8e036239b.png](https://static.packt-cdn.com/products/9781789954111/graphics/assets/fe0f2ffc-2f3c-4615-9cb5-43c8e036239b.png) Every contract has an associated ABI, if you use [Truffle](https://www.trufflesuite.com/) to deploy contracts, the ABI is automatically generated for you. You can find the ABI for a specific contract by going to [Etherscan](https://etherscan.io/) and pasting in the `address` field of the contract in the search bar, then clicking on the "contract" tab and scrolling down to "Contract ABI". Here is part of the contract ABI for the contract with address `0xb59f67A8BfF5d8Cd03f6AC17265c550Ed8F33907`, which we will be using in our example. Here we have just included the two `events` listed in this ABI: the `"Transfer"` event, and the `"NewOwner"` event, but you can see the full contract ABI [here](https://etherscan.io/address/0xb59f67a8bff5d8cd03f6ac17265c550ed8f33907#code) . contract { "anonymous": false, "inputs": [\ {\ "indexed": true,\ "name": "from",\ "type": "address"\ },\ {\ "indexed": true,\ "name": "to",\ "type": "address"\ },\ {\ "indexed": false,\ "name": "value",\ "type": "uint256"\ }\ ], "name": "Transfer", "type": "event" }, { "anonymous": false, "inputs": [\ {\ "indexed": true,\ "name": "old",\ "type": "address"\ },\ {\ "indexed": true,\ "name": "current",\ "type": "address"\ }\ ], "name": "NewOwner", "type": "event" } This structure might seem confusing, but they are actually quite simple: * `anonymous` refers to whether or not the event selector is included in the `topic0` of the log. If true, the event is not indexed by its signature, and filtering by name is not possible. Instead, only the contract address can be used for filtering. * `type` specifies what the data type is * In this case, we have two `events` named `"Transfer"` and `"NewOwner"` * We also have two kinds of input types: `"address"` and `"uint256"` * The `name` field is the name of the item or parameter * We will talk about `indexed` further down in the Deciphering the Response section Learn more about Contract ABI Specification in this [solidity guide](https://solidity.readthedocs.io/en/v0.7.0/abi-spec.html) . * * * What are Transfers? =================== _Transfers_ are one of the most common functions on Ethereum contracts. They represent functions that can transfer some asset between two addresses: `Transfer(from, to, value)`. We can see in the ABI snippet above that this contract has a Transfer event defined in its ABI. The `from` and `to` inputs are stored as `addresses`, and the `value` input is stored as a `uint256`. * * * What are Event Signatures? ========================== A contract can contain many different types of events, so the _event signature_ is used to identify what the specific event or log represents. In the example above, this contract contains two types of events: `Transfer` and `NewOwner`. Every event has an associated event signature which can be computed by taking the _keccak 256_ hash of the event _name_ and input argument \_types (\_argument names are ignored). For example, the event signature of this specific Transfer event above is `keccak256(Transfer(address,address,uint256))` , which results in the hash: `0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef` . If you would like to reproduce the hash yourself you can use this [online keccak-256 converter](https://emn178.github.io/online-tools/keccak_256.html) and input "Transfer(address,address,uint256)". Or, convert the string to hexadecimal number and use the [web3\_sha3](https://www.alchemy.com/docs/reference/web3-sha3) JSON-RPC call to get the corresponding hash. For "Transfer(address,address,uint256)", the corresponding hex value is`0x5472616e7366657228616464726573732c616464726573732c75696e7432353629`. * * * `eth_getLogs` Example ===================== Okay, now that we know what ABIs, Transfers, and Event Signatures are, we can get back to talking about logs. We are going to use a specific example focusing on a `Transfer` event in order to understand logs better. Let's say some Contract has a `Transfer(address,address,uint256)`method defined in its ABI. If this `Transfer` method is called on the contract by someone who wants to make a transfer, the contract should emit an `event()/log` that contains information about the transfer. Making a Request to eth\_getLogs -------------------------------- Remember when we mentioned `eth_getLogs` has extreme vulnerabilities? Here's what we mean. When you make a request to `eth_getLogs` , all parameters are _optional_, meaning you don’t actually have to specify `fromBlock`, `toBlock`, `address`, `topics`, or `blockHash` (learn more about each parameter in our [JSON-RPC Reference page](https://www.alchemy.com/docs/reference/eth-getlogs) ). However, if we leave these parameters empty, or specify too large of a range, we can risk trying to query millions of logs, both overloading the node and creating a massive payload that will be extremely difficult to return. This can result in huge consequences if the right safety nets are not put in place. Luckily, Alchemy has systems in place to prevent users from making these extreme requests, but if you are running your own node you might not be so lucky. **Here are the safety nets Alchemy has in place for large** [eth\_getLog](https://www.alchemy.com/docs/reference/eth-getlogs) **requests on Ethereum:** You can make eth\_getLogs requests on any block range with a cap of 10K logs in the response OR a 2K block range with no cap on logs in the response and 150MB limit on the response size If you need to pull logs frequently, we recommend using [WebSockets](https://www.alchemy.com/docs/reference/subscription-api) to push new logs to you when they are available. Let's look at an example of a good request. You can use our [composer feature](https://composer.alchemy.com/) , or use whatever query protocol you find easiest, to make this call to `eth_getLogs`: eth\_getLogs { "jsonrpc": "2.0", "id": 0, "method": "eth_getLogs", "params": [\ {\ "fromBlock": "0x429d3b",\ "toBlock": "0x429d3b",\ "address": "0xb59f67a8bff5d8cd03f6ac17265c550ed8f33907",\ "topics": [\ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",\ "0x00000000000000000000000000b46c2526e227482e2ebb8f4c69e4674d262e75",\ "0x00000000000000000000000054a2d42a40f51259dedd1978f6c118a0f0eff078"\ ]\ }\ ] } In our `params` here we have specified the `fromBlock` , `toBlock` , `address`, and `topics`. The reason why we did not specify the `blockHash` in our `params` is because you can **only** use either `fromBlock` and `toBlock` or `blockHash`, **not both**. Learn more about this specification [here](https://www.alchemy.com/docs/reference/eth-getlogs) . The `fromBlock` and `toBlock` params specify the start and end block numbers to restrict the search by, these are important to specify so we search over the correct blocks. The `address` field represents the address of the contract emitting the log. `Topics` is an ordered array of data. Notice how the first item in the `topics` field above matches the _event signature_ of our `Transfer(address,address,uint256)` event in the previous [section](https://www.alchemy.com/docs/deep-dive-into-eth_getlogs#what-are-event-signatures) . This means we are specifically querying for a Transfer event between address `0x00b46c2526e227482e2ebb8f4c69e4674d262e75` and `0x0054a2d42a40f51259dedd1978f6c118a0f0eff078` (the second and third topics). A transaction with a log with topics \[A, B\] will be matched by the following topic filters: Now that we have a better understanding of how to make requests, let's take a look at the response. Deciphering the Response ------------------------ Below is the resulting log from the above request. The interesting fields to point out here are the "`data`", and "`topics`". json { "id": 0, "jsonrpc": "2.0", "result": [\ {\ "address": "0xb59f67a8bff5d8cd03f6ac17265c550ed8f33907",\ "blockHash": "0x8243343df08b9751f5ca0c5f8c9c0460d8a9b6351066fae0acbd4d3e776de8bb",\ "blockNumber": "0x429d3b",\ "data": "0x000000000000000000000000000000000000000000000000000000012a05f200",\ "logIndex": "0x56",\ "removed": false,\ "topics": [\ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",\ "0x00000000000000000000000000b46c2526e227482e2ebb8f4c69e4674d262e75",\ "0x00000000000000000000000054a2d42a40f51259dedd1978f6c118a0f0eff078"\ ],\ "transactionHash": "0xab059a62e22e230fe0f56d8555340a29b2e9532360368f810595453f6fdd213b",\ "transactionIndex": "0xac"\ }\ ] } We've seen the `topics` field in our request already, but the `data` field is new. Let's break each of these down. **Topics** The `topics` field can contain up to 4 topics. The first topic is required and will always contain the _keccak 256_ hash of the _**event signature**_. The other three topics are optional and typically used for indexing and provide a faster lookup time than using the **data** field described below. **Data** The data field is an unlimited field for encoding hex data that is relevant to the specific event. By default if information does not get indexed into the remaining topics field, it will automatically go into the data field. This requires more work for parsing out individual information from the hex string rather than having them as separate indexed topics. However since it has no storage limit it's less expensive in regards to the gas cost for storing data like arrays and strings. So how do we figure out what all of this means? We can start by looking at the ABI reference for this specific transfer method: json { "anonymous": false, "inputs": [\ {\ "indexed": true,\ "name": "from",\ "type": "address"\ },\ {\ "indexed": true,\ "name": "to",\ "type": "address"\ },\ {\ "indexed": false,\ "name": "value",\ "type": "uint256"\ }\ ], "name": "Transfer", "type": "event" }, Notice that the "`from`" and "`to`" inputs have `"indexed": true`. This means that these addresses will be stored in the `topics` field rather than the `data` field when the event gets fired off. Remember, the first topic is the event signature for this log which means the other two topics are the `from` and `to` addresses (in that order). However, for the "`value`" input, the `uint256` will instead go into the `data` field since it has `"indexed":false` in the contract ABI. Since we know the `value` is of type `uint256`we can translate the data `0x12a05f200`to `5,000,000,000`. So this transaction reads: transfer `5,000,000,000` from address `0x00b46c2526e227482e2ebb8f4c69e4674d262e75` to address `0x54a2d42a40f51259dedd1978f6c118a0f0eff078`. One thing to note is that the values are always specified in the most basic unit, but each contract has a constant called `decimals` which indicates the conversion from the base unit to the more common unit or token, specifying how much you should divide by to get the actual value. In this case, the `decimals` value is 3 so you divide the given value by 10^3, which makes our true amount `5,000,000`. You can see the decimals value for this contract on [Etherscan](https://etherscan.io/address/0xb59f67a8bff5d8cd03f6ac17265c550ed8f33907#readContract) . And that's it! Now you've gone in depth with `eth_getLogs!` Was this page helpful? YesNo --- # Code Examples | Alchemy Docs Copy page Code Examples ============= This page provides practical code examples for common Yellowstone gRPC use cases. All examples are in Rust and include placeholders that will be filled with complete working code. Prerequisites & Authentication ------------------------------ See [Quickstart](https://www.alchemy.com/docs/reference/yellowstone-grpc-quickstart) for prerequisites & authentication. Basic subscription that streams all transactions ------------------------------------------------ use anyhow::Result; use futures::{sink::SinkExt, stream::StreamExt}; use solana_signature::Signature; use std::collections::HashMap; use yellowstone_grpc_client::{ClientTlsConfig, GeyserGrpcClient}; use yellowstone_grpc_proto::geyser::{ CommitmentLevel, SubscribeRequest, SubscribeRequestFilterTransactions, subscribe_update::UpdateOneof, }; #[tokio::main] async fn main() -> Result<()> { // Set up connection parameters let endpoint = "https://solana-mainnet.g.alchemy.com"; let x_token = "ALCHEMY_API_KEY"; // Replace with your Alchemy API key // Build and connect the gRPC client with TLS and authentication let mut client = GeyserGrpcClient::build_from_shared(endpoint)? .tls_config(ClientTlsConfig::new().with_native_roots())? .x_token(Some(x_token))? // API key passed as X-Token header .connect() .await?; // Create a bidirectional stream for subscribing to updates let (mut tx, mut stream) = client.subscribe().await?; // Send subscription request to filter for non-vote, non-failed transactions tx.send(SubscribeRequest { transactions: HashMap::from([(\ "all_transactions".to_string(),\ SubscribeRequestFilterTransactions {\ vote: Some(false), // Exclude vote transactions\ failed: Some(false), // Exclude failed transactions\ ..Default::default()\ },\ )]), commitment: Some(CommitmentLevel::Confirmed as i32), // Use confirmed commitment level ..Default::default() }) .await?; // Process incoming transaction updates while let Some(Ok(msg)) = stream.next().await { if let Some(UpdateOneof::Transaction(tx)) = msg.update_oneof { // Extract and display transaction signature let sig = tx .transaction .and_then(|t| Some(Signature::try_from(t.signature.as_slice()).unwrap())) .unwrap_or_default(); println!("Slot: {} | Signature: {}", tx.slot, sig); } } Ok(()) } Durable client -------------- Implement a robust client with reconnection logic & gap recovery with `from_slot`: use anyhow::Result; use futures::stream::StreamExt; use std::collections::HashMap; use yellowstone_grpc_client::{ClientTlsConfig, GeyserGrpcClient}; use yellowstone_grpc_proto::geyser::{ CommitmentLevel, SlotStatus, SubscribeRequest, SubscribeRequestFilterSlots, subscribe_update::UpdateOneof, }; #[tokio::main] async fn main() -> Result<()> { // Alchemy Solana Mainnet endpoint let endpoint = "https://solana-mainnet.g.alchemy.com"; let x_token = "ALCHEMY_API_KEY"; // Replace with your Alchemy API key // Build a subscription request to receive slot updates // We subscribe to all slots with confirmed commitment level let mut subscribe_request = SubscribeRequest { slots: HashMap::from([(\ "slots".to_string(),\ SubscribeRequestFilterSlots {\ ..Default::default()\ },\ )]), commitment: Some(CommitmentLevel::Confirmed as i32), ..Default::default() }; // Track the latest slot we've seen for gap recovery let mut tracked_slot: u64 = 0; // Main reconnection loop - continuously reconnect loop { // Build and connect to the Yellowstone gRPC client let mut client = GeyserGrpcClient::build_from_shared(endpoint)? .tls_config(ClientTlsConfig::new().with_native_roots())? .x_token(Some(x_token))? .connect() .await?; // This ensures that even if we disconnect and miss updates, we can // recover the missed data when we reconnect (assuming the server has // retention for those slots). if tracked_slot > 0 { subscribe_request.from_slot = Some(tracked_slot); } else { subscribe_request.from_slot = None; } // Subscribe to slot updates with our configured request let (mut _update_subscription, mut stream) = client .subscribe_with_request(Some(subscribe_request.clone())) .await?; // Process incoming slot updates until an error occurs loop { match stream.next().await { Some(Ok(msg)) => { // Extract and print slot information if this update contains slot data if let Some(UpdateOneof::Slot(slot)) = msg.update_oneof { println!( "Received slot: {} with status {:?}", slot.slot, SlotStatus::try_from(slot.status).unwrap() ); // Update our tracked slot to use for the next reconnection tracked_slot = slot.slot; } } Some(Err(e)) => { // On error, log and break to reconnect (outer loop will restart) println!("Error receiving updates: {}", e); break; } _ => {} } } } } Stream accounts --------------- ### SubscribeRequest for streaming token accounts for a specific mint SubscribeRequest { accounts: HashMap::from([(\ "token_accounts_by_mint".to_string(),\ SubscribeRequestFilterAccounts {\ filters: vec![\ // Filter for token accounts\ SubscribeRequestFilterAccountsFilter {\ filter: Some(Filter::TokenAccountState(true)),\ },\ // Filter for the specific mint based on the token account structure\ SubscribeRequestFilterAccountsFilter {\ filter: Some(Filter::Memcmp(SubscribeRequestFilterAccountsFilterMemcmp {\ offset: 0, // Mint is located at the beginning of the account data\ data: Some(Data::Base58(\ "pumpCmXqMfrsAkQ5r49WcJnRayYRqmXz6ae8H7H9Dfn".to_string(), // Replace with the specific mint address\ )),\ })),\ },\ ],\ ..Default::default()\ },\ )]), commitment: Some(CommitmentLevel::Confirmed as i32), // Use confirmed commitment level ..Default::default() } Stream transactions ------------------- ### SubscribeRequest for streaming all successful non-vote transactions SubscribeRequest { transactions: HashMap::from([(\ "all_transactions".to_string(),\ SubscribeRequestFilterTransactions {\ vote: Some(false), // Exclude vote transactions\ failed: Some(false), // Exclude failed transactions\ ..Default::default()\ },\ )]), commitment: Some(CommitmentLevel::Confirmed as i32), // Use confirmed commitment level ..Default::default() } Production-Grade client ----------------------- * Durable client * Gap recovery with `from_slot` * Async processing with tokio channels * Dynamic management of subscription * Error handling use futures::{SinkExt, stream::StreamExt}; use solana_signature::Signature; use std::{collections::HashMap, sync::Arc}; use tokio::sync::{RwLock, mpsc}; use yellowstone_grpc_client::{ClientTlsConfig, GeyserGrpcClient}; use yellowstone_grpc_proto::geyser::{ CommitmentLevel, SubscribeRequest, SubscribeRequestFilterSlots, SubscribeRequestFilterTransactions, SubscribeRequestPing, SubscribeUpdate, subscribe_update::UpdateOneof, }; // Channel capacity for buffering updates from the ingress loop to the dispatcher. // This allows the ingress loop to continue receiving data even if the dispatcher // is temporarily slower, preventing backpressure to the gRPC stream. const UPDATE_CHANNEL_CAPACITY: usize = 10000; #[tokio::main] async fn main() { // Configure the Yellowstone gRPC endpoint and authentication token // In production, these should be loaded from environment variables or a config file let endpoint = "https://solana-mainnet.g.alchemy.com".to_string(); let x_token = "ALCHEMY_API_KEY".to_string(); // Replace with your Alchemy API key // This is the initial subscription request. This can be updated and sent to the ingress loop through the `subscribe_rx` channel. let subscribe_request = Arc::new(RwLock::new(SubscribeRequest { slots: HashMap::from([(\ "slots".to_string(),\ SubscribeRequestFilterSlots {\ ..Default::default()\ },\ )]), transactions: HashMap::from([(\ "all_transactions".to_string(),\ SubscribeRequestFilterTransactions {\ vote: Some(false), // Exclude vote transactions\ failed: Some(false), // Exclude failed transactions\ ..Default::default()\ },\ )]), commitment: Some(CommitmentLevel::Confirmed as i32), // from_slot will be set dynamically in the ingress loop for gap recovery ..Default::default() })); // Create a bounded channel for updates from ingress to dispatcher. // Ingress will drop updates if the channel is full. let (updates_tx, updates_rx) = mpsc::channel::(UPDATE_CHANNEL_CAPACITY); // Create an unbounded channel for dynamic subscription updates. // This allows any part of your application to send new subscription requests // to modify what data you're receiving at runtime (e.g., add new account filters). let (subscribe_tx, subscribe_rx) = mpsc::unbounded_channel::(); // Spawn the dispatcher task: processes updates and implements business logic // In production, this could write to a database, forward to other services, etc. let dispatcher_handle = tokio::spawn(async move { dispatcher_loop(updates_rx).await; }); // Spawn the ingress task: manages gRPC connection, reconnection, and gap recovery let ingress_handle = tokio::spawn(async move { ingress_loop( updates_tx, subscribe_rx, endpoint, x_token, subscribe_request, ) .await; }); // Wait for both tasks to complete (they run indefinitely in this example) // In production, you might want to handle graceful shutdown with signal handlers if let Err(e) = tokio::join!(dispatcher_handle, ingress_handle).0 { println!("Error: {:?}", e); } } // - Automatic reconnection on any error or disconnect // - Gap recovery using from_slot to resume from last known position // - Ping/pong handling to keep connection alive // - Dynamic subscription management via subscribe_rx channel // // The outer loop ensures the client never stops - it will continuously // attempt to reconnect if the connection drops for any reason. async fn ingress_loop( updates_tx: mpsc::Sender, mut subscribe_rx: mpsc::UnboundedReceiver, endpoint: String, x_token: String, subscribe_request: Arc>, ) { // Configure TLS for secure connection to Yellowstone gRPC server let tls_config = ClientTlsConfig::new().with_native_roots(); // Track the last slot we successfully processed for gap recovery // This is critical for ensuring no data is missed across reconnections let mut tracked_slot: u64 = 0; // This infinite loop ensures the client is DURABLE - it will never give up. // On any error or disconnect, we simply reconnect and resume from where we left off. loop { // Build the gRPC client with authentication and TLS configuration let builder = GeyserGrpcClient::build_from_shared(endpoint.clone()) .unwrap() .x_token(Some(x_token.clone())) .unwrap() .tls_config(tls_config.clone()) .unwrap(); let mut client = builder.connect().await.unwrap(); // This ensures that even if we disconnect and miss updates, we can // recover the missed data when we reconnect (assuming the server has // retention for those slots). subscribe_request.write().await.from_slot = if tracked_slot > 0 { Some(tracked_slot) } else { None }; // Attempt to subscribe with our configured request (including from_slot) // Returns a tuple of (sink, stream): // - sink: For sending requests to the server (pings, subscription updates) // - stream: For receiving updates from the server match client .subscribe_with_request(Some(subscribe_request.read().await.clone())) .await { Ok((mut subscribe_tx, mut stream)) => { // This loop runs as long as the connection is healthy. // It concurrently handles: // 1. Dynamic subscription updates from subscribe_rx // 2. Stream updates from the gRPC server loop { tokio::select! { // Branch 1: Dynamic Subscription Management // // Listen for new subscription requests sent via subscribe_tx // This allows runtime modification of subscriptions without // disconnecting (e.g., add/remove account filters) Some(subscribe_request) = subscribe_rx.recv() => { // Forward the updated subscription request to the gRPC server if let Err(e) = subscribe_tx.send(subscribe_request).await { println!("Error sending subscribe request to grpc: {:?}", e); // Connection issue - break to outer loop for reconnect break; } } // Branch 2: Process Stream Updates Some(result) = stream.next() => { match result { Ok(update) => { // Yellowstone gRPC servers send pings to ensure // the client is alive. We must respond with a pong. if matches!(update.update_oneof, Some(UpdateOneof::Ping(_))) { if let Err(e) = subscribe_tx .send(SubscribeRequest { ping: Some(SubscribeRequestPing { id: 1 }), ..Default::default() }) .await { println!("Error sending ping to grpc: {:?}", e); } } // Ping/pong are internal protocol messages, // not business data, so we don't forward them if matches!(update.update_oneof, Some(UpdateOneof::Ping(_)) | Some(UpdateOneof::Pong(_))) { continue; } // Update tracked_slot with every slot update. // This is essential for gap recovery - if we // disconnect, we know exactly which slot to // resume from when reconnecting. if let Some(UpdateOneof::Slot(ref slot_update)) = update.update_oneof { tracked_slot = slot_update.slot; continue; // Slot updates are tracked but not forwarded } // Send the update through the channel to the // dispatcher for processing. // // Error handling: If the channel is full or // the receiver is dropped, log and continue. // This prevents ingress from blocking. if let Err(e) = updates_tx.send(update.clone()).await { println!("Slow consumer, dropping update {:?} with error: {:?}", update, e); } } // Any error on the stream (network issue, server // restart, etc.) triggers a reconnection attempt. Err(e) => { println!("Error receiving update from stream: {:?}", e); break; // Break to outer loop for reconnect } } } } } } // If we can't subscribe (e.g., auth failure, invalid request), // log the error and loop back to reconnect. In production, you // might want exponential backoff here to avoid hammering the server. Err(e) => { println!("Error subscribing to Yellowstone gRPC server: {:?}", e); } }; // If we reach here, the connection was lost or subscription failed. // The outer loop will automatically reconnect and resume from tracked_slot. // In production, consider adding: // - Exponential backoff to avoid rapid reconnection attempts // - Connection metrics/monitoring // - Alerting on repeated failures println!("Disconnected from Yellowstone gRPC server, reconnecting..."); } } // In production, this is where you would: // - Write to databases // - Forward to other services // - Apply complex business logic // - Aggregate metrics // - Trigger alerts async fn dispatcher_loop(mut updates_rx: mpsc::Receiver) { loop { tokio::select! { // This receives updates sent from the ingress loop via the channel. // The bounded channel provides backpressure - if this loop is too // slow, the ingress will drop updates. Some(update) = updates_rx.recv() => { match update.update_oneof { Some(UpdateOneof::Transaction(tx)) => { // Extract the transaction signature for display/logging let sig = tx .transaction .and_then(|t| Some(Signature::try_from(t.signature.as_slice()).unwrap())) .unwrap_or_default(); println!("Slot: {} | Signature: {}", tx.slot, sig); // In production, you might: // - Parse transaction instructions // - Store in database // - Check for specific program interactions // - Calculate metrics // - Forward to downstream services } // -------------------------------------------------------- // Account Updates // -------------------------------------------------------- // // Uncomment to handle account updates: // Some(UpdateOneof::Account(account)) => { // // TODO: Implement account updates // } // -------------------------------------------------------- // Block Updates // -------------------------------------------------------- // // Uncomment to handle block updates: // Some(UpdateOneof::Block(block)) => { // // TODO: Implement block updates // } // -------------------------------------------------------- // Other Updates // -------------------------------------------------------- _ => { println!("Received unknown update from Yellowstone gRPC server: {:?}", update); } } } } } } Contributing Examples --------------------- Found a useful pattern? Consider contributing it to these [docs](https://github.com/alchemyplatform/docs/) ! Was this page helpful? YesNo --- # How to Get the Latest Block on Ethereum | Alchemy Docs Copy page How to Get the Latest Block on Ethereum ======================================= Don't know where to start? This guide will walk you through writing a simple web3 script to get the latest block number from the Ethereum mainnet using Alchemy. This tutorial uses the **[getBlockNumber](https://www.alchemy.com/docs/reference/sdk-getblocknumber) ** endpoint. _This guide assumes you've gone through the [getting started](https://www.alchemy.com/docs/alchemy-quickstart-guide) steps and have an [Alchemy account!](https://alchemy.com/?r=affiliate:b92f4e01-cafb-4038-83f4-372a42df5171) _ 1\. From your command line, create a new project directory and `cd` into it: ---------------------------------------------------------------------------- shell mkdir web3-example cd web3-example 2\. Install a web3 library -------------------------- You can use any [web3 library](https://www.alchemy.com/docs/alchemy-quickstart-guide) of your choosing. We recommend Viem for new projects, or Ethers.js if you're already familiar with it. Viem Ethers.js npm install viem 3\. Create a file named `index.js` and add the following contents: ------------------------------------------------------------------ Viem Ethers.js import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' // Replace with your Alchemy API Key const apiKey = "demo"; // Replace with your Alchemy API Key. const publicClient = createPublicClient({ chain: mainnet, transport: http(`https://eth-mainnet.g.alchemy.com/v2/${apiKey}`) }) async function main() { try { const latestBlock = await publicClient.getBlockNumber(); console.log("The latest block number is", latestBlock); } catch (error) { console.error('Request failed:', error.message); } } main(); You should ultimately replace `demo` with your Alchemy HTTP API key. Unfamiliar with the async stuff? Check out this [Medium post](https://medium.com/better-programming/understanding-async-await-in-javascript-1d81bb079b2c) . 4\. Run it using node --------------------- shell node index.js 5. You should now see the latest block number output in your console! shell The latest block number is 11043912 Woo! Congrats! You just wrote your first web3 script using Alchemy 🎉 Once you complete this tutorial, let us know how your experience was or if you have any feedback by tagging us on Twitter [@Alchemy](https://twitter.com/Alchemy) ! _Not sure what to do next? Build upon your skills learned in this tutorial by checking out our beginner's tutorial for [sending Ethereum transactions using Web3 and Alchemy](https://www.alchemy.com/docs/how-to-send-transactions-on-ethereum) ._ Was this page helpful? YesNo --- # eth_subscribe | Alchemy Docs Copy page eth\_subscribe ============== POST https://opt-mainnet.g.alchemy.com/v2/{apiKey} Subscribes to specific event types and returns a subscription ID to receive asynchronous notifications via the `eth_subscription` method. ⚠️ **WARNING: WebSocket-Only Method** ⚠️ > This method REQUIRES a WebSocket connection using `wss://` protocol. It will NOT work with standard HTTP/HTTPS requests or `curl`. See the [WebSocket documentation](https://alchemy.com/docs/reference/subscription-api) > for examples. Path Parameters --------------- `apiKey`stringrequireddefaults to `docs-demo` For higher throughput, [create your own API key](https://dashboard.alchemy.com/signup?utm_source=docs&utm_medium=referral&utm_content=chains_op-mainnet_op-mainnet-api-endpoints_eth-subscribe) Request ------- `Subscription Type`string The type of event to subscribe to (e.g., "newHeads", "logs", "newPendingTransactions", "syncing"). `Options`object Optional subscription parameters, such as filtering topics for `logs`. Responses --------- ### 200 A unique identifier for the subscription, returned as a 32-byte hex string. Was this page helpful? YesNo --- # eth_subscribe | Alchemy Docs Copy page eth\_subscribe ============== POST https://polygon-mainnet.g.alchemy.com/v2/{apiKey} Subscribes to specific event types and returns a subscription ID to receive asynchronous notifications via the `eth_subscription` method. ⚠️ **WARNING: WebSocket-Only Method** ⚠️ > This method REQUIRES a WebSocket connection using `wss://` protocol. It will NOT work with standard HTTP/HTTPS requests or `curl`. See the [WebSocket documentation](https://alchemy.com/docs/reference/subscription-api) > for examples. Path Parameters --------------- `apiKey`stringrequireddefaults to `docs-demo` For higher throughput, [create your own API key](https://dashboard.alchemy.com/signup?utm_source=docs&utm_medium=referral&utm_content=chains_polygon-pos_polygon-po-s-api-endpoints_eth-subscribe) Request ------- `Subscription Type`string The type of event to subscribe to (e.g., "newHeads", "logs", "newPendingTransactions", "syncing"). `Options`object Optional subscription parameters, such as filtering topics for `logs`. Responses --------- ### 200 A unique identifier for the subscription, returned as a 32-byte hex string. Was this page helpful? YesNo --- # debug_getRawHeader | Alchemy Docs Copy page debug\_getRawHeader =================== POST https://eth-mainnet.g.alchemy.com/v2/{apiKey} Returns an RLP-encoded header. Path Parameters --------------- `apiKey`stringrequireddefaults to `docs-demo` For higher throughput, [create your own API key](https://dashboard.alchemy.com/signup?utm_source=docs&utm_medium=referral&utm_content=node_debug-api_debug-api-endpoints_debug-get-raw-header) Request ------- `BlockNumberOrTag`string or enumrequired The block number or tag (e.g., "latest", "earliest"). Show 2 variants Responses --------- ### 200 RLP-encoded header as a hexadecimal string Was this page helpful? YesNo --- # debug_getRawReceipts | Alchemy Docs Copy page debug\_getRawReceipts ===================== POST https://eth-mainnet.g.alchemy.com/v2/{apiKey} Returns an array of EIP-2718 binary-encoded receipts. Path Parameters --------------- `apiKey`stringrequireddefaults to `docs-demo` For higher throughput, [create your own API key](https://dashboard.alchemy.com/signup?utm_source=docs&utm_medium=referral&utm_content=node_debug-api_debug-api-endpoints_debug-get-raw-receipts) Request ------- `BlockNumberOrTag`string or enumrequired The block number or tag (e.g., "latest", "earliest"). Show 2 variants Responses --------- ### 200 Array of EIP-2718 binary-encoded receipts as hexadecimal strings. Was this page helpful? YesNo --- # What are Uncle Blocks? | Alchemy Docs Copy page What are Uncle Blocks? ====================== Uncle blocks are blocks that did not get mined onto the canonical chain. When two or more miners produce blocks at nearly the same time, uncle blocks are created. What is an uncle block? ----------------------- Imagine Ethereum as a worldwide group chat where everyone is trying to add the next message (block) at the same time. Only one message can become the official next one. Sometimes two miners create a valid block at almost the same moment. Both blocks are valid. Only one gets added to the official chain. The other block becomes an uncle block. Why do uncle blocks happen? --------------------------- Ethereum nodes are spread all over the world. When one miner finds a block, it takes a short time for that block to reach the rest of the network. During this short delay, another miner might also find a valid block. Now the network has two valid candidates for the next block. Eventually the network settles on one. The block that is not chosen becomes an uncle. \## Why are uncle blocks rewarded? ---------------------------------- The miner who created the uncle block still performed real work and produced a valid block. It simply arrived a little too late. Ethereum gives a partial reward to encourage decentralization and to avoid punishing miners who are physically far from large mining pools. Do uncle blocks matter? ----------------------- Yes. Even though they do not become part of the main chain, uncle blocks help the network in several ways: * They reduce wasted mining work * They make mining more fair for smaller or slower miners * They increase network security * They give miners an incentive to include uncle references in future blocks Summary ------- An uncle block is a valid block that lost a timing race. It was correct. It was just a little too slow to reach the network.## Was this page helpful? YesNo --- # How to Subscribe to Pending Transactions via WebSocket Endpoints | Alchemy Docs Copy page How to Subscribe to Pending Transactions via WebSocket Endpoints ================================================================ Learn how to subscribe to pending transactions via WebSockets, and filters the transactions based on specified from and/or to addresses. In this tutorial, you'll utilize the alchemy\_pendingTransactions subscription type API endpoint. If you require the script or further details, refer to the following articles or continue reading for more. [![alchemy.com/docs](https://www.alchemy.com/docs/_next/image?url=https%3A%2F%2Falchemyapi-res.cloudinary.com%2Fimage%2Fupload%2Fv1764180091%2Fdocs%2Fapi-reference%2Fwebsockets%2F0c06bc6-small-alchemy-circle-logo.png&w=3840&q=75)alchemy.com/docs](https://www.alchemy.com/docs/reference/alchemy-pendingtransactions) [alchemy\_pendingTransactions](https://www.alchemy.com/docs/reference/alchemy-pendingtransactions) Alchemy provides the most effective method to subscribe to pending transactions, log events, and new blocks using WebSockets on Ethereum, Polygon, Arbitrum, and Optimism. By leveraging modern Web3 libraries, you're able to access direct subscription types by simply connecting to each endpoint. In this tutorial, we will test and create a sample project using the `alchemy_pendingTransactions` method offered by Alchemy's WebSocket API. **What relevance does the `alchemy_pendingTransactions` provide to users?** * Watching for pending transactions sent to a set of NFT owners to track the most recent floor price * Watching transactions sent from a whale trader to track trading patterns **How does `alchemy_pendingTransactions` compare to `newPendingTransactions`?** Both these subscription types enable developers to receive transaction hashes that are sent to the network and marked as "pending". However, `alchemy_pendingTransactions`enhance the developer experience by providing filters that can specify based on to/from addresses. This greatly improves the readability of the transaction requests received. It allows for strengthened requests with specific parameters given by the user including: * `toAddress`(optional): Singular address or array of addresses **to** receive pending transactions sent from this address. * `fromAddress`(optional): Singular address or array of addresses **from** receive pending transactions sent from this address. * `hashesOnly`(optional - default set to `false`): The response matches the payload of [eth\_getTransactionByHash](https://www.alchemy.com/docs/reference/eth-gettransactionbyhash) . This is information about a transaction by the transaction hash including `blockHash`, `blockNumber` and `transactionIndex`. Step 0: Configure your developer environment -------------------------------------------- 1\. Install [Node.js](https://nodejs.org/en/) (> 14) on your local machine 2\. Install [npm](https://www.npmjs.com/) on your local machine 3\. Install [wscat](https://www.npmjs.com/package/wscat) on your local machine To check your Node version, run the following command in your terminal: bash node -v 4\. [Create a free Alchemy account](https://dashboard.alchemy.com/signup?utm_source=docs&utm_medium=referral&utm_content=how-to-subscribe-to-transactions-via-websocket-endpoints) Step 1: Open your Alchemy App ----------------------------- Once your Alchemy account is created, there will also be a default app that is also created. To create another Alchemy app, check out [this video](https://www.youtube.com/watch?time_continue=1&v=tfggWxfG9o0&feature=emb_logo) . Step 2: Get WebSocket URL from Alchemy App ------------------------------------------ Once you have created your app, get your WebSocket URL that we will use later in this tutorial. 1. Click on your app's **View Key** button in the dashboard 2. Copy and save the **WebSocket URL** Step 3: Output Pending Transactions Using wscat ----------------------------------------------- **Wscat** is a terminal or shell tool used to connect to the WebSockets server. Each Alchemy application will provide a WebSocket URL that can be used directly with the wscat command. 1. Initiate the WebSocket stream 2. Enter the specific call command From your terminal, run the following commands: wscat // initiate websocket stream first wscat -c wss://eth-mainnet.g.alchemy.com/v2/demo // then call subscription {"jsonrpc":"2.0","id": 2, "method": "eth_subscribe", "params": ["alchemy_pendingTransactions", {"toAddress": ["0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", "0xdAC17F958D2ee523a2206206994597C13D831ec7"], "hashesOnly": false}]} If successful, you should see output that looks something like this: Results {"id":1,"result":"0xf13f7073ddef66a8c1b0c9c9f0e543c3","jsonrpc":"2.0"} { "jsonrpc": "2.0", "method": "eth_subscription", "params": { "result": { "blockHash": null, "blockNumber": null, "from": "0x098bdcdc84ab11a57b7c156557dca8cef853523d", "gas": "0x1284a", "gasPrice": "0x6fc23ac00", "hash": "0x10466101bd8979f3dcba18eb72155be87bdcd4962527d97c84ad93fc4ad5d461", "input": "0xa9059cbb00000000000000000000000054406f1ec84f89532f83768f3f159b73b237257f0000000000000000000000000000000000000000000000000000000001c9c380", "nonce": "0x11", "to": "0xdac17f958d2ee523a2206206994597c13d831ec7", "transactionIndex": null, "value": "0x0", "type": "0x0", "v": "0x26", "r": "0x93ddd646056f365352f7e53dfe5dc81bde53f5b7c7bbe5deea555a62540d6995", "s": "0x79ed82a681930feb11eb68feccd1df2e53e1b96cf9171ae4ffcf53e9b2a40e8e" }, "subscription": "0xf13f7073ddef66a8c1b0c9c9f0e543c3" } } By using **wscat**, you are able to verify the transaction immediately via the computer's terminal or shell. Step 4: Create a Node project ----------------------------- Let's create an empty repository and install the necessary dependencies for WebSocket connections. We can use either Viem or Ethers.js to manage WebSocket subscriptions. From your terminal, run the following commands: Viem Ethers.js mkdir pending-transactions && cd pending-transactions npm init -y npm install viem touch main.js This will create a repository named `pending-transactions` that holds all the files and dependencies we need. Open this repo in your preferred code editor, where we'll write our code in the `main.js` file. Step 5: Output Pending Transactions using WebSocket libraries ------------------------------------------------------------- Next, we'll demonstrate how to use Viem or Ethers.js to create an **alchemy\_pendingTransactions** subscription. To make requests using Alchemy's pendingTransactions API, we recommend reviewing the [alchemy\_pendingTransactions docs](https://www.alchemy.com/docs/reference/alchemy-pendingtransactions) . Next, add the following code to the `main.js` file, using your Alchemy API key: Viem Ethers.js import { createPublicClient, webSocket } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: webSocket('wss://eth-mainnet.g.alchemy.com/v2/<-- ALCHEMY APP API KEY -->') }) // Subscribe to pending transactions const unsubscribe = client.watchPendingTransactions({ onTransactions: (hashes) => { console.log('Pending transaction hashes:', hashes) // To get full transaction details, you can fetch each hash: // hashes.forEach(async (hash) => { // const tx = await client.getTransaction({ hash }) // console.log(tx) // }) } }) console.log('Listening for pending transactions...') Run this script by running the following command in your terminal: `node main.js` If successful, you should see a stream of transactions as the result. This stream of output indicates the latest (pending or mined) transactions hitting the Ethereum Mainnet. It should look something like this: Results [\ {\ "blockHash": null,\ "blockNumber": null,\ "from": "0x0dd25571522e0ac38712b56834dc6081cde33325",\ "gas": "0x8b5d7",\ "gasPrice": "0xd09dc30c",\ "hash": "0x9575c90c4923d7d1981029bfcfc3f23b91ec78683b881b571763dff0c00a72da",\ "input": "0x0357371d0000000000000000000000000dd25571522e0ac38712b56834dc6081cde3332500000000000000000000000000000000000000000000000000b1a2bc2ec50000",\ "nonce": "0x14c",\ "to": "0xfebfd3467c4362eee971c433e3613c009ab55ce4",\ "transactionIndex": null,\ "value": "0x0",\ "type": "0x0",\ "v": "0x27125",\ "r": "0xdc427da8df7cd9a4e831734a9ec4d8127d2c068497e667138b0092635157c5db",\ "s": "0x5d4b996fd467702e7602030de3517e024a31085d57cfe2ff064e98460bc2da28"\ },\ {\ "blockHash": null,\ "blockNumber": null,\ "from": "0x61141bce5352fc9b5ff648468676e356518d86ab",\ "gas": "0x55730",\ "gasPrice": "0x77359410",\ "hash": "0xc81a148daba8bb67daca8b3e645d07c9caaf2977ebdd46245f97f12cc3737dd2",\ "input": "0x29dd214d00000000000000000000000000000000000000000000000000000000000000c0...",\ "nonce": "0x3f927",\ "to": "0x000054d3a0bc83ec7808f52fcdc28a96c89f6c5c",\ "transactionIndex": null,\ "value": "0x0",\ "type": "0x0",\ "v": "0x27125",\ "r": "0x5466a7a7d1823c2290fc4803cac0340dcab34e843a8c0681763ca60fd7ccc7b2",\ "s": "0x3030ce868c4d09b71009af597175bdecace2f081a0f78f0e4705e318d19076a9"\ }\ ] Step 6: Filter Pending Transactions ----------------------------------- Next, we'll demonstrate how to filter pending transactions based on addresses. While standard WebSocket subscriptions don't offer built-in filtering, we can implement filtering logic in our application. Note: The Alchemy-enhanced `alchemy_pendingTransactions` API provides native filtering by `fromAddress` and `toAddress`. For standard WebSocket subscriptions, we need to implement filtering manually as shown below. Add the following code to the `main.js` file, using your Alchemy API key: Viem Ethers.js import { createPublicClient, webSocket } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: webSocket('wss://eth-mainnet.g.alchemy.com/v2/<-- ALCHEMY APP API KEY -->') }) // Addresses to filter for const fromAddress = "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48" const toAddress = "0xdAC17F958D2ee523a2206206994597C13D831ec7" // Subscribe to pending transactions with filtering const unsubscribe = client.watchPendingTransactions({ onTransactions: async (hashes) => { for (const hash of hashes) { try { const tx = await client.getTransaction({ hash }) // Filter transactions by from/to address if (tx.from?.toLowerCase() === fromAddress.toLowerCase() || tx.to?.toLowerCase() === toAddress.toLowerCase()) { console.log('Filtered pending transaction:', tx) } } catch (error) { // Skip transactions that can't be fetched continue } } } }) console.log(`Listening for pending transactions from ${fromAddress} or to ${toAddress}...`) Conclusion ========== You now know how to use WebSocket connections with Viem and Ethers.js to [subscribe to pending transactions](https://www.alchemy.com/docs/reference/alchemy-pendingtransactions) and filter them based on addresses. For more advanced filtering capabilities, consider using Alchemy's enhanced `alchemy_pendingTransactions` API which provides native filtering by `fromAddress` and `toAddress`. If you enjoyed this tutorial, tweet us at **@Alchemy**. If you have any questions or feedback, please contact us at [\[email protected\]](https://www.alchemy.com/cdn-cgi/l/email-protection#71020401011e030531101d1219141c085f121e1c) or open a ticket in the dashboard. Was this page helpful? YesNo --- # What is Archive Data on Ethereum? | Alchemy Docs Copy page What is Archive Data on Ethereum? ================================= Archive data is data on the blockchain that is older than 128 blocks, which is approximately 4 epochs or 25.6 minutes old Archive Data ============ **Archive data** is data on the blockchain that is **older than 128 blocks**. Archive data is at least 25.6 minutes old because one block can be created every 12 seconds. Archive data is also at least 4 epochs old (128 slots) because there are 32 slots per epoch, and 1 block can be validated in each slot. Because archive data is at least 4 epochs old, the commitment level for archive data is considered "finalized". This data is used to store information about past transactions and events that have occurred on the blockchain network. This data is used by users to help them understand the history of the network and to make sure that all transactions and events that have occurred on the network are valid. Full Nodes ========== Full nodes store the current and most recent blockchain states (up to the last 128 blocks) and participate in validating newly added blocks. They can process transactions, execute smart contracts, and query/serve blockchain data. They can also access some historical data (via tracing) but are inefficient for this task. Archive Nodes ============= Archive nodes store the same information as full nodes and all previous states of the blockchain(data older than 128 blocks). Running an archive node requires the most investment in hardware, running costs, technical expertise, and experience. Archive nodes build archival blockchain data quickly and efficiently, and they’re useful for querying arbitrary historical data, like a user’s balances on a specific block. Only an archive node can serve API requests for certain RPC methods older than 128 blocks. The Ethereum JSON-RPC and Websocket APIs include several methods which require access to an archive node. Methods that require Archive Data ================================= Requests for data older than the most recent 128 blocks require access to archive data. The following methods include a parameter for specifying a block number for the request: * [eth\_getBalance](https://www.alchemy.com/docs/reference/eth-getbalance) * [eth\_call](https://www.alchemy.com/docs/reference/eth-call) * [eth\_getCode](https://www.alchemy.com/docs/reference/eth-getcode) * [eth\_getStorageAt](https://www.alchemy.com/docs/reference/eth-getstorageat) * [eth\_call](https://www.alchemy.com/docs/reference/eth-call) These methods can also be used to get non-archive data. Archive data access is required only if you request data older than 128 blocks using these methods. Use cases for Archive Data ========================== Here are two use-cases for Ethereum archive data: 1\. Auditing historical information for blockchains --------------------------------------------------- If you're building a service to audit a blockchain or gather specific pieces of historic data, archive data is ideal. A good use-case would be if you were building a blockchain explorer (Etherscan), an on-chain analytics tool (Dune Analytics), or a cryptocurrency wallet. These services rely on archive nodes to query and serve up old state data for users. For example, you can get information about the first block mined on Ethereum using Etherscan. 2\. dApp development -------------------- dApps that need to access data older than 128 blocks require access to archive data. Examples of dApps that may need access to an archive data include: On-chain reputation services (e.g. DegenScore) that track user activity over a large period of time. Governance platforms (e.g., Tally, Snapshot) that allow users to discuss and vote on governance proposals. Access Archive Data for free on Alchemy ======================================= Alchemy's [Supernode](https://www.alchemy.com/supernode) supports unlimited requests for archive data and provides access to all the historical blockchain information you need. The good part? You can connect to an archive node for free. Even though archive data is more expensive to get, Alchemy offers unrestricted archive node access even for users on Supernode’s free tier. This means you can get past on-chain data and even fork the entire chain from genesis, without paying additional fees. How to request archive data using Alchemy ----------------------------------------- Here is a step-by-step process for requesting archive data with Alchemy: 1. [Sign up](https://dashboard.alchemy.com/signup?utm_source=docs&utm_medium=referral&utm_content=what-is-archive-data-on-ethereum) for an account (it's free!) and create your first project. 2. [Create your Alchemy key](https://www.alchemy.com/docs/alchemy/introduction/getting-started) . This is the URL endpoint for getting realtime and archive data. 3. Start sending requests to this endpoint for archive data. Conclusion ========== Archive nodes can store past blockchain states extending beyond the most recent 128 blocks. If your dApp or Web3 service requires accessing historical blockchain data(data older than 128 blocks), running an archive node is a no-brainer. But be aware that the demands of running a fully functional archive node can discourage developers and stall development plans. Alchemy’s Supernode solves this problem by connecting users with archive nodes that use free URL endpoints. With Alchemy, getting archive data has never been easier! Was this page helpful? YesNo --- # How to Calculate Ethereum Miner Rewards | Alchemy Docs Copy page How to Calculate Ethereum Miner Rewards ======================================= Tutorial on how to calculate miner rewards for a single Ethereum block Have you ever wondered how much a miner earns for mining a block on Ethereum? Maybe you’re curious about what miners are earning or have a practical application (i.e. blockchain explorer, miner profit calculator, etc) for calculating a block reward. You could achieve this by checking Etherscan’s “block reward” field if you believe their calculations are accurate. Another alternative would be to check the miner’s wallet balance via `eth_getBalance` before and after a given block is mined. The issue with this solution is that it will only be accurate when the miner does not receive ether from a transaction. For example, if a miner receives 1ETH in the block they mined, your reward calculation would be offset. In this tutorial, we will explore a different approach that does require trusting a 3rd party or miner balance. To accurately calculate a block reward, the following parts are needed: * **Block reward**: A fixed inflationary reward that only changes at forks. The block reward is currently set to 2ETH and was last set by [EIP-1234](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1234.md) at the Constantinople fork. Consequently, each Ethereum block excluding burned fees adds 2ETH to the total currency supply. * **Transaction gas fees**: Each transaction on Ethereum requires a certain amount of gas units to execute Opcode commands on the EVM which change the state of the network. Although each operation requires a fixed amount of gas, the rate at which a user pays for those gas units changes based on a block’s `baseFeePerGas` and the user specified `maxPriorityFeePerGas` (miner tip). The `baseFeePerGas` is the minimum rate a user can pay to include their transaction in the next block and is determined by the previous block’s total gas usage. If the previous block uses less than 50% of it’s gas capacity (30 million units) the base fee decreases. If the previous block’s gas usage is equal to 50% the base fee stays the same. Otherwise, if the gas usage is above 50% the base fee will increase in the next block. Because, the base fee is burned, adding a miner tip gives some incentive to a miner to include your transaction in the next block. The basic formula is as follows: `gas units` x (`baseFeePerGas` + `maxPriorityFeePerGas`) = **transaction fee** An example fee could look like this: **21,000 x (15 gwei + 1.5gwei) = 346500gwei or 0.0003465ETH** * **Burned fees**: The `baseFeePerGas` is burned/removed from the Ethereum protocol altogether. In order to calculate the total amount of burned fees in a block you can use the following formula: `baseFeePerGas` x `gasUsed` = burned fees Once you know the total amount burned, you can subtract this from the total block reward. * **Uncle and nephew block rewards**: The final part of our block reward calculation is to add additional rewards for mining an Uncle block (uncle reward) or including it in the latest block (nephew reward). An uncle block occurs when two miners create blocks at almost the same time. While both blocks are valid, the network can only accept one block at a time. Therefore one block is rejected and labeled as an uncle block. Instead of letting this block go stale, a nephew reward equal to 1/32 of a block reward is issued to any miner willing to later include this uncle block inside a block they are mining. Additionally, an uncle reward is issued to the miner of the uncle block. The size of the uncle reward is determined by the following formula: (`Uncle blockNumber` + 8 - `Block Number`) x `block reward` / 8 = **uncle reward**. Here’s a few examples: - **(100 + 8 - 101) x 2 / 8 = 1.75ETH** - **(100 + 8 - 102) x 2 / 8 = 1.5ETH** - **(100 + 8 - 103) x 2 / 8 = 1.25ETH** The formula ensures that the more blocks that pass between the uncle and when it’s added to the network, the smaller the reward. This is not the case for the nephew block, which is fixed at 1/32 of a block reward. Currently, the nephew reward is: **2ETH/32 = 0.0652ETH** Awesome, now we have all the necessary ingredients for calculating the block reward! Lets put it all together into a recipe: `block reward` + `transaction fees sum` + `nephew reward` - `burned fees` = **miner reward** You could add the uncle fees too; however, because they are going to a separate miner for a different block we will include them separately. In the next section, we will set up our project environment and calculate the miner reward using Alchemy’s API and ethers Prerequisites ============= Before you begin this tutorial, please ensure you have the following: * An Alchemy account ([Create a free Alchemy account](https://dashboard.alchemy.com/signup?utm_source=docs&utm_medium=referral&utm_content=how-to-calculate-ethereum-miner-rewards) ). * Node.JS (>14) and npm installed ([Install NodeJs and NPM](https://www.alchemy.com/docs/alchemy/guides/alchemy-for-macs#1-install-nodejs-and-npm) ) Connect to Alchemy ================== We will [create a unique Alchemy API key](https://dashboard.alchemy.com/signup?utm_source=docs&utm_medium=referral&utm_content=how-to-calculate-ethereum-miner-rewards)  to connect to Ethereum through Alchemy: Navigate to your Alchemy dashboard and follow the steps below: 1. From the Alchemy Dashboard, hover over **Apps,** then click **+Create App**. 2. Name your app: **BlockRewardDemo**. 3. Select the **Ethereum** and **mainnet** for your network. 4. Click **Create app**. Setup project environment ========================= Open VS Code (or your preferred IDE) and enter the following in terminal: bash mkdir minerRewardDemo cd minerRewardDemo Next, initialize npm (node package manager) with the following command: bash npm init Press enter and answer the project prompt as follows: json package name: (minerRewardDemo) version: (1.0.0) description: entry point: (index.js) test command: git repository: keywords: author: license: (ISC) Press enter again to complete the prompt. If successful, a `package.json` file will have been created in your directory. Install environment tools ------------------------- The tools you will need to complete this tutorial are: * [ethers](https://docs.ethers.io/v5/) (A library that makes it easy to interact with Ethereum. However, we will really only use it for it’s conversion functions) * [axios](https://axios-http.com/) (to make jsonrpc requests to Alchemy’s API) * [dotenv](https://www.npmjs.com/package/dotenv)  (so that you can store your private key and API key safely) To install the above tools, ensure you are still inside your root folder and type the following commands in terminal: ### Ethers bash npm install --save ethers ### Axios bash npm install axios ### Dotenv bash npm install dotenv --save Above, we have imported the libraries that we installed and all of the necessary variables to interact with `.env` Create a Dotenv File -------------------- Create an `.env` file in your root folder. The file must be named `.env` or it will not be recognized. In the `.env` file, we will store all of our sensitive information (i.e., our Alchemy API key and MetaMask private key). Copy the following into your `.env`: bash MAINNET_API_URL = "https://eth-mainnet.g.alchemy.com/v2/{YOUR_ALCHEMY_API_KEY}" * Replace `{YOUR_ALCHEMY_API_KEY}` with the respective Alchemy API keys found on Alchemy's dashboard, under **VIEW KEY** Call Alchemy methods with axios =============================== In your root folder, create a file named **getBlockReward.js** and add the following lines of code: jsx const { default: axios } = require("axios"); const { ethers } = require("ethers"); require("dotenv").config(); const ALCHEMY_API_URL = process.env.MAINNET_API_URL const getBlockReward = async blockNum => { // Alchemy requests will go here } Above, we have imported **axios**, **ethers**, and our **dotenv** config. We are storing our Alchemy API URL in a variable so that we can use it to make requests to Alchemy’s Ethereum methods. Additionally, we’ve created an async function and passed a block number. Next, let’s create an async function inside `getBlockReward` to make a request using `eth_getBlockByNumber` with our API key. Since we need to provide a hexadecimal value to the method params, let’s also convert the passed `blockNum` variable to a hex value: jsx const getBlock = async num => { const blockNumHex = ethers.utils.hexlify(num); const blockRes = await axios.post( ALCHEMY_API_URL, { jsonrpc: "2.0", method: "eth_getBlockByNumber", params: [blockNumHex, true], id: 0, } ); return blockRes.data.result; } We’ve also passed a `true` Boolean in the params to get full transaction details which include the effective gas price of each transaction in the block. We’ll also need to create functions for fetching gas usage from transactions and uncle block data via a block hash. Below the `blockRes` request, create an async function called `getGasUsage` and pass a transaction hash variable. Then, use axios to make a call to Alchemy’s `eth_getTransactionReceipt` and pass the hash variable inside the request params: jsx const getGasUsage = async hash => { const txRes = await axios.post( ALCHEMY_API_URL, { jsonrpc: "2.0", method: "eth_getTransactionReceipt", params: [`${hash}`], id: 0, } ); return txRes.data.result.gasUsed; }; Now, let’s create a similar async function to get uncle block data. We’ll pass a block hash variable and call `eth_getBlockByHash` with a `false` Boolean as we do not need the full transaction details for uncle blocks: jsx const getUncle = async hash => { const uncleRes = await axios.post( ALCHEMY_API_URL, { jsonrpc: "2.0", method: "eth_getBlockByHash", params: [`${hash}`, false], id: 0, } ); return uncleRes.data.result; }; Your entire **getBlockReward.js** file should look like this: jsx const { default: axios } = require("axios"); const { ethers } = require("ethers"); require("dotenv").config(); const ALCHEMY_API_URL = process.env.MAINNET_API_URL const getBlockReward = async blockNum => { const getBlock = async num => { const blockNumHex = ethers.utils.hexlify(num); const blockRes = await axios.post( ALCHEMY_API_URL, { jsonrpc: "2.0", method: "eth_getBlockByNumber", params: [blockNumHex, true], id: 0, } ); return blockRes.data.result; } const getGasUsage = async hash => { const txRes = await axios.post( ALCHEMY_API_URL, { jsonrpc: "2.0", method: "eth_getTransactionReceipt", params: [`${hash}`], id: 0, } ); return txRes.data.result.gasUsed; }; const getUncle = async hash => { const uncleRes = await axios.post( ALCHEMY_API_URL, { jsonrpc: "2.0", method: "eth_getBlockByHash", params: [`${hash}`, false], id: 0, } ); return uncleRes.data.result; }; }; Nice! That should be all we need in terms of making requests to Ethereum. In the next section let’s calculate a miner reward using the data from the functions we just created. Calculate a miner reward ======================== Now that we have functions to call all the necessary Alchemy methods, let’s construct the miner reward formula by calculating the sum of all transactions in a block, the sum of burned fees, and the nephew block rewards. Before we jump into it, let’s create a try-catch statement and define a few key variables. At the very bottom of the `getBlockReward` function, add the following: jsx try { console.log("fetching block rewards...") const block = await getBlock(blockNum); const blockNumber = parseInt(block.number) const transactions = block.transactions; const baseFeePerGas = block.baseFeePerGas; const gasUsed = block.gasUsed; } catch (error) { console.log(error); } Above, we call our `getBlock` function and store the response in the `block` variable. From the response, we can extract the block number, transaction array, transaction base fee, and the sum of gas used within the entire block. Cost of all transactions in a block ----------------------------------- First, let’s start with getting the sum of transaction fees for the given block. In order to do this, we can iterate over the transactions in the transaction array to get the gas price. We will also need the amount of gas units to calculate the total fee. To get the amount of gas used for each transaction, we can call our `getGasUsage` function and pass each transaction hash to the function. Finally, we can multiply the transaction gas usage by the gas price to get the total fee. Since we later want to sum these transaction fees, let’s also move them to an array. Ensure you’re still inside the try-catch. Then, create an empty `minerTips` array and set a sum variable to zero: jsx let minerTips = []; let sumMinerTips = 0; Next, let’s use a for loop to iterate over the transactions in our block and calculate the total fee: jsx for (const tx of transactions) { const txGasUseage = await getGasUsage(tx.hash); const totalFee = ethers.utils.formatEther( ethers.BigNumber.from(txGasUseage).mul(tx.gasPrice).toString() ); minerTips.push(Number(totalFee)); } Above, we use the transaction hash to return the gas usage for each transaction. Then we convert our `gasUsage` variable using [bignumber](https://docs.ethers.io/v5/api/utils/bignumber/) so that we can multiply it by the `gasPrice` and format the result into an Ether value as it is currently in wei. Finally, we push the total fee value to an array which we can sum to get the total for all transaction fees in our block: jsx if (transactions.length > 0) { sumMinerTips = minerTips.reduce( (prevTip, currentTip) => prevTip + currentTip ); } As long as there is at least one transaction, we will add the items in the `minerTips` array and set the total equal to `sumMinerTips`. Otherwise, `sumMinerTips` will stay equal to zero. Sum the burned fees in a block ------------------------------ Next, we’ll need to get the sum of burned fees in our block so that we can subtract it from the total reward. To do this, we need to multiply the total `gasUsed` by the `baseFeePerGas`: jsx const burnedFee = ethers.utils.formatEther( ethers.BigNumber.from(gasUsed).mul(baseFeePerGas).toString() ); Again, we use [bignumber](https://docs.ethers.io/v5/api/utils/bignumber/) to multiply the wei values and format the result in Ether. Uncle and nephew rewards ------------------------ ### nephew rewards Let’s start with the nephew reward. Because the nephew reward is 1/32 of the block reward, the reward should be fixed to 0.0625ETH/uncle block. To calculate this add the following lines of code: jsx const baseBlockReward = 2; const nephewReward = baseBlockReward / 32; const uncleCount = block.uncles.length; const totalNephewReward = uncleCount * nephewReward; ### Uncle rewards In order to calculate the uncle rewards, we’ll need to iterate over each of the block hashes found in the `block.uncles` property of our `block` variable. Then, we’ll pass each hash to our `getUncle` function to extract both the uncle block number and miner. Finally, we’ll push the block number and miner to an uncle rewards array: jsx let uncleRewardsArr = []; for (const hash of block.uncles) { const uncle = await getUncle(hash) const uncleNum = parseInt(uncle.number) const uncleMiner = uncle.miner const uncleReward = (uncleNum + 8 - blockNumber) * baseBlockReward / 8; uncleRewardsArr.push({ reward: `${uncleReward}ETH`, miner: uncleMiner }) } Final miner reward calculation ------------------------------ Now that we have the sum of transaction fees and sum of burned fees let’s calculate the miner reward in a scenario where there is no uncle block included: jsx const blockReward = baseBlockReward + (sumMinerTips - Number(burnedFee)); This will give us the basic block reward, however let’s also account for nephew and uncle rewards by adding the `totalNephewReward` when the given block contains at least one uncle hash: jsx if (uncleCount > 0) { console.log("Block reward:", blockReward + totalNephewReward + "ETH"); console.log("miner:", block.miner); console.log("Uncle rewards:"); console.log(uncleRewardsArr); } else { console.log("Block reward:", blockReward + "ETH"); console.log("miner:", block.miner); } Above we are printing the total block reward plus the total nephew reward when the block contains uncles. Otherwise, we simply print the block block reward and miner. Your entire **getBlockReward.js** file should appear as follows: jsx const { default: axios } = require("axios"); const { ethers } = require("ethers"); require("dotenv").config(); const ALCHEMY_API_URL = process.env.MAINNET_API_URL; const getBlockReward = async blockNum => { const getBlock = async num => { const blockNumHex = ethers.utils.hexlify(num); const blockRes = await axios.post(ALCHEMY_API_URL, { jsonrpc: "2.0", method: "eth_getBlockByNumber", params: [blockNumHex, true], id: 0, }); return blockRes.data.result; }; const getGasUsage = async hash => { const txRes = await axios.post(ALCHEMY_API_URL, { jsonrpc: "2.0", method: "eth_getTransactionReceipt", params: [`${hash}`], id: 0, }); return txRes.data.result.gasUsed; }; const getUncle = async hash => { const uncleRes = await axios.post(ALCHEMY_API_URL, { jsonrpc: "2.0", method: "eth_getBlockByHash", params: [`${hash}`, false], id: 0, }); return uncleRes.data.result; }; try { console.log("fetching block rewards..."); const block = await getBlock(blockNum); const blockNumber = parseInt(block.number); const transactions = block.transactions; const baseFeePerGas = block.baseFeePerGas; const gasUsed = block.gasUsed; let minerTips = []; let sumMinerTips = 0; for (const tx of transactions) { const txGasUseage = await getGasUsage(tx.hash); const totalFee = ethers.utils.formatEther( ethers.BigNumber.from(txGasUseage).mul(tx.gasPrice).toString() ); minerTips.push(Number(totalFee)); } if (transactions.length > 0) { sumMinerTips = minerTips.reduce( (prevTip, currentTip) => prevTip + currentTip ); } const burnedFee = ethers.utils.formatEther( ethers.BigNumber.from(gasUsed).mul(baseFeePerGas).toString() ); const baseBlockReward = 2; const nephewReward = baseBlockReward / 32; const uncleCount = block.uncles.length; const totalNephewReward = uncleCount * nephewReward; let uncleRewardsArr = []; for (const hash of block.uncles) { const uncle = await getUncle(hash); const uncleNum = parseInt(uncle.number); const uncleMiner = uncle.miner; const uncleReward = ((uncleNum + 8 - blockNumber) * baseBlockReward) / 8; uncleRewardsArr.push({ reward: `${uncleReward}ETH`, miner: uncleMiner, }); } const blockReward = baseBlockReward + (sumMinerTips - Number(burnedFee)); if (uncleCount > 0) { console.log("Block reward:", blockReward + totalNephewReward + "ETH"); console.log("miner:", block.miner); console.log("Uncle rewards:"); console.log(uncleRewardsArr); } else { console.log("Block reward:", blockReward + "ETH"); console.log("miner:", block.miner); } } catch (error) { console.log(error); } }; Okay we’re almost there! At the bottom of your file call the `getBlockReward` function and pass any block number inside: jsx getBlockReward(15349734); Finally, ensure you’re inside your root folder, then run the following command: bash node getBlockReward.js If successful, you should see these results in console: bash fetching block rewards... Block reward: 2.066205744642072ETH miner: 0xea674fdde714fd979de3edf0f56aa9716b898ec8 Uncle rewards: [\ {\ reward: '1.75ETH',\ miner: '0x8b4de256180cfec54c436a470af50f9ee2813dbb'\ }\ ] 🥳 Woohoo! Nice work, you’ve calculated a block reward and completed the tutorial! 🥳 If you enjoyed this tutorial on calculating a miner reward, give us a tweet [@Alchemy](https://twitter.com/Alchemy) ! And don't forget to join our [Discord server](https://www.alchemy.com/discord) to meet other blockchain devs, builders, and entrepreneurs! Was this page helpful? YesNo --- # Internal Playbook: Upgrading Ethereum Nodes | Alchemy Docs Copy page Internal Playbook: Upgrading Ethereum Nodes =========================================== Check out this internal playbook for why, when, and how we upgrade our Ethereum nodes for our users 🚀 This guide was originally published on [Medium](https://medium.com/alchemy-api/the-alchemist-playbook-a-guide-to-upgrading-ethereum-nodes-123e0a47e5c3) . On November 10th, the Ethereum ecosystem was hit by a flurry of errors, incorrect data, and downtime. While our infrastructure and our customers passed through the storm without incident, many other developers had a long night on-call. At around 11 pm PDT, stating at block 11234873, a [consensus error surfaced in Geth versions older than 1.9.17](https://gist.github.com/karalabe/e1891c8a99fdc16c4e60d9713c35401f) that caused nodes to get stuck on an incorrect fork of mainnet. Future releases fixed this bug, but if you run your own nodes and hadn’t upgraded since July, then your production traffic was significantly impacted. Fortunately, our rigorous upgrading standards ensured that Alchemy Supernode was not affected by the incident, as we were on Geth v1.9.20 (released August 25th). If you’re running your own nodes, this incident serves as a reminder: update, update, update. If you rely on a service provider, then it’s important you have transparency into why, when, and how they conduct their upgrades so that you don’t have to worry about these types of inconsistencies. About a year ago, we did a deep dive into the [Constantinople upgrade](https://medium.com/alchemy-api/dont-get-forked-best-practices-for-handling-constantinople-and-ethereum-client-upgrades-e0d6b5dd8e9c) . Today, we wanted to revisit our practices to be fully transparent about how the Alchemy Developer Platform maintains and upgrades [Supernode](https://alchemyapi.com/supernode) — the next generation Ethereum infrastructure layer we built that supports continuously updated versions of both Geth and Parity. * * * Why Upgrade Nodes? ------------------ In general, we update our nodes for the same reason that updates become available in the first place: critical bug fixes, security patches, and new features. While remaining on older versions provides stability, it risks eventually running into errors that cause vulnerability or downtime, as seen in the incident this morning. At Alchemy, we do our best to strike a balance between stability and timeliness. * * * When To Upgrade Nodes? ---------------------- Historically, we tend to upgrade our nodes every few months, a heuristic that generally ensures the new version has been significantly battle-tested while also giving our customers access to the latest features. Of course, this cadence can be expedited if there is a significant breaking change or security vulnerability that needs to be immediately patched. Like most things work-related, our internal process is kicked off with a Slack notification. Whenever a new version of Geth or Parity is pushed to Github, we get an alert on Slack and kick off our exhaustive testing standards to ensure the stability of the Alchemy Supernode. * * * How To Upgrade Nodes? --------------------- Once we’ve decided to move forward with a new stable version, we step through the following phases: **Phase 0 — Code Audit** Our core infrastructure engineers read through the release notes, looking for critical fixes that need immediate deployment as well as breaking changes that need to be tested. If necessary, we will even deep dive into the changelog to get a better understanding of some of the key differences and how they might potentially impact our customers. **Phase 1 — Automated Integration Test Suite** Once we have a good understanding of the update, the testing phase begins. To do this, we provision a few nodes on the upgraded version and pull out a few of the nodes on the old version currently serving our production traffic. To make sure we have extensive coverage, we replay a curated sample of our production traffic on both our old and new nodes to look for breaking changes. We also add specific integration tests for all cases called out in the changelog notes. All of these tests have specific handling for idempotent and non-idempotent results to ensure that we capture payload discrepancies across all method invocations. **Phase 2 — Customer Notifications** If we notice any possible breaking changes after the first two phases, we alert all affected customers. You might not care that Geth has a new StackTrie implementation for its receipt root hashes, but depending on your use case, it might be critical to know about a change in default gas limits for EVM execution. With this in mind, we make sure our customers have time to adequately respond to critical changes in the API or implementation and make any modifications to their codebase; the bigger the breaking change, the more time we wait. **Phase 3 — Blue-Green Deployment** It’s time to deploy. We spin up a whole fleet of upgraded nodes in an isolated, load-balanced cluster to match the capacity of our current nodes. Once the new nodes are ready, we start a blue-green deployment, slowly transitioning traffic to the upgraded nodes while running the old and new nodes in parallel. **Phase 4 — Enhanced Monitoring and Alerting** During this time, our engineering team stands on-call watching the deployment over the next 48 hours, ready to instantly roll back if our enhanced monitoring tools detect any problems. The engineering team also actively engages in real-time support chats to answer questions for customers and to get additional warnings about any issues not caught by our automated tools. **Phase 5 — Multi-Tiered Backup Infrastructure** In the event that a problem does occur, we have a multi-tiered backup system ready to respond instantly. We continue to run the older nodes as we transition to the new ones so that we can immediately switch back to the previous version, and we also maintain snapshots of older node versions in case we need to switch back to an even earlier version. **Phase 6 — Fail-Safe Architecture** In the unlikely case of an unrecoverable failure during the upgrade process, Alchemy Supernode has integrated both Geth and Parity, so even if all nodes of one type fail, we can still fall back on the other type. **Phase 7 — Automated Monitoring and Alerting** Once the transition is successfully complete, if our system detects any subsequent performance issues on any of the nodes, our automatic alerting engine kicks in. It not only immediately notifies one of our infrastructure engineers so that we can address the root cause, but we also have safeguards in place to dynamically reallocate traffic and ensure our customers’ mission-critical operations are up and running 99.99% of the time. * * * Calling All Alchemists 🧙 ------------------------- If you are running your own node infrastructure, we hope the process we’ve outlined is helpful in determining why, when, and how to upgrade. If you don’t want to ever have to deal with node upgrades, along with a slew of other unseen issues and costs that come with creating a stable and scalable node infrastructure, like monitoring, load balancing, and guaranteeing consistency, then we'd love to see you [become an Alchemist](https://dashboard.alchemy.com/signup?utm_source=docs&utm_medium=referral&utm_content=internal-playbook-upgrading-ethereum-nodes) ! Was this page helpful? YesNo --- # How to Subscribe to Mined Transactions via WebSocket Endpoints | Alchemy Docs Copy page How to Subscribe to Mined Transactions via WebSocket Endpoints ============================================================== Learn how to subscribe to mined transactions via WebSockets, and view the full transactions objects or hashes mined on the network based on specified filters and block tags. This tutorial uses the **[alchemy\_minedTransactions](https://www.alchemy.com/docs/reference/alchemy-minedtransactions) ** subscription endpoint. Alchemy provides the most effective method to subscribe to mined transactions, log events, and new blocks using WebSockets on Ethereum, Polygon, Arbitrum, and Optimism. You can access direct subscription types by connecting to WebSocket endpoints using modern Web3 libraries. In this tutorial, we will test and create a sample project using the [`alchemy_minedTransactions`](https://www.alchemy.com/docs/reference/alchemy-minedtransactions) method with Viem and Ethers.js. **What relevance does the `alchemy_minedTransactions` provide to users?** * Tracking transactions being mined and notify users via SMS - [Alchemy Notify API](https://www.alchemy.com/docs/reference/notify-api-quickstart) * Display all transactions within the Ethereum network on a rolling basis **How does `alchemy_minedTransactions` compare to `[alchemy_pendingTransactions](ref:alchemy-pendingTransactions)`?** Although both these Subscription API endpoints emit full transaction objects or hashes and filter based on specified parameters, they serve two different objectives. The `alchemy_minedTransactions` returns entire transactions that are **mined** on the network whereas `alchemy_pendingTransactions` returns transactions that are **sent** to the network and marked as **pending**. Developers can enhance the requests with specific parameters including: * `addresses`(optional): Singular address or array of addresses **to** receive pending transactions sent from this address. * `includeRemoved`(optional): Singular address or array of addresses **from** receive pending transactions sent from this address. * `hashesOnly`(optional - default set to `false`): The response matches the payload of [eth\_getTransactionByHash](https://www.alchemy.com/docs/reference/eth-gettransactionbyhash) . This is information about a transaction by the transaction hash including `blockHash`, `blockNumber` and `transactionIndex`. If set to `true`, the payload will return only the hashes of the mined transactions. Step 0: Configure your developer environment -------------------------------------------- 1\. Install [Node.js](https://nodejs.org/en/) (> 14) on your local machine 2\. Install [npm](https://www.npmjs.com/) on your local machine 3\. Install [wscat](https://www.npmjs.com/package/wscat) on your local machine To check your Node version, run the following command in your terminal: bash node -v 4\. [Create a free Alchemy account](https://dashboard.alchemy.com/signup?utm_source=docs&utm_medium=referral&utm_content=how-to-subscribe-to-pending-transactions-via-websocket-endpoints) Step 1: Open your Alchemy App ----------------------------- Once your Alchemy account is created, there will also be a default app that is also created. To create another Alchemy app, check out [this video](https://www.youtube.com/watch?time_continue=1&v=tfggWxfG9o0&feature=emb_logo) . Step 2: Get WebSocket URL from Alchemy App ------------------------------------------ Once you have created your app, get your WebSocket URL that we will use later in this tutorial. 1. Click on your app's **View Key** button in the dashboard 2. Copy and save the **WebSocket URL** Step 3: Output Mined Transactions Using wscat --------------------------------------------- **Wscat** is a terminal or shell tool used to connect to the WebSockets server. Each Alchemy application will provide a WebSocket URL that can be used directly with the wscat command. 1. Initiate the WebSocket stream 2. Enter the specific call command The following example will use the `demo` key, but should be replaced with your key from Step 2. From your terminal, run the following commands: wscat // initiate websocket stream first and replace demo with your key wscat -c wss://eth-mainnet.g.alchemy.com/v2/demo // no param specification - return all mined txs {"jsonrpc":"2.0","id": 2, "method": "eth_subscribe", "params": ["alchemy_minedTransactions"]} // to and from filters, hashesOnly = true {"jsonrpc": "2.0", "method": "eth_subscribe","params": ["alchemy_minedTransactions", {"addresses": [{"to": "0x9f3ce0ad29b767d809642a53c2bccc9a130659d7", "from": "0x228f108fd09450d083bb33fe0cc50ae449bc7e11"}, {"to": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"}],"includeRemoved": false, "hashesOnly": true}],"id": 1} If successful, you should see output that looks something like this: Results {"id":1,"result":"0xf13f7073ddef66a8c1b0c9c9f0e543c3","jsonrpc":"2.0"} // hashesOnly = true { "jsonrpc": "2.0", "method": "eth_subscription", "params": { "result": { "removed": false "transaction": { "hash":"0xa8f2cf69e302da6c8100b80298ed77c37b6e75eed1177ca22acd5772c9fb9876", } }, "subscription": "0xf13f7073ddef66a8c1b0c9c9f0e543c3" } } // hashesOnly = false { "jsonrpc": "2.0", "method": "eth_subscription", "params": { "result": { "removed": false "transaction": { "blockHash":"0xbe847be2bceb74e660daf96b3f0669d58f59dc9101715689a00ef864a5408f43", "blockNumber":"0x5b8d80", "hash":"0xa8f2cf69e302da6c8100b80298ed77c37b6e75eed1177ca22acd5772c9fb9876", "from":"0x2a9847093ad514639e8cdec960b5e51686960291", "gas":"0x4f588", "gasPrice":"0xc22a75840", "input":"0x000101d521928b4146", "nonce":"0x9a2", "r":"0xb5889c55a0ebbf86627524affc9c4fdedc4608bee7a0f9880b5ec965d58e4264", "s":"0x2da32e817e2483ec2199ec0121b93384ac820049a75e11b40d152fc7558a5d72", "to":"0xc7ed8919c70dd8ccf1a57c0ed75b25ceb2dd22d1", "transactionIndex":"0x14", "type":"0x0", "v":"0x1c", "value":"0x0" } }, "subscription": "0xf13f7073ddef66a8c1b0c9c9f0e543c3" } } By using **wscat**, you are able to verify the transaction immediately via the computer's terminal or shell. Step 4: Create a Node project ----------------------------- Let's create an empty repository and install the necessary dependencies for WebSocket connections. We can use either Viem or Ethers.js to manage WebSocket subscriptions. From your terminal, run the following commands: Viem Ethers.js mkdir mined-transactions && cd mined-transactions npm init -y npm install viem touch main.js This will create a repository named `mined-transactions` that holds all the files and dependencies we need. Open this repo in your preferred code editor, where we'll write our code in the `main.js` file. Step 5: Output Mined Transactions using WebSocket libraries ----------------------------------------------------------- Next, we'll demonstrate how to use Viem or Ethers.js to subscribe to mined transactions. To make requests using Alchemy's minedTransactions API, we recommend reviewing the [alchemy\_minedTransactions docs](https://www.alchemy.com/docs/reference/alchemy-minedtransactions) . Next, add the following code to the `main.js` file, using your Alchemy API key: Viem Ethers.js import { createPublicClient, webSocket } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: webSocket('wss://eth-mainnet.g.alchemy.com/v2/<-- ALCHEMY APP API KEY -->') }) // Subscribe to new blocks to get mined transactions const unsubscribe = client.watchBlocks({ onBlock: async (block) => { console.log('New block:', block.number) // Get all transactions in the block const blockWithTxs = await client.getBlock({ blockNumber: block.number, includeTransactions: true }) console.log(`Block ${block.number} has ${blockWithTxs.transactions.length} transactions`) blockWithTxs.transactions.forEach((tx, index) => { if (index < 3) { // Show first 3 transactions for brevity console.log('Mined transaction:', tx.hash) } }) } }) console.log('Listening for mined transactions...') Run this script by running the following command in your terminal: `node main.js` It should look something like this: If successful, you should see a stream of transactions as the result. This stream of output indicates the **all transactions** that are mined on the Ethereum Mainnet. Results { removed: false, transaction: { blockHash: '0x1a6adfef39de127f52cd451af2352a97c06cccdd6afe3a30bfa26c45165de74d', blockNumber: '0xf25e13', from: '0x30d762b88f9e4cd6aca5ee47da31538d3d02ebae', gas: '0x5208', gasPrice: '0x4486199b4', hash: '0x2a35069462e8ff5ae44579cce690116b0520e2c190fa75a452b50190bfec862c', input: '0x', nonce: '0x4', to: '0x974caa59e49682cda0ad2bbe82983419a2ecc400', transactionIndex: '0xae', value: '0x32e997e5e977820', type: '0x0', chainId: '0x1', v: '0x25', r: '0x89b952803c6e94e4caaaaa3c82d426d40fdc5471019a9ff550fc006a546a8537', s: '0x1d5180386250c53f7073a06d2dd02790a410e03cf1d8184cc861456bdefb2325' } } { removed: false, transaction: { blockHash: '0x1a6adfef39de127f52cd451af2352a97c06cccdd6afe3a30bfa26c45165de74d', blockNumber: '0xf25e13', from: '0xaccbbf7a2189a56c0dfd10bb37d8316d300dbcd4', gas: '0x15f90', gasPrice: '0x4486199b4', maxFeePerGas: '0x4486199b4', maxPriorityFeePerGas: '0x4486199b4', hash: '0x1c22aee60a6121ce29073a1771155216ccee54962cb235c0ec8d71b6449dd708', input: '0x2d2da806000000000000000000000000accbbf7a2189a56c0dfd10bb37d8316d300dbcd4', nonce: '0x4', to: '0xabea9132b05a70803a4e85094fd0e1800777fbef', transactionIndex: '0xaf', value: '0x38866cac3c00', type: '0x2', accessList: [], chainId: '0x1', v: '0x1', r: '0x7a7a294c5844a2b16f8b2cd5ddc3b748e3ab89215f6974f82910d95d5707b47a', s: '0x79f17cec79d3a66b89780345831408288c9a2c535548c5df35fd9df0692ab5a3' } } Step 6: Filter Mined Transactions --------------------------------- Next, we'll demonstrate how to filter mined transactions based on addresses. While standard WebSocket subscriptions don't offer built-in filtering, we can implement filtering logic in our application. Note: The Alchemy-enhanced `alchemy_minedTransactions` API provides native filtering by addresses, `includeRemoved`, and `hashesOnly`. For standard WebSocket subscriptions, we need to implement filtering manually as shown below. Add the following code to the `main.js` file, using your Alchemy API key: Viem Ethers.js import { createPublicClient, webSocket } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: webSocket('wss://eth-mainnet.g.alchemy.com/v2/<-- ALCHEMY APP API KEY -->') }) // Address to filter for const targetAddress = "0x473780deaf4a2ac070bbba936b0cdefe7f267dfc" // Subscribe to new blocks and filter transactions const unsubscribe = client.watchBlocks({ onBlock: async (block) => { try { const blockWithTxs = await client.getBlock({ blockNumber: block.number, includeTransactions: true }) // Filter transactions by from/to address const filteredTxs = blockWithTxs.transactions.filter(tx => tx.from?.toLowerCase() === targetAddress.toLowerCase() || tx.to?.toLowerCase() === targetAddress.toLowerCase() ) if (filteredTxs.length > 0) { console.log(`Block ${block.number}: Found ${filteredTxs.length} filtered transactions`) filteredTxs.forEach(tx => { console.log('Filtered mined transaction:', { hash: tx.hash, from: tx.from, to: tx.to, value: tx.value?.toString() }) }) } } catch (error) { console.error('Error processing block:', error) } } }) console.log(`Listening for mined transactions involving ${targetAddress}...`) Conclusion ========== You now know how to use WebSocket connections with Viem and Ethers.js to [subscribe to mined transactions](https://www.alchemy.com/docs/reference/alchemy-minedtransactions) and filter them based on addresses. For more advanced filtering capabilities, consider using Alchemy's enhanced `alchemy_minedTransactions` API which provides native filtering by addresses, `includeRemoved`, and `hashesOnly` parameters. If you enjoyed this tutorial, tweet us at **@Alchemy**. If you have any questions or feedback, please contact us at [\[email protected\]](https://www.alchemy.com/cdn-cgi/l/email-protection#d4a7a1a4a4bba6a094b5b8b7bcb1b9adfab7bbb9) or open a ticket in the dashboard. Was this page helpful? YesNo --- # Worldchain | Alchemy Docs Copy page Worldchain ========== * [Official Docs](https://docs.world.org/world-chain) * [Github Repository](https://github.com/worldcoin/world-chain) The snapshot service for Worldchain is available [here](https://alchemy.com/snapshots/worldchain) . Whether you need to bootstrap your full node, you can use our daily snapshot service to speed up the process. Note: the nodes used for snapshotting are using the archive pruning values of Worldchain and are hosted as Systemd services on machines using Ubuntu 22.04. ### How to use You simply go to our [worldchain snapshot service](https://alchemy.com/snapshots/worldchain) and you can download the latest available snapshot! In order to use it, simply decompress the archive as per the following instructions and start your node. **1\. Download the snapshot** wget **2\. Stop your Worldchain service** If Worldchain was already running on your machine, stop your services: sudo systemctl stop sudo systemctl stop OR if you are using the recommended docker compose setup: docker compose down Make sure there is no process running that might try to write to the database. **3\. Clean the data directory** Make sure your Worldchain data directory is clean (let us assume `` is your root Worldchain directory): rm -rf /geth/chaindata rm -rf /geth/lightchaindata **4\. Install lz4 and decompress the archive** sudo apt-get install lz4 lz4 -c -d .tar.lz4 | tar -x -C /geth/ **5\. Start the Worldchain service or container** You should be in-sync with the network in minutes after starting the node. Please make sure to also check the Official Documentation and the Github Repository posted above in order to correctly deploy the node of your choice. Was this page helpful? YesNo --- # Aptos | Alchemy Docs Copy page Aptos ===== * [Official Docs](https://aptos.dev/) * [Github Repository](https://github.com/aptos-labs/aptos-core) The snapshot service for Aptos is available [here](https://alchemy.com/snapshots/aptos) . Whether you need to bootstrap your full node or you are in need of a snapshot to ease the migration or kick-start of your validator, you can use our daily snapshot service to speed up the process. Note: the nodes used for snapshotting are using the default pruning values of Aptos and are hosted as Docker containers on machines using Ubuntu 22.04. ### How to use You simply go to our [aptos snapshot service](https://alchemy.com/snapshots/aptos) and you can download the latest available snapshot! In order to use it, simply decompress the archive as per the following instructions and start your node. **1\. Download the snapshot** wget **2\. Stop your Aptos service** If Aptos was already running on your machine, stop your services: sudo systemctl stop aptos.service OR if you are using a container: docker stop Make sure there is no process running that might try to write to the database: ps -ef | grep aptos-node **3\. Clean the data directory** Make sure your Aptos data directory is clean (let us assume `` is your root Aptos directory): rm -rf /data/* **4\. Install lz4 and decompress the archive** sudo apt-get install lz4 lz4 -c -d .tar.lz4 | tar -x -C /data **5\. Start the Aptos service or container** You should be in-sync with the network in minutes after starting the node. Please make sure to also check the Official Documentation and the Github Repository posted above in order to correctly deploy the node of your choice. Was this page helpful? YesNo --- # Shape | Alchemy Docs Copy page Shape ===== * [Official Docs](https://docs.shape.network/) * [Github Repository](https://github.com/shape-network/) The snapshot service for Shape is available [here](https://alchemy.com/snapshots/shape) . Whether you need to bootstrap your full node, you can use our daily snapshot service to speed up the process. Note: the nodes used for snapshotting are using the archive pruning values of Shape and are hosted as Systemd services on machines using Ubuntu 22.04. ### How to use You simply go to our [shape snapshot service](https://alchemy.com/snapshots/shape) and you can download the latest available snapshot! In order to use it, simply decompress the archive as per the following instructions and start your node. **1\. Download the snapshot** wget **2\. Stop your Shape service** If Shape was already running on your machine, stop your services: sudo systemctl stop sudo systemctl stop OR if you are using the recommended docker compose setup: docker compose down Make sure there is no process running that might try to write to the database. **3\. Clean the data directory** Make sure your Shape data directory is clean (let us assume `` is your root Shape directory): rm -rf /geth/chaindata rm -rf /geth/lightchaindata **4\. Install lz4 and decompress the archive** sudo apt-get install lz4 lz4 -c -d .tar.lz4 | tar -x -C /geth/ **5\. Start the Shape service or container** You should be in-sync with the network in minutes after starting the node. Please make sure to also check the Official Documentation and the Github Repository posted above in order to correctly deploy the node of your choice. Was this page helpful? YesNo --- # Avalanche | Alchemy Docs Copy page Avalanche ========= * [Official Docs](https://build.avax.network/docs) * [Github Repository](https://github.com/ava-labs) The snapshot service for Avalanche is available [here](https://alchemy.com/snapshots/avalanche) . Whether you need to bootstrap your full node or you are in need of a snapshot to ease the migration or kick-start of your validator, you can use our daily snapshot service to speed up the process. Note: the nodes used for snapshotting are using the default pruning values of Avalanche and are hosted as Docker containers on machines using Ubuntu 22.04. ### How to use You simply go to our [avalanche snapshot service](https://alchemy.com/snapshots/avalanche) and you can download the latest available snapshot! In order to use it, simply decompress the archive as per the following instructions and start your node. **1\. Download the snapshot** wget **2\. Stop your Avalanche service** If Avalanche was already running on your machine, stop your services: sudo systemctl stop avalanche.service OR if you are using a container: docker stop Make sure there is no process running that might try to write to the database. **3\. Clean the data directory** Make sure your Avalanche data directory is clean (let us assume `` is your root Avalanche directory): rm -rf /db/mainnet/* **4\. Install lz4 and decompress the archive** sudo apt-get install lz4 lz4 -c -d .tar.lz4 | tar -x -C /db/mainnet/ **5\. Start the Avalanche service or container** You should be in-sync with the network in minutes after starting the node. Please make sure to also check the Official Documentation and the Github Repository posted above in order to correctly deploy the node of your choice. Was this page helpful? YesNo --- # Ink | Alchemy Docs Copy page Ink === * [Official Docs](https://docs.inkonchain.com/) * [Github Repository](https://github.com/inkonchain) The snapshot service for Ink is available [here](https://alchemy.com/snapshots/ink) . Whether you need to bootstrap your full node, you can use our snapshot service to speed up the process. Note: the nodes used for snapshotting are using the archive pruning values of Ink and are hosted as Systemd services on machines using Ubuntu 22.04. ### How to use You simply go to our [ink snapshot service](https://alchemy.com/snapshots/ink) and you can download the latest available snapshot! In order to use it, simply decompress the archive as per the following instructions and start your node. **1\. Download the snapshot** wget **2\. Stop your Ink service** If Ink was already running on your machine, stop your services: sudo systemctl stop sudo systemctl stop OR if you are using the recommended docker compose setup: docker compose down Make sure there is no process running that might try to write to the database. **3\. Clean the data directory** Make sure your Ink data directory is clean (let us assume `` is your root Ink directory): rm -rf /geth/chaindata **4\. Install lz4 and decompress the archive** sudo apt-get install lz4 lz4 -c -d .tar.lz4 | tar -x -C /geth/ **5\. Start the Ink service or container** You should be in-sync with the network in minutes after starting the node. Please make sure to also check the Official Documentation and the Github Repository posted above in order to correctly deploy the node of your choice. Was this page helpful? YesNo --- # Soneium | Alchemy Docs Copy page Soneium ======= * [Official Docs](https://docs.soneium.org/) * [Github Repository](https://github.com/soneium) The snapshot service for Soneium is available [here](https://alchemy.com/snapshots/soneium) . Whether you need to bootstrap your full node, you can use our snapshot service to speed up the process. Note: the nodes used for snapshotting are using the archive pruning values of Soneium and are hosted as Systemd services on machines using Ubuntu 22.04. ### How to use You simply go to our [soneium snapshot service](https://alchemy.com/snapshots/soneium) and you can download the latest available snapshot! In order to use it, simply decompress the archive as per the following instructions and start your node. **1\. Download the snapshot** wget **2\. Stop your Soneium service** If Soneium was already running on your machine, stop your services: sudo systemctl stop sudo systemctl stop OR if you are using the recommended docker compose setup: docker compose down Make sure there is no process running that might try to write to the database. **3\. Clean the data directory** Make sure your Soneium data directory is clean (let us assume `` is your root Soneium directory): rm -rf /geth/chaindata **4\. Install lz4 and decompress the archive** sudo apt-get install lz4 lz4 -c -d .tar.lz4 | tar -x -C /geth/ **5\. Start the Soneium service or container** You should be in-sync with the network in minutes after starting the node. Please make sure to also check the Official Documentation and the Github Repository posted above in order to correctly deploy the node of your choice. Was this page helpful? YesNo --- # Unichain | Alchemy Docs Copy page Unichain ======== * [Official Docs](https://docs.unichain.org/) * [Github Repository](https://github.com/Uniswap/unichain-node) The snapshot service for Unichain is available [here](https://alchemy.com/snapshots/unichain) . Whether you need to bootstrap your full node, you can use our snapshot service to speed up the process. Note: the nodes used for snapshotting are using the archive pruning values of Unichain and are hosted as Systemd services on machines using Ubuntu 22.04. ### How to use You simply go to our [unichain snapshot service](https://alchemy.com/snapshots/unichain) and you can download the latest available snapshot! In order to use it, simply decompress the archive as per the following instructions and start your node. **1\. Download the snapshot** wget **2\. Stop your Unichain service** If Unichain was already running on your machine, stop your services: sudo systemctl stop sudo systemctl stop OR if you are using the recommended docker compose setup: docker compose down Make sure there is no process running that might try to write to the database. **3\. Clean the data directory** Make sure your Unichain data directory is clean (let us assume `` is your root Unichain directory): rm -rf /geth/chaindata **4\. Install lz4 and decompress the archive** sudo apt-get install lz4 lz4 -c -d .tar.lz4 | tar -x -C /geth/ **5\. Start the Unichain service or container** You should be in-sync with the network in minutes after starting the node. Please make sure to also check the Official Documentation and the Github Repository posted above in order to correctly deploy the node of your choice. Was this page helpful? YesNo ---